[XeTeX] Auto Font and Language Package in XeTeX

Paul Isambert zappathustra at free.fr
Mon Dec 20 12:59:45 CET 2010


Selon Arthur Reutenauer <arthur.reutenauer at normalesup.org>:

> > Incidentally, does anyone know whether there is a LuaTeX version of the
> > XeTeXintercharclass behaviour that would let this package be rewritten
> > for LuaTeX with minimal effort?
>
>   Paul Isambert has written code to that effect, but I'm not sure he has
> made it into a package yet.


I haven't indeed. It's quite low on my priority list, all the more as mimicking
interchartoks isn't totally possible in LuaTeX, although the most significant
part of the mechanism can be reproduced.

Anyway judging from what I understand Michiel's package does, an
interchartoks-like code in LuaTeX won't work, because it'll really be an
``inter-node'' mechanism, and (glyph) nodes already have their fonts attached to
them, whereas the package is supposed to change fonts.

The solution would rather be: get the nodes as soon as possible, e.g. in the
ligaturing callback, and set the font number for each node according to its
unicode value. That means no such thing as "\fontspec{A font}" is usable here;
instead, you must go low-level and grab the fonts by their numbers. Such numbers
can be retrieved from the control sequences passed to the \font primitive with
Lua's font.id(<name>). An extension to fontspec would be infinitely simpler than
an independent package.

Best,
Paul


More information about the XeTeX mailing list