I wish to import from files a font family, which comes in extra light, light, regular, medium, bold and black. Instead of defining several different font names and choosing them as I need, it would be great if I could somehow define a single family and then attribute when I used different weights. Is this possible? I am using xelatex with fontspec. Is there an alternative to fontspec that offers an easy solution?
[Tex/LaTex] Defining subfamilies for a font
fontspecxetex
Best Answer
The manual of
fontspec
mentions the keyFontFace
. So let's assume your font areThen you should be able to provide the font definition as
A real world example:
Now you can also define font switching commands by yourself: