[XeTeX] A question regarding 7bits versus 8 bits encoding and fonts

Jonathan Kew jonathan_kew at sil.org
Mon Feb 20 09:47:17 CET 2006


On 20 Feb 2006, at 7:20 am, Bruno Voisin wrote:

> Le 19 févr. 06 à 19:39, Jonathan Kew a écrit :
>
>> The old Textures version of tex8bits won't work as-is, because the  
>> character codes are different, but the principle is similar, and  
>> perhaps that's what Bruno's 8bitdefs is doing.
>
> Actually it's not mine: 8 bitdefs.tex is a file from the OzTeX  
> distro <http://www.trevorrow.com/oztex/>, at "/Applications/OzTeX  
> 5.2/TeX/Inputs/Plain/8bitdefs.tex", and I was simply forwarding it.

Aha, thanks for the clarification.

> It contains definitions like:
>
> 	\catcode135=13 \def á{\'a}

OK; so this is highly specific to the MacRoman encoding, as it  
includes the hard-coded character code 135 for a-acute (and doubtless  
a hundred or so other similar definitions). So if the file is  
converted into any other encoding, the \catcode commands and the  
characters used with \def will no longer match, and it'll fail.

(It would have been better named "macromandefs.tex" rather than  
"8bitdefs.tex", but I guess most people rarely stopped to think about  
the possibility of other encodings back in those days.)

> Similarly the other file option_keys was from the Textures distro,  
> and contains definitions like:
>
> 	\catcode`\á=\active\defá{\'a}        % option e, then  a

This is a little more robust, as it uses the actual character to  
express both the \catcode and the \def. So if this file is entirely  
converted into UTF-8, say, it'll still do the expected thing when  
loaded by XeTeX -- the \catcode will make the appropriate Unicode  
character active, and the \def will define it so as to work with CM  
fonts.

(But it'll get in the way of straightforward use of Unicode  
characters and Unicode fonts!)

JK




More information about the XeTeX mailing list