3

Why in the following example, lipsum text does not appear in blue color as described in the fontspec manual?

\documentclass{article}
\usepackage{lipsum}
\usepackage{fontspec}
\newfontfamily\myfont{Times New Roman}
\defaultfontfeatures[\myfont]{Color=blue}
\begin{document}
\myfont
\lipsum[1]
\end{document}
1
  • The fontspec user guide states that \defaultfontfeatures is used to "define font features that are applied to every subsequent font selection command" (emphasis added). Conversely, the macro does not operate on fonts that were set up earlier.
    – Mico
    Commented Sep 21, 2014 at 8:24

1 Answer 1

5

This is somehow strange but it seems that \defaultfontfeatures needs to be before \newfontfamily:

\documentclass{article}
\usepackage{lipsum}
\usepackage{fontspec}
\defaultfontfeatures[\myfont]{Scale=2}
\newfontfamily\myfont{Times New Roman}
\begin{document}
\myfont
\lipsum[1]
\end{document}
1
  • 3
    I don't see that it's strange: once a family is declared it's fixed, just like any other definition.
    – Joseph Wright
    Commented Sep 21, 2014 at 7:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .