[XeTeX] a package for transition ryles based on unicode block (allowing amongst other things automatic font switching between languages)
Jonathan Kew
jfkthame at googlemail.com
Mon Oct 19 11:51:56 CEST 2009
On 19 Oct 2009, at 10:28, Michiel Kamermans wrote:
> Will Robertson wrote:
>> Looks quite handy, well done. Glad to hear that those code tables
>> are being generated automatically :)
> Technically they're not =/
>
> Every class's tex file was auto-generated, but is a series of
> [\XeTeXinterchar \'... \RelevantBlockClass] commands. I couldn't
> quite figure out how to easily go from integers to hexacdecimal, so
> that I could generate them in xetex by using \char"XXXX, plus of
> course this approach wouldn't allow autogeneration of any glyphs
> from the unicode blocks above FFFF, which actually covers a decent
> number of blocks.
I haven't examined your actual code, but if I'm understanding this,
there's no problem. You can specify character numbers in decimal just
as readily as hex. You can replace
\XeTeXintercharclass `\ = \AncientGreekNumbersClass
with either
\XeTeXintercharclass "10140 = \AncientGreekNumbersClass
or
\XeTeXintercharclass 65856 = \AncientGreekNumbersClass
and the effect is exactly the same; these are just alternate ways of
specifying numbers to TeX.
And you can use a loop to set ranges, using a TeX \count register.
Something like
\def\AssignClassRange#1#2#3{% #1 = start of range, #2 = end of
range, #3 = class
\count@=#1
\loop
\XeTeXintercharclass\count@=#3
\ifnum\count@<#2
\advance\count@ by 1
\repeat}
\AssignClassRange{"10140}{"1018A}{\AncientGreekNumbersClass}
(untested Mail.app code, but the idea should be ok). I'm sure LaTeX
has prettier loop constructs....
JK
More information about the XeTeX
mailing list