[XeTeX] How to use EC font encoding in XeTeX?

Jonathan Kew jonathan_kew at sil.org
Thu May 18 15:34:45 CEST 2006

On 18 May 2006, at 1:52 pm, Mojca Miklavec wrote:

> Hello,
> XeTeX supports the "old" was of selecting Type1 fonts, but how can I
> trick it to use "čšž" (ccaron, scaron, zcaron) when typesetting in
> that font?

In the EC encoding, these are at character codes "A3, "B2, and "BA.  
So it should be possible (as a minimal test) to say, for example:

	\font\lmec = ec-lmr10
	\lmec Testing... ^^a3 ^^b2 ^^ba

just as you could in standard TeX.

If you want to use the literal (Unicode) characters čšž in your  
text, but print them with an EC-encoded font, then you'll need to map  
them to the EC code positions (just as you'd have to do in any  
standard TeX system). One approach is to use active characters:

	\catcode`č=\active \defč{^^a3}
	\catcode`š=\active \defš{^^b2}
	\catcode`ž=\active \defž{^^ba}

	\lmec Testing... čšž

I'm sure ConTeXt has much more sophisticated ways of handling all  
this (as does LaTeX); these are just low-level TeX examples to check  
that the characters are accessible, but I don't know how they  
integrate with higher-level packages. But of course all this tends to  
defeat the purpose of XeTeX, and takes you back into the complex  
world of mixed encodings, font-specific macro definitions, etc.


More information about the XeTeX mailing list