Bug 31003

Summary: Myanmar shaper in the old Harfbuzz does not work with Myanmar Unicode 5.1 compliant fonts
Product: HarfBuzz Reporter: Keith Stribley <devel>
Component: srcAssignee: Behdad Esfahbod <freedesktop>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: medium CC: freedesktop
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: bad rendering with Myanmar3 due to old Myanmar shaper
bad rendering of Padauk with old Myanmar shaper
patch to disable old Myanmar shaper
patch to sort default gsub features in lookup order
Myanmar3 without Myanmar shaper but with lookups in old hb feature order
Padauk without old HB Myanmar shaper
Myanmar3 correct rendering with both patches

Description Keith Stribley 2010-10-20 07:43:49 UTC
Created attachment 39578 [details]
bad rendering with Myanmar3 due to old Myanmar shaper

The old Harfbuzz code contains a shaper which was written for one interpretation of the ambiguous Unicode 4 specification for Myanmar. However, Unicode 5.1 has been out for some time and most Myanmar Unicode fonts have been written so that they work just with the default OpenType features such as clig and liga since those features are enabled by default in Uniscribe and ICU.

The shaper rules in the old Harfbuzz are wrong for Myanmar Unicode 5.1 and actively prevent Myanmar Unicode fonts like Padauk (http://scripts.sil.org/Padauk) and Myanmar3 (http://code.google.com/p/myanmar3source/) from working. Both these fonts display correctly with Harfbuzz-NG, however some applications are still using the old Harfbuzz. It is possible to get the old Harfbuzz to render these fonts correctly by removing the Myanmar shaper.

In some cases it is also necessary to adapt the gsub implementation so that it applies all lookups in lookup order rather than first by feature then by lookup order. The harfbuzz-ng code already applies them in that order, though Pango doesn't use that order unfortunately.
Comment 1 Keith Stribley 2010-10-20 07:45:41 UTC
Created attachment 39579 [details]
bad rendering of Padauk with old Myanmar shaper
Comment 2 Keith Stribley 2010-10-20 07:47:43 UTC
Created attachment 39580 [details] [review]
patch to disable old Myanmar shaper
Comment 3 Keith Stribley 2010-10-20 07:49:18 UTC
Created attachment 39581 [details] [review]
patch to sort default gsub features in lookup order
Comment 4 Keith Stribley 2010-10-20 08:02:53 UTC
Created attachment 39583 [details]
Myanmar3 without Myanmar shaper but with lookups in old hb feature order
Comment 5 Keith Stribley 2010-10-20 08:05:00 UTC
Created attachment 39584 [details]
Padauk without old HB Myanmar shaper
Comment 6 Keith Stribley 2010-10-20 08:13:39 UTC
Created attachment 39585 [details]
Myanmar3 correct rendering with both patches

Padauk only uses clig in gsub so it avoids the lookup order problem. Myanmar3 mixes lookups in liga and clig which have to be applied in lookup order for correct rendering hence it needs both patches.
The unicode text used for the images is:
ကောင်းလား။
စက္ကူ
မြန်မာအင်္ဂလိပ်
Comment 7 Behdad Esfahbod 2010-10-20 09:12:19 UTC
Next version of pango will use harfbuzz-ng.

For the patches, feel free to commit if you have commit access.  Or ping Lars Knoll since he's been maintaining the .old code.
Comment 8 Behdad Esfahbod 2010-12-02 04:47:16 UTC
I'm closing down the bugs against the old code base.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.