I have encountered something while using fontspec
that I do not quite understand. What is the scope of a font feature added using the \addfontfeatures
command? For instance, consider the example below using lualatex
:
\documentclass{article}
\usepackage{fontspec,lipsum}
\setmainfont{TeX Gyre Termes}
\begin{document}
1234567890
{%
\addfontfeatures{Numbers=OldStyle}%
1234567890%
}
1234567890
Here is some text that is long enough so that it will involve a single proper hyphenation at the end of the first line.
{%
\addfontfeatures{HyphenChar=None}%
Here is some text that is long enough so that it will involve a single proper hyphenation at the end of the first line.%
}
Here is some text that is long enough so that it will involve a single proper hyphenation at the end of the first line.
\end{document}
The option Numbers=OldStyle
is only applied locally and does not exit the braces, but the option HyphenChar=None
continues after the braces end. Is there a way to limit the scope of HyphenChar
as Numbers
is limited above?