[HarfBuzz] Arabic presentation forms and the uniscribe backend

Behdad Esfahbod behdad at behdad.org
Tue Aug 20 09:44:55 PDT 2013


On 13-08-18 10:01 AM, Jonathan Kew wrote:
> I'm seeing some problems with the uniscribe backend when using Arabic
> presentation-form codepoints; in many cases, the glyph positioning seems to be
> badly off.
> 
> For example, see the Uniscribe rendering at
> 
> http://ec2-54-226-13-158.compute-1.amazonaws.com/testcase-view.html?file=out/fonts/win8/arabtype.ttf/texts/arab/wikipedia/ur.txt.diffs#L_1_41824
> 
> where there's a large gap between the last two glyphs. There are many similar
> examples in the list there, too.
> 
> This problem does NOT appear when using the same text and font in Firefox with
> uniscribe shaping, which makes me suspect it's a glitch of some kind in the
> harfbuzz-uniscribe backend.


I tracked it down to this:

  - If I switch back to using non-OpenType versions of
ScriptItemize/Shape/Place, things work correctly,

  - With the OpenType version of them, I'm getting back from ScriptItemize
script 'latn' for the presentation forms but 'arab' for the normal characters.
 So, that's one Uniscribe bug,

  - I pass down that script code to Shape/Place, and I believe results in the
generic shaper being chosen, which I guess ignores the fRTL flag of the
analysis and always returns results as if base direction was LTR, while we
expect RTL,

  - Things go south from there.

This may also explain some other issues I've been trying to understand, but I
have to verify.

Any idea how to address this best?  A hack would be to use the non-OpenType
versions if no user features are provided.

CC'ing Andrew.

-- 
behdad
http://behdad.org/



More information about the HarfBuzz mailing list