Open u-fischer opened 7 years ago
Hmm, that isn’t intentional. I agree you would expect to be able to make all definitions via FontFace. Will investigate...
It is certainly what I expect (and want) but the manual speaks only about additional shapes so I couldn't claim that my expectation is documentated ;-).
Strange, for me (still on TL2016 on this laptop), the following works okay for me:
\usepackage{fontspec}
\setmainfont{texgyretermes-regular.otf}%
[
FontFace={m}{it}{texgyreheros-italic.otf},
FontFace={blub}{it}{texgyreheros-italic.otf},
]
\begin{document}
Test
\fontseries{m}\fontshape{it}\selectfont Test %fails
\fontseries{blub}\fontshape{it}\selectfont Test %works
\end{document}
Something to do with the /I
? I rarely invoke fonts like this any more so I'm a bit out of practice…
The /I is not the problem. The problem seems to be the call by font name. It fails e.g. also if I use "Arial" or FontFace={m}{it}{TeX Gyre Heros}
. So probably something leaks out while fontspec accesses the font.
Loading by file names seems to work in most cases. But e.g. not with ariali.ttf
: lualatex can find and use the file but not in the FontFace={m}{it}
, while xelatex doesn't find it at all.
(Regarding the use of the /I
. I look this things up in the log-file. fontspec is so considerate to tell how it calls the fonts ;-)).
Another related issue that tripped me recently: even when using filenames FontFace = {m}{n}
(so default series, default shape) does not work. Other combinations like FontFace = {b}{n}
do work for me, which makes it a bit surprising.
\documentclass{article}
\usepackage{fontspec}
\setmainfont{lmroman10-italic.otf}[
% UprightFont = {lmroman10-regular.otf}, % does work
FontFace = {m}{n}{lmroman10-regular.otf} , % doesn't work
FontFace = {b}{n}{lmroman10-bold.otf} , % does work
]
\begin{document}
Normal font is printed in italics (lmroman10-italic), not regular (lmroman10-regular).
\textbf{Bold font is printed in bold (lmroman10-bold).}
\end{document}
With the
FontFace
option one can easily add more NFSS series/shapes, but it doesn't work for standard combinations:Would it be possible to either change
FontFace
or to add e.g. aFontFace*
key that allows to overwrite the fonts choosen by fontspec? For large and complicated font declarations it is much easier to useFontFace
(if one knows a bit about NFSS ;-)) than to nestItalicFeatures
,SmallCapsFont
and the like.(It would be quite okay if the overwriting could be done only in a second, separate command/step and involved a NFSSFamily-name).