[XeTeX] Ligatures and things

Jonathan Kew jonathan_kew at sil.org
Tue May 29 12:06:30 CEST 2007


On 29 May 2007, at 10:21 am, John Was wrote:

> Hello all
>
> I'm still experiencing some trouble with XeTeX (run in plain TeX  
> rather than LaTeX) and fonts on my Windows system.  When accessing  
> fonts that show up normally in Windows applications such as Word I  
> find some of them work while others crash XeTeX, without any  
> obvious common factor.  Not much of a worry since the ones that do  
> the crashing are not generally fonts that I want to use anyway.  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.  Again this doesn't much bother me (except that I'd like to  
> know why it happens!),

I'd also like to know why this happens - it shouldn't!

> 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).
>

This is correct; the use of hyphen-ligatures to produce en- and em- 
dashes is a peculiarity of traditional TeX fonts, and you can't  
expect to find this behavior in mainstream OpenType fonts. The  
expectation everywhere except TeX is that if you want an em-dash, you  
use an em-dash character in the text (not three 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!
>

So you are.

However, there is a solution through XeTeX's "font-mapping"  
mechanism. If you load fonts with the "tex-text" mapping file  
(included in the TL installation), this will apply the "standard" TeX- 
style mappings to the characters, replacing "---" with "—", etc.

In plain TeX terms:
   \font\tenrm = "Times New Roman:mapping=tex-text" at 10pt

or in LaTeX terms:
   \usepackage{fontspec}
   \setmainfont[Mapping=tex-text]{Times New Roman}

etc.

>
> 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.)

There should be a (somewhat oldish) archive of sample files available  
on the XeTeX web site (http://scripts.sil.org/xetex); look on the  
Downloads page. Many of these will use Mac OS X fonts, so you'll need  
to change font names in order to run them on other platforms, but  
they may still be instructive.

JK

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/xetex/attachments/20070529/189ad8d0/attachment.html 


More information about the XeTeX mailing list