I'm trying to detect the presence of certain font Open Type font features with fontspec
but it fails as soon as a main language is specified with babel
.
I have two questions:
- Am I missing something?
- Is this actually a big deal? Can I safely apply
Kerning=Uppercase
even if a font doesn't support it without any weird side effects?
MWE
%! TeX Program = lualatex
\documentclass{article}
\usepackage{fontspec}
%\usepackage{babel} % works
\usepackage[american]{babel} % doesn't work
\babelfont{rm}{Baskervaldx}
\begin{document}
\ExplSyntaxOn
\fontspec_if_feature:nTF {cpsp}
{Feature ~ detected! \addfontfeature{Kerning = Uppercase}}
{Feature ~ NOT ~ detected.}
\ExplSyntaxOff
THIS SHOULD USE UPPERCASE KERNING
\end{document}
\babelfont{rm}[Language=Default]{Baskervaldx}