I am using XeLaTeX(fontspec) and I have the following problem. I am using a lot of differents fonts in the preamble like
\setmainfont{GFSDidot}
\newfontfamily{\greekfont}{CMU Serif}
\newfontfamily{\greekfontsf}{CMU Sans Serif}
\newfontfamily{\hebrewfont}{Linux Libertine O}[Scale=MatchUppercase]
and I use stackengine
package to stack differents fonts. I would like to change locally the font size for one particular font without affecting the size of the other fonts that are used together in the stack process. I am afraid that the command \addfontfeatures[Scale=..]
will affect the size of any font in the stack! So my question is: Is it possible to change the font size of a particular font locally (without the need to define a new \newfontfamily
for this particular font and with the desired size)? Something like {\addfontfeatures{\hebrewfont}[Scale=..]
....} ?
You could use the following minimal example:
\documentclass[letterpaper, 12pt]{article}
\usepackage[no-math]{fontspec}
\usepackage{stackengine}
\usepackage{polyglossia}
\usepackage{newunicodechar}
\setmainfont{Arial}
\newfontfamily{\hebrewfont}{Linux Libertine O}
\newunicodechar{ǎ}{\accent\string"02C7 a}
\newunicodechar{א}{{\hebrewfont{א}}}
\newunicodechar{ע}{{\hebrewfont{ע}}}
\begin{document}
\stackengine{\Lstackgap}{ǎ}{א}{O}{c}{F}{\useanchorwidth}{L}\\
{\fontspec{\hebrewfont} \addfontfeature[Scale=0.8] \stackengine{\Lstackgap}{ǎ}{א}{O}{c}{F}{\useanchorwidth}{L}}
\end{document}
Also I have the same problem when I tried to define a "scaled" command something like \newcommand\hebr[1]{\fontspec{Linux Libertine O}\addfontfeature{Scale=#1}}
Then the output of {\hebr{0.3}ǎא }
is not the expected one!!
\fontspec{\hebrewfont}
, though, so it isn't surprising it doesn't work. At least, that is not how it usually is used. Do you see something in the manual which suggests this should work? The point of saying\newfontfamily\fontfamilyname
, as I understand it, is that you can then say\fontfamilyname
without calling\fontspec
explicitly. In the case of Polyglossia, defining\hebrewfont
enables automatic switching to the appropriate font when Hebrew is active. But your code doesn't enable support for Hebrew.