[luatex] Simple bidi

Javier Bezos listas at tex-tipografia.com
Tue Aug 22 17:29:11 CEST 2017


I myself wrote:

> I managed to do it, with a second smaller loop for a special
> case. Attached is the resulting code, which works in typical cases. I
> tried to emulate the unicode behavior, but I'm not sure it's fully
> compliant (I'd say it's not, but who knows :-)).  I have to add a few
> things (eg, NSM, but little more, I hope).

I hoped :-)--- Well, here is a new version, more complete. But the
code is ugly, very ugly. At least, I think I've managed to understand
the 'what' and the 'why', as opposed to the 'how'. I cannot resist
copying the following text from Emacs bidi.c (which also attempts to
implement the bidi algorithm with a single loop):

   "Arrrgh!! The UAX#9 algorithm is too deeply entrenched in the
   assumption of batch-style processing [...]. May the fleas of a
   thousand camels infest the armpits of those who design supposedly
   general-purpose algorithms by looking at their own implementations,
   and fail to consider other possible implementations!"

Javier


-------------- next part --------------
A non-text attachment was scrubbed...
Name: babel-bidi.zip
Type: application/x-zip-compressed
Size: 67341 bytes
Desc: not available
URL: <http://tug.org/pipermail/luatex/attachments/20170822/ef5d1089/attachment-0001.bin>


More information about the luatex mailing list