Closed Bug 1403166 Opened 4 years ago Closed 4 years ago

Khmer Unicode Renders Incorrectly using macOS system fonts


(Core :: Layout: Text and Fonts, defect, P3)

57 Branch



Tracking Status
firefox57 --- fix-optional
firefox58 --- fixed


(Reporter: sungkhum, Assigned: jfkthame)



(3 files, 1 obsolete file)

Attached image firefox.png
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Safari/604.1.38

Steps to reproduce:

Browse to a Khmer website (like )

Actual results:

The title bar will not render Khmer correctly in Firefox on Mac OS Sierra

Expected results:

Khmer should render correctly as it does in Chrome and Safari
Component: Untriaged → Layout: Text
Product: Firefox → Core
Normally, for complex-script fonts on macOS, we route the shaping through Core Text so that Apple's AAT fonts will work properly. Unfortunately, this doesn't seem to be a good option for the Khmer fonts they're now shipping, which also have OpenType layout tables; we'll do better to allow harfbuzz to handle them.
Attachment #8916637 - Flags: review?(jmuizelaar)
Assignee: nobody → jfkthame
Ever confirmed: true
Priority: -- → P3
Summary: Khmer Unicode Renders Incorrectly → Khmer Unicode Renders Incorrectly using macOS system fonts
Hmm, I wonder if this is actually another example like bug 1370927, where the AAT fonts require an "unexpected" feature to be enabled in order to shape correctly. I'll do a quick experiment to check that; if so, that would probably be the better workaround to apply.
Yep, this appears to fix the Khmer rendering, just like the Indic split-vowel cases. Sad, but at least it's simple.
Attachment #8917460 - Flags: review?(jmuizelaar)
Comment on attachment 8916637 [details] [diff] [review]
Prefer HarfBuzz shaping over Core Text for the macOS Khmer fonts that include both AAT and OpenType Layout tables, as the latter seem to work better

Obsoleting this patch; I think the fix in gfxCoreTextShaper is a better approach, as it means we're using the same rendering path for these fonts as Apple does in their own software.
Attachment #8916637 - Attachment is obsolete: true
Attachment #8916637 - Flags: review?(jmuizelaar)
Attachment #8917460 - Flags: review?(jmuizelaar) → review+
Pushed by
For Khmer AAT fonts, enable the Line Initial Smart Swashes feature, which is (incorrectly) required for some vowels to render properly. r=jrmuizel
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.