I'm using the realscript package to get true super- and subscripts with LuaLaTex. However I'm not pleased with kerning of superscripts with the font I'm using, Linux Libertine. I've tried to adjust the kerning manually using Lua code. However, it doesn't appear make any visible difference. Here's my code:
\documentclass{article}
\setlength\parindent{0pt}
\usepackage{fontspec}
\directlua {
fonts.handlers.otf.addfeature {
name = "supkern",
type = "kern",
data = {
["A"] = { ["eight.superior"] = -180 },
},
}
}
\setmainfont{Linux Libertine O}
\usepackage{realscripts}
\begin{document}
A\textsuperscript{8}
\addfontfeature{RawFeature=+supkern}A\textsuperscript{8}
\end{document}
And here's the output:



\directlua { fonts.handlers.otf.addfeature { name = "supkern", type = "kern", data = { ["one.superior"] = { ["period"] = -200 }, }, } }for the period is itself superscript... – user41063 Feb 09 '19 at 13:16