I've a few questions about XeLaTeX and fontspec. Given:

EBGaramond12-SC.otf:Family:              EB Garamond 12 SC
EBGaramond12-SC.otf:Subfamily:           SC
EBGaramond12-SC.otf:Full name:           EB Garamond 12 Regular SmallCaps
EBGaramond12-SC.otf:PostScript name:     EBGaramond12-SC
EBGaramond12-SC.otf:Preferred family:    EB Garamond
EBGaramond12-SC.otf:Preferred subfamily: 12 SC Regular

obtained with the command line of otfinfo -i -q EBG*.*. My first question is which name to use with \fontspec? I know from experience that the Postscript name will work. But in many examples that I've read, I've seen names with embedded blanks. Since I can retrieve either this is mostly asked to clarify my knowledge. In sum, what works when specifying the name of a font?

My second question is related again to \fontspec (and by extension to XeLaTeX). Virtually all of my postscript fonts are missing the requisite table information. The various character glyphs are present, but no tables. So, does this mean that an attempt to use a font without the onum tag (Oldstyle Figures) means that I'll get the warning about missing feature in the log file? With the attendent lack of Oldstyle Figures? By the way I'm aware that this is not a problem with EBGaramond.

My last question is a preferred style question (idiomatic usage). Do people prefer the short tag specification or the long name specification in \fontspec? Use onum or 'Oldstyle Figures'?

  • @egreg---thanks for the edit, it looks much better! – hsmyers Jan 19 '13 at 23:04

If the font is installed as a system font, the best way to use it is to use the Preferred family:

\fontspec{EB Garamond}

In the case of EB Garamond fontspec will also detect the correct font for the current text size for you, according to the developer:

The fonts contain the designsize in their name and size infos in their tables so software that knows how to handle them (e.g. Xe- and LuaLaTeX) uses the appropriate font automatically.

The best alternative is to specify the files manually, for example:

  [ Extension   = .otf ,
    Path        = /path/to/eb/garamond ,
    UprightFont = *-Regular ,
    ItalicFont  = *-Italic ]

However, this requires manual selection between the 8pt and 12pt variants of EB Garamond. EB Garamond also has small-caps stored in the regular and italic fonts.

To answer your second question: You will only get the warning in the log file when you try to use that feature: If you use \oldstylenums on a font without the onum feature you will get a warning in your log and your numbers will remain as they normally are.

And finally: I think you should use the fontspec options. For example:

  [ Numbers = {Tabular,OldStyle} ,
    Ligatures = TeX ]
  {EB Garamond}

Instead of:

  {EB Garamond}
  • 1
    And probably it's also better to use \setmainfont rather than \fontspec. – egreg Jan 19 '13 at 22:48
  • @egreg Could you expand on \setmainfont over \fontspec? Is it idiomatic or are there additional reasons? – hsmyers Jan 19 '13 at 23:05
  • 2
    @hsmyers With \setmainfont you set the main font document; it's just more efficient than using \fontspec; there are also \setsansfont and \setmonofont for defining the three main families. The documentation tells that \fontspec is really less efficient than these commands and the companions \newfontfamily or \newfontface. – egreg Jan 19 '13 at 23:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.