[XeTeX] Ligatures and things

Bruno Voisin bvoisin at mac.com
Tue May 29 12:12:40 CEST 2007


Le 29 mai 07 à 11:21, John Was a écrit :

> In trying out the outline font Minion Pro (the version that comes  
> with Adobe Acrobat Reader, located in its Resource directory),  
> which I _would_ probably want to use, I find - as per an early  
> message of mine - that XeTeX crashes if I use the font name but not  
> if I go directly to the .otf font file using square brackets round  
> the file name.

That's not surprising, given the fonts are located in a place (the  
Resource directory of Adobe Reader) that is probably not  
automatically indexed by fontconfig. You need to ask manually to  
fontconfig

> Again this doesn't much bother me (except that I'd like to know why  
> it happens!), but I've now found that although the five standard  
> ligatures are achieved automatically (ff, fi etc.), the en and em  
> dashes are not picked up either by the usual -- and --- or by  
> explicitly using an ASCII en or em dash in the input file (-- and  
> --- just give double and triple hyphens in the PDF, the true en and  
> em dashes both give single hyphens).
>
> Is there any way to make XeTeX see the dashes automatically?  I've  
> just discovered that they don't work in Times New Roman either,  
> which is usually a pretty reliable font to test things on.  I have  
> a nasty feeling that I'm going to have trouble with quotation marks  
> too!

No trouble at all: just add ":mapping=tex-text" (without the quotes)  
to the font name when calling the font. For example:

\font\tnrstd="Times New Roman"
\font\tnrxtx="Times New Roman:mapping=tex-text"
In Computer Modern: -- and ---, not to say \'e and \`a\par
\tnrstd In Times New Roman without remapping: -- and ---, not to say  
\'e and \`a\par
\tnrxtx In Times New Roman with remapping: -- and ---, not to say \'e  
and \`a
\bye

However, as you can see with the above example, that solves the  
problem with special TeX ligatures (such as -- and ---), but not with  
traditional TeX input such as \'e and \`a for accented letters. For  
them, I see no obvious solution in plain TeX, other than making sure  
your text editor is working in UTF-8 encoding and inputting directly  
the accented letters as é and à, respectively.

In LaTeX you have the xunicode.sty package which takes care of such  
things. The above example would become:

\documentclass{article}
\usepackage[cm-default]{fontspec}
\usepackage{xunicode}
\begin{document}
In Computer Modern: -- and ---, not to say \'e and \`a\par
\fontspec{Times New Roman} In Times New Roman without remapping: --  
and ---, not to say \'e and \`a\par
\fontspec[Mapping=tex-text]{Times New Roman} In Times New Roman with  
remapping: -- and ---, not to say \'e and \`a
\end{document}

> Relatedly, is there some extended version of testfont.tex that  
> would generate a PDF of all the characters in a given font?  (The  
> helpful PDF guide to XeTeX by Jonathan Kew in the TeXLive  
> distribution mentions a number of sample .TEX files that might  be  
> of help here, but I can't find any of them, either in TeXLive or  
> indeed anywhere at all on the Internet: they have perhaps been  
> withdrawn in the current version.)

No idea here. The Documentation and Sample Files archive  
XeTeX_doc.zip a the XeTeX Downloads page <http://scripts.sil.org/ 
xetex_download> contains interesting and useful files (such as AAT- 
info.tex and OpenType-info.tex listing all the available "variants"  
for a given font), but none for what you're asking.

Bruno Voisin



More information about the XeTeX mailing list