[HarfBuzz] Rendering Thai

Behdad Esfahbod behdad at behdad.org
Wed Jan 18 20:46:03 PST 2012


On 01/18/2012 11:37 PM, Theppitak Karoonboonyanan wrote:
> On Thu, Jan 19, 2012 at 11:09 AM, Behdad Esfahbod <behdad at behdad.org> wrote:
>> On 11/11/2011 04:41 AM, Theppitak Karoonboonyanan wrote:
>>> No. I mean, the default routine in harfbuzz should be fixed for this case.
>>
>> So, can you please explain to me what the Thai-specific rendering requirements
>> are?
> 
> In John's examples, Sara Am is decomposed, but then rendered
> in wrong order with tone mark. The correct order is that tone mark
> is put above Nikhahit (the O-ring). But without decomposition GSUB
> in the font, Harfbuzz appears to put Nikhahit above the tone mark
> instead, which is wrong.

Right.  But what is a shaping engines supposed to do beyond the generic
OpenType shaping to achieve that?  The MS spec doesn't suggest anything extra.


>>> The Qt patch will optionally dlopen() libthai if it's present, to improve
>>> the rendering quality. But without libthai installed, harfbuzz should
>>> still normalize the combining characters properly. No IPA is required
>>> for this case.
>>
>> What's IPA?   I can only think of International Phonetic Alphabet, but can't
>> see how that would make sense in this paragraph.
> 
> Sorry, my brain got some short-circuit. I meant to say "PUA".

I see.


>>> After that, the question would be whether harfbuzz would support
>>> IPA shaping. If the answer is yes, we can then decide whether to
>>> copy libthai code over, or to link against it, or to dlopen() it.
>>
>> So what is IPA shaping?
> 
> PUA shaping.

Ok, what's that?  From what I understand different vendors approached solving
the problem differently, using PUA space?  How exactly?

>> HarfBuzz kinda normalizes text now.  Is it doing anything better?
> 
> I wonder what's the simple way to test harfbuzz-ng, so I can see
> it myself. Is it currently used in Pango?

The hb-view tool included in the HarfBuzz repo under util/.


>> If I understand correctly, this is related to the issue recently brought up by
>> Sairus (Adobe) on the OpenType list:
>>
>> "It's recently come to my attention that the MS Thai layout spec
>> http://www.microsoft.com/typography/otfntdev/thaiot/features.aspx  doesn't
>> require layout engines to do the sara am decomposition and reordering. I'm
>> told that some engines do the sara am decomposition and reordering e.g.
>> Uniscribe and Adobe's CTS, and others don't e.g. Harfbuzz."
>>
>> Are we talking about the same thing?  If yes, I can look into this.
> 
> I'm not sure. From John's examples, it looks like Harfbuzz has already
> decomposed it. Otherwise, it's impossible to produce that wrong order.

Right, we decompose.  But what's the reordering?  I believe that's where the
problem is.


> To test it, you can try the sample text "ป่ำ". When decomposed and
> shaped with PUA, both Nikhahit and the tone mark should be shifted
> left to avoid overlapping with the long stem of the base character.

Can you suggest a free font I can test with?  Can you send me right/wrong
screenshots also?  My Thai script comprehension is less than perfect, you know :).

> Regards,

Thanks,
behdad



More information about the HarfBuzz mailing list