-
Notifications
You must be signed in to change notification settings - Fork 682
Description
Hi, I am testing rendering of Khmer words which need ZWNJ.
One example is U+179a 1784 17d2 179f 200c 17ca 17b8.
Testing with KhmerOS Regular and Uniscribe, the word without ZWNJ (U+179a 1784 17d2 179f 17ca 17b8) is shaped as:
[uni179a=0+775|uni1784=1+1550|uni179f.sub=1+775|uni17bb=1@-125,-700+0|uni17b8=1+0]
and with ZWNJ, uni17ca is not substituted with uni17bb:
[uni179a=0+775|uni1784=1+1550|uni179f.sub=1+775|space=1+0|uni17ca=1+0|uni17b8=1@0,300+0]
Now with harfbuzz indic shaper, the word without ZWNJ:
[uni179a=0+775|uni1784=1+1550|uni179f.sub=1+775|uni17bb=1@-125,-700+0|uni17b8=1+0]
with ZWNJ, uni17ca is still substituted with uni17bb:
[uni179a=0+775|uni1784=1+1550|uni179f.sub=1+775|space=1+0|uni17bb=1@-125,-700+0|uni17b8=1+0]
From Microsoft's document, substitution of RegShift should be implemented with 'blwf' feature in fonts.
It seems true for KhmerOS and Microsoft's Khmer UI: if I mask the BLWF flag for the consonant shifter after ZWNJ, the word is shaped correctly.
But with Mondulkiri it is not true, BLWF has no affect. The word without ZWNJ is shaped as:
[uni179A=0+715|uni1784=1+1465|uni17D2179F=1+675|uni17BB.low=1@0,100+0|uni17B8=1+0]
and with ZWNJ:
[uni179A=0+715|uni1784=1+1465|uni17D2179F=1+675|space=1+0|uni17BB.low=1@0,100+0|uni17B8=1+0]
For reference the word with ZWNJ is shaped by Uniscribe as:
[uni179A=0+715|uni1784=1+1465|uni17D2179F=1+675|space=1+0|uni17CA.lower=1+0|uni17B8.ms.high=1+0]
I guess for Mondulkiri, if substitution (abvs in this case) lookups do not ignore ZWNJ (as ZWJ), it might yield better result.
Then after some experiment, viola! Mondulkiri looks good with harfbuzz as with Uniscribe!
Since I am a font newbie, these analysis and fix might make no sence ;)
I have the code in my branch, and got some result from the tests.