[XeTeX] a package for transition ryles based on unicode block (allowing amongst other things automatic font switching between languages)

Michiel Kamermans pomax at nihongoresources.com
Mon Oct 19 14:29:03 CEST 2009


Vafa,
>> I think with Arabic and other RTL script, just changing fonts does 
>> not make sense, it would be nice in addition to changing fonts, 
>> direction also be changed for RTL scripts.
> The package allows you to set up whatever start/end rules you want. 
> Fontswitching is just the most obvious use, but there's nothing 
> stopping you from issuing "RTL command + font that supports arabian" 
> as transition-to rule, and "LTR command" as transition-from rule.
>
> It's broader than the old fontwrap. That only dealt with changing 
> fonts, this package supports arbitrary (la)tex code as rules for 
> entering and exiting unicode blocks. 
To demonstrate, I've put the reworked ucharclasses online at 
http://pomax.nihongoresources.com/downloads/ucharclasses/

Have a look at ucharclasses.tex in the tarchive, which defines a simple 
set of in/out transition rules for the Arabic unicode blocks like this:

\usepackage{ucharclasses}
\usepackage{fontspec}
\usepackage{bidi}
...
\setTransitionsForArabic{\fontspec{Tahoma}\setRTL}{\setLTR}
...

This should be minimally sufficient to make Arabic text properly 
readable (of course, I don't know Arabic, so just like all the other 
examples it's just a gibberish string for demonstration purposes), but 
as you can see the transition definitions are up to you. If you want no 
rules, you don't define one, and if you do, you're free to put in any 
code that will compile.

- Mike "Pomax" Kamermans
nihongoresources.com


More information about the XeTeX mailing list