[XeTeX] Dollar signs in Adobe OTF fonts

Bruno Voisin bvoisin at mac.com
Fri Oct 26 10:13:58 CEST 2007


Le 26 oct. 07 à 03:52, Easter Sunshine a écrit :

> %&program=xelatex
> %&encoding=UTF-8 Unicode

BTW (given that Will solved the problem related with the absence of  
the xunicode package), the above two lines, specific to TeXShop on  
Mac OS X, refer to a deprecated syntax, no longer supported by  
default. Instead you should use:

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

> \usepackage{fontspec}
> \newcommand{\MAINFONT}{Minion Pro}
> \setromanfont{\MAINFONT}

For existing TeX documents to work (should you use at some point copy- 
and-paste from old documents), it's better to also load the tex-text  
remapping, so that ligatures such as -- and --- are remapped to the  
appropriate UTF-8 characters – and —.

For the same reason, in some cases the default loading of Latin  
Modern fonts by the fontspec package leads to problems. I haven't  
looked sufficiently into the issue to determine exactly what's going  
on, but in these cases a fix is to specify the [cm-default] of the  
fontspec package.

And two more things:

- Recently (I don't remember exactly at which version), \setromanfont  
has been changed to \setmainfont in fontspec.

- A useful addition to the default packages loaded by XeLaTeX is  
xltxtra, which performs some additional optimizations for XeLaTeX.

- Sometimes the MatchLowercase font feature (in fontspec's jargon) is  
helpful, by (if I understood correctly) rescaling a font so that its  
x-height matches that of Computer Modern.

All in all, the preamble for your document could become:

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

\documentclass{article}

\usepackage[cm-default]{fontspec}
\usepackage{xunicode,xltxtra}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\newcommand{\MAINFONT}{Minion Pro}
\setmainfont{\MAINFONT}

Hope this helps,

Bruno Voisin


More information about the XeTeX mailing list