2

In an answer to querying whether a font feature has been activated via a fontspec command there are definitions of \IfFontFeatureExists and \IfFontFeatureActive. I'm not getting reliable results for the second of these. For example, the following says that pnum is active and tnum is inactive, which are clearly not the case.

\documentclass{article}
\usepackage[osf,tabular]{libertineRoman}

\ExplSyntaxOn
\cs_new_eq:NN \IfFontFeatureExists \fontspec_if_feature:nTF
\cs_new:Npn \mico_fontfeature_if_active:nTF #1
  { \tl_if_in:NnTF \l_fontspec_rawfeatures_sclist { #1 } }
\cs_new_eq:NN \IfFontFeatureActive \mico_fontfeature_if_active:nTF
\ExplSyntaxOff

\begin{document}

pnum \IfFontFeatureExists{pnum}{exists}{does not exist},
onum \IfFontFeatureExists{onum}{exists}{does not exist},
lnum \IfFontFeatureExists{lnum}{exists}{does not exist},
tnum \IfFontFeatureExists{tnum}{exists}{does not exist},

pnum is \IfFontFeatureActive{pnum}{}{not} active,
onum is \IfFontFeatureActive{onum}{}{not} active,
lnum is \IfFontFeatureActive{lnum}{}{not} active,
tnum is \IfFontFeatureActive{tnum}{}{not} active,

1234567890

\end{document}
  • It seems that, for some reasons, tnum is never added to \l_fontspec_rawfeatures_sclist with XeLaTeX. It is if LuaLaTeX is used. I'd classify this as a bug in fontspec. – egreg Nov 17 '13 at 21:25
  • tnum is added when it should be pnum and vice versa. That's for Libertine. For BerenisADF, the active features are always tnum and lnum, no matter what. I'd say this "feature" is seriously broken. – user22108 Nov 18 '13 at 3:56
  • If it's a bug in fontspec, where/how do I report it? – user22108 Nov 24 '13 at 18:40
  • This is the site for fontspec: github.com/wspr/fontspec – egreg Nov 24 '13 at 19:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.