[XeTeX] Bug in fontspec's \newfontfamily?

Arthur Reutenauer arthur.reutenauer at normalesup.org
Sat May 23 17:27:47 CEST 2009


> Is there any reason why the following code works as it does?  The fontspec 
> docs do not say that a shorthand name is required with the \newfontfamily 
> and \newfontface commands (and I would not expect such a requirement)

  Yes, it does, in section 3.2 of the manual (v1.18): \newfontfamily, as
opposed to \fontspec, creates instances of a font that can be reused
throughout the document.  The first argument to \newfontfamily is the
macro name, that can then be invoked to trigger the font change.
Usually, you would define all these macros in a single place, and use
them where appropriate in your document.

  What you seem to be wanting in your example file is the \fontspec
command, which saves you the trouble of defining a macro if you only
want to use some font once; but it's inefficient if you're going to use
that font several times (XeTeX needs to query the system libraries to
look it up, etc.), which is why \newfontfamily is recommended.

	Arthur


More information about the XeTeX mailing list