Last Comment Bug 672955 - Thai pages not displaying some characters correctly
: Thai pages not displaying some characters correctly
Status: VERIFIED FIXED
:
Product: Core
Classification: Components
Component: Layout: Text (show other bugs)
: 6 Branch
: x86 Mac OS X
: -- normal (vote)
: mozilla8
Assigned To: Jonathan Kew (:jfkthame)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-20 14:42 PDT by [:Cww]
Modified: 2011-08-01 15:01 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+
fixed
+
fixed


Attachments
patch, prefer HarfBuzz to Core Text for shaping Thai on OS X (2.88 KB, patch)
2011-07-21 07:06 PDT, Jonathan Kew (:jfkthame)
jd.bugzilla: review+
christian: approval‑mozilla‑aurora+
christian: approval‑mozilla‑beta+
Details | Diff | Splinter Review

Description [:Cww] 2011-07-20 14:42:57 PDT
From input: http://input.mozilla.com/en-US/?product=firefox&sentiment=sad&date_end=&date_start=2011-07-12&version=6.0&q=thai

Thai characters aren't working correctly or consistently.

For example, some of the text on http://www.glo.or.th/index.php works but others don't. http://www.bts.co.th/th/index.asp is another good example.

It seems that most people are complaining about thai facebook but that could be a function of the site's popularity.  All reports are OSX.
Comment 1 Axel Hecht [:Pike] 2011-07-20 15:05:27 PDT
FWIW, the font info says that the corrupted display is diplayed in the "Microsoft Sans Serif" font.

Which matches the CSS style, font-family: "MS Sans Serif","Microsoft Sans Serif";
Comment 2 Jonathan Kew (:jfkthame) 2011-07-21 07:00:52 PDT
The problem here is that Microsoft Sans Serif includes Thai characters, but doesn't have AAT tables. I believe this causes Core Text to decide that it can't actually be used, and substitute some other font during its shaping. The result is that we end up with glyph IDs that don't correspond to the font that thebes thinks it's using.
Comment 3 Jonathan Kew (:jfkthame) 2011-07-21 07:06:17 PDT
Created attachment 547392 [details] [diff] [review]
patch, prefer HarfBuzz to Core Text for shaping Thai on OS X

This fixes the problem by preferring the HB shaper, which doesn't switch fonts behind our back.

It is configured to apply on OS X only for now, so that we don't change behavior on Windows; I believe the MS shaping engines do "sequence checking" and insert dotted circles in cases that they consider ill-formed. While this is a debatable practice, I don't want to change it as a side-effect of this bug; we should look into it separately.
Comment 4 Jonathan Kew (:jfkthame) 2011-07-26 02:52:10 PDT
http://hg.mozilla.org/integration/mozilla-inbound/rev/f83df39873c7
Comment 6 [:Cww] 2011-07-26 14:37:38 PDT
Comment on attachment 547392 [details] [diff] [review]
patch, prefer HarfBuzz to Core Text for shaping Thai on OS X

I know it doesn't have bake time on trunk yet but this looks pretty safe and I really really want this on beta ASAP.
Comment 7 christian 2011-07-26 15:11:43 PDT
Comment on attachment 547392 [details] [diff] [review]
patch, prefer HarfBuzz to Core Text for shaping Thai on OS X

Approved for releases/mozilla-aurora and releases/mozilla-beta. Please land asap.
Comment 9 Simona B [:simonab ] 2011-08-01 06:51:10 PDT
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0a2) Gecko/20110731 Firefox/7.0a2
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0) Gecko/20100101 Firefox/6.0

Verified issue on FF 6.0b4 and Aurora using the links provided as examples in the Description - characters are correctly displayed.

Setting resolution to VERIFIED FIXED.

Note You need to log in before you can comment on or make changes to this bug.