[luatex] reverse node lists

Patrick Gundlach patrick at gundla.ch
Tue Nov 1 12:19:44 CET 2011


Hi Arno,

> 
> I'm happy with anything that works and that I understand. However, that's a lot of code for such a (seemingly) simple task … I'll try to understand your code and do an implementation on my own to learn it. (Also, I want to separate the line reversing and glyph-per-line-reversing)

It's not that easy. You have to decide what to do with the glue between two lines. My solution is incorrect, as it does not take the new (different) line heights into account (that occur from shuffling the lines). Probably easiest is to re-vpack the whole list. And the reversed line is also a bit problematic as it does not handle ligatures. So a proper solution would be more complex. But is there a proper solution to such a "stupid" task?

And I don't think that the code is too long/too much. It is wrapped into 2 functions and each of the function should be straight forward to read. (It usually takes some time for me to get the pointer manipulation right - a small sketch helps me).

Patrick




More information about the luatex mailing list