Ulrike, Hans,
I can add some safeguards (in context when in bidi mode we always have
dirs).
I'll send Ulrike something to test.
With the patched function (added to a fontloader from 2017-12-12)
the output of both examples looks ok (that means that the paragraphs
are identical, I have no idea if they are correct ;-))
Thanks to you both. (The workaround of forcing an explicit dir
node at the beginning of the paragraph seems to work, too, with
FreeSerif, Amiri, which also had misplaced kerns, etc.)
This means I can typeset Arabic documents without having to
patch almost every macro where directionality is relevant (quite
a lot), and without having to mark explicitly chunks of L text.
Nice.
Javier