Many OpenType fonts, both free and commercial, have superiors for only 1, 2, and 3 and do not define the sups
feature.
I want to use the superiors in files with no more than three footnotes. At first, I thought it would suffice to define the sups
feature, as in this example, with red superiors for comparison:
% compile with lualatex
\documentclass{article}
\usepackage{filecontents,fontspec,realscripts,xcolor}
\usepackage[paperwidth=180pt,paperheight=150pt,margin=10pt]{geometry}
\begin{filecontents*}{pagella.fea}
languagesystem DFLT dflt;
languagesystem latn dflt;
feature sups {
sub \one by \one.superior;
sub \one.prop by \one.superior;
sub \one.oldstyle by \one.superior;
sub \one.taboldstyle by \one.superior;
sub \two by \two.superior;
sub \two.prop by \two.superior;
sub \two.oldstyle by \two.superior;
sub \two.taboldstyle by \two.superior;
sub \three by \three.superior;
sub \three.prop by \three.superior;
sub \three.oldstyle by \three.superior;
sub \three.taboldstyle by \three.superior;
} sups;
\end{filecontents*}
\setmainfont{TeX Gyre Pagella}[FeatureFile={pagella.fea}]
\pagestyle{empty}
\newcommand{\red}[1]{\textcolor{red}{#1}}
\begin{document}
There\footnote{Note.} \red{¹} are\footnote{Note.} \red{²}
far\footnote{Note.} \red{³} too\footnote{Note.} many\footnote{Note.}
footnotes\footnote{Note.} in\footnote{Note.} this\footnote{Note.}
little\footnote{Note.} sentence.\footnote{Note.}
\end{document}
But the result looks like this:
Then I added the following line to the preamble:
\renewcommand\footnotemarkfont{\addfontfeature{RawFeature={+sups}}}
Now, footnotes are marked with real superiors, but the superiors are reduced in size and their height raised:
I’ve tried reading the code of realscripts
but can’t make heads or tails of it. Is there a way around the problem?