[XeTeX] default char classes

François Charette firmicus at ankabut.net
Sun Mar 9 10:44:39 CET 2008


Sven Siegmund a écrit :
> Hi Barry,
>
> have you considered the option of the fontspec package to define
> shortcuts for selecting fonts? You take Adobe Garamond Pro as the main
> font:
>
>    \setmainfont{Adobe Garamond Pro}
>
> and if you want Adobe hebrew for short runs of Hebrew text, you can
> define a font selection command, e.g.  \heb:
>
>    \newfontfamily{\heb}[Script=Hebrew]{Adobe Hebrew}
>
>
> It's just that you have to select the font manually every time the
> Script changes. I can imagine, if you do this 5 time on a page, you
> eventually want XeTeX or fontspec to be more intelligent and recognize
> the script used just by the code values of Characters used. Yes, that
> would be great. I jsut can't judge how much effort it would take to
> enable that.
>
> S.
>
>   

Polyglossia makes this more automatic: Suppose your main text is in 
English and you have passages or insertions in, say, Russian and Hebrew. 
Assuming you have defined \newfontfamily\hebrewfont[Script=Hebrew]{Some 
Hebrew Font}, and that your main font also contains the glyphs for 
cyrillic, then by switching the language to Russian, polyglossia will 
automatically turn on the font features for the cyrillic script and the 
russian language (if available in the font). And for Hebrew, it will 
automatically select the \hebrewfont you have defined.

FC




More information about the XeTeX mailing list