[XeTeX] Page Number Font Issue

Peter Dyballa Peter_Dyballa at Web.DE
Thu Jan 6 21:12:44 CET 2011


Am 06.01.2011 um 19:57 schrieb William Voelker:

> could it be that I'm making a mistake by using \setromanfont in the  
> \memo command, and should instead use another command?


Yes. The \set*font commands can only be used once.

> \setromanfont[Ligatures=Common]{Bergamo Std}
> \renewcommand\textit{\setromanfont[Ligatures=Common]{Bergamo Std  
> Italic}}

The second line is not necessary, fontspec has some heuristics built- 
in to request the italic variant of an upright font. If it fails, you  
might use:

	\setsansfont[UprightFont={HelveticaNeue-Light},  
BoldFont={HelveticaNeue-Bold}, BoldItalic={HelveticaNeue-BoldItalic},  
ItalicFont={HelveticaNeue-LightItalic}]{Helvetica Neue}
	\newfontfamily\cjkfont[ItalicFont=HiraKakuPro- 
W3,ItalicFeatures={RawFeature=+ital},BoldItalicFont=HiraKakuPro- 
W6,BoldItalicFeatures={RawFeature=+ital},BoldFont={HiraMinPro-W6}] 
{HiraMinPro-W3}

Here you can see that \newfontfamily is the command to create a new  
family of fonts, so the following two lines from your document are  
wrong, in two ways:

> \newcommand\bbold{\setromanfont[Ligatures=Common]{Bergamo Std Bold}}
> \newcommand\memo{\setromanfont[Scale=MatchLowercase]{Arial Unicode  
> MS}}

The second way is that *every time* you use \bbold{} or \memo{},  
assuming you were using the correct \newfontfamily instead of  
\setromanfont, you would create the same family of fonts one more  
time. It's better to declare the font first and then use some command  
that uses the font declaration:

   \setromanfont{Lucida Bright}
   \setsansfont{Lucida Sans}
   \setmonofont{Lucida Sans Typewriter}
   \newfontface\slanted[RawFeature={slant=0.194}]{Lucida Bright}
   \DeclareRobustCommand{\textsl}[1]{{\slanted #1}}	% all \textsl{} ->  
Lucida Bright

--
Greetings

   Pete

Either this man is dead or my watch has stopped.
				- Groucho Marx



More information about the XeTeX mailing list