The problem is that Webkit (and our FX port - webnode) has BIDI string machinery and CSS support for letters/words spacing in shared code. The final Webkit callback for rendering is coming in format of glyph array and array of advances:
WCGraphicsPrismContext.drawString(WCFont f, int[] glyphs,
float[] advanceDXY, // ar(advanceDXY) = 2 * ar(glyphs): dx and dy for each glyph.
float x, float y);
To reach up the correct implementation we need an extension in Graphics interface for glyph-base text drawing with signature:
Graphics.drawGlyphs( FontStrike fs,
int[] glyphCodes, // glyph codes (can be ligature)
float[] advancesX, // dx offsets for next glyph
float[] advancesY,// dy offsets for next glyph in baseline
float x, float y);
ar(glyphCodes) = ar(advancesX) = ar(advancesY)