[XeTeX] \newfontface and small caps

Gareth Hughes garzohugo at gmail.com
Fri Jan 22 00:26:49 CET 2010


Martijn Storck wrote:
> Hi,

Hi!

> I?m relatively new to XeTeX and I?m a bit puzzled by the usage of fontspec
> and \newfontface. Take this example:
> 
> \documentclass[11pt,a4paper]{article}
> 
> \usepackage{fontspec}
> \usepackage{xunicode}
> \usepackage{xltxtra}
> 
> \begin{document}
> 
> {\fontspec{Adobe Caslon Pro}\scshape Adobe Caslon Pro}
> 
> \newfontface\myfont{Adobe Caslon Pro}
> 
> {\myfont\scshape Adobe Caslon Pro}
> 
> \end{document}
> 
> The first line has nice text with small caps from the font. 

That means that Adobe Caslon Pro has small caps and keeps them in an
obvious place where fontspec finds them

> However, the second
> line does not have small caps. 

The \newfontface command loads just one font rather than the whole
family, and, in this case, just the regular face. So, try using:

\newfontfamily\myfont{Adobe Caslon Pro}

This will create the \myfont command as a font-changing command.
However, if you want to use this as the main font in a document, you can
make it the default font by using:

\setmainfont{Adobe Caslon Pro}


> I cannot find anything that would explain this
> behavior. I also tried setting SmallCapsFeatures={Letters=SmallCaps} in the
> newfontface options, but that didn?t help either.

SmallCapsFeatures doesn't set the small caps but defines features for
the small caps, like making them all blue.

Gareth.


More information about the XeTeX mailing list