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

Mojca Miklavec mojca.miklavec.lists at gmail.com
Fri May 19 02:21:50 CEST 2006

On 5/18/06, Jonathan Kew wrote:
> 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.

Thank you very much! After playing a bit with it I actually realized
that I was asking the wrong question. EC-encoded fonts work out-of-the
box in ConTeXt as long as someone is typesetting
\ccaron\scaron\zcaron. The problem is that the unicode characters
never get converted to \somenamedglyphy, so ConTeXt doesn't know which
glyph to take from the font.

So a temporary remedy for that is something like
    \catcode`č=\active \defč{\ccaron}
    \catcode`š=\active \defš{\scaron}
    \catcode`ž=\active \defž{\zcaron}

However here's my next question (probably there will be another no as
an answer):

Is it possible to use any other 8-bit input encoding (such as cp1250)
or is only utf-8 currently supported? I tried to test it on some old
documents, but the behaviour is completely random and depending on the
surronding characters.

ConTeXt creates active characters for 128-255 when working with pdfTeX
and maps the characters to \namedglyphs which works OK there, but
XeTeX works completely different with input encoding. I approximately
understand why it doesn't work here, but is there a trick to make
XeTeX work with those 8-bit encodings as well?

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

I'm fully aware of that and of all the consequences of my weird
behaviour. But until there is some support for inclusion of fonts
directly from the TeX tree and as long as I don't have all the fonts
in the proper format and macro support for them, I need something to
start with to be able to compile my old documents with XeTeX.

I might have something misconfigured or too old version installed (I
didn't install .992 yet), so I'm just curious: what do you get if you
    \catcode`ð=\active \defð{^^f0}
My version seems to have some problems with ^^f0.

Thank you very much,

More information about the XeTeX mailing list