[HarfBuzz] Rendering Thai

Theppitak Karoonboonyanan thep at linux.thai.net
Wed Jan 18 20:37:35 PST 2012


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.

>> 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".

>> 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.

> 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?

> 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.

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.

Regards,
-- 
Theppitak Karoonboonyanan
http://linux.thai.net/~thep/



More information about the HarfBuzz mailing list