[XeTeX] Unicode/font mixing

Musa Furber musaf at runbox.com
Mon Jan 24 17:46:03 CET 2005


On 24 Jan 2005, at 17:20, Jonathan Kew wrote:

> On 24 Jan 2005, at 1:51 pm, Simon Spiegel wrote:
>
>> Hi,
>>
>> I already posted a similar question on the regular OSX LaTeX mailing 
>> list, but I thought maybe a post here would be useful as well. To 
>> make it short: Is it possible to have a font only for a certain part 
>> of the Unicode encoding? Can I, for example, use Adobe Garamond Pro 
>> for the Latin encodings, and Times Roman for Cyrillic and Hebrew? I 
>> know that i can switch the fonts by hand, but can I setup XeLaTeX in 
>> a way that it automatically switches to another font with more glyphs 
>> if the first font isn't able to display everything?
>>
>
> No, there's no way to make this "magically" happen.
>
> If you insist on doing it, and don't mind (a) some tricky (and 
> probably fragile) TeX macro programming, and (b) a performance hit, 
> then you could write macros that switch fonts depending on the 
> characters encountered, by making all text characters that aren't 
> supported by the current font into "active character" macros that 
> switch to an appropriate new font before typesetting themselves (and 
> at the same time activate a new set of definitions, so that the font 
> will change back again when needed).
>
> I really wouldn't recommend it, though.

Jonathan gave me the same advice when I was writing a small Python 
script to do the same thing with Latin and Arabic languages. I 
abandoned it when I saw that it was much better to use hand-written 
LaTeX code when possible. It's just easier to define a short macro and 
call it whenever I need to switch.

Regards,
Musa



More information about the XeTeX mailing list