[XeTeX] Script specific digits

Jonathan Kew jonathan_kew at sil.org
Sun Apr 17 17:40:48 CEST 2005


On 17 Apr 2005, at 8:24 am, Will Robertson wrote:

> On 17 Apr 2005, at 2:53 PM, Musa Furber wrote:
>
>> Does anyone know an appropriate way to map one range of digits to 
>> another, e.g., have 0x0030 through 0x0039 map to 0x0660 through 
>> 0x0669, or the reverse?
>
> Some time back Hans Hagen proposed using a font mapping to solve this 
> problem (thread "[XeTeX] Numerals in Right-to-Left"), which I find 
> very elegant. I don't think any files were posted to the list as a 
> result, however.

Actually, it was Christopher Creutzig who suggested what is probably 
the best option:
>  Perhaps \font\arabfont="Geeza Pro:mapping=arabicnumers" and 
> \font\persianfont="Geeza Pro:mapping=persiannumbers"?

The "mapping" would be a simple file along the lines of this example, 
Latin2ArabicNums.map:
- - - - -
LHSName	"Unicode-LatinNums"
RHSName	"Unicode-ArabicNums"

pass(Unicode)

U+0030	<>	U+0660
U+0031	<>	U+0661
U+0032	<>	U+0662
U+0033	<>	U+0663
U+0034	<>	U+0664
U+0035	<>	U+0665
U+0036	<>	U+0666
U+0037	<>	U+0667
U+0038	<>	U+0668
U+0039	<>	U+0669
- - - - -
(Adapt as necessary depending which numerals you want to support.) This 
is then compiled with the teckit_compile tool to create a binary 
mapping file (.tec), which can be associated with a font in XeTeX just 
like the tex-text one.

JK



More information about the XeTeX mailing list