[XeTeX] Auto Font and Language Package in XeTeX

Khaled Hosny khaledhosny at eglug.org
Mon Dec 20 17:16:05 CET 2010


On Mon, Dec 20, 2010 at 07:45:21AM -0800, Michiel Kamermans wrote:
> 
> >I long had that on my todo list, but I'm yet to figure out a proper user
> >interface for it; one needs to take care of different font styles,
> >optical sizes etc. e.g. English ARABIC {\it english ARABIC} should work
> >and get the Arabic text assigned the proper italic font and so on.
> >
> >The code at lua end is quit trivial, once the script->font mapping is
> >defined which is actually the tricky part.
> 
> Hmm... that sounds much more narrow than what you can do with
> XeTeX's intercharclass behaviour, and much more like just
> font-switching.

I'm not sure what XeTeX's intercharclass can do (I never understood it
to be honest, it just looked too limited to me).

> I would imagine that something like what XeTeX
> offers makes it much easier to say "if arabic character from non
> arabic, RTL and font switch (and whatever else is requested by the
> user)".

Actually Jonathan said before intercharclass can't be used to do
bidirectional switching, while in luatex you have direct access to node
list and I actually have an implementation of Unicode bidi algorithm
written entirely in lua[1] (I usually use it with ConTeXt, so the LaTeX
part is not very well tested at the moment).

> But perhaps LuaTeX wants to do these two things separately,
> which would of course be equally fine, just requiring a different
> approach in terms of packageness

Font switching and text directionality are two separate issues and even
and can't be done in one step; bidi is very tricky and not just
Arabic==RTL and English==LTR, even font switching can be a bit tricky
when you consider characters that don't belong to specific script (like
most punctuation marks).

[1] http://github.com/khaledhosny/luadirections

Regards,
 Khaled

-- 
 Khaled Hosny
 Arabic localiser and member of Arabeyes.org team
 Free font developer


More information about the XeTeX mailing list