Last Comment Bug 648248 - Buggy Hebrew fallback font on Mac OS X
: Buggy Hebrew fallback font on Mac OS X
Product: Core
Classification: Components
Component: Layout: Text (show other bugs)
: Trunk
: x86 Mac OS X
: -- normal (vote)
: mozilla5
Assigned To: Jonathan Kew (:jfkthame)
Depends on: 623495
  Show dependency treegraph
Reported: 2011-04-07 06:06 PDT by j. 'mach' wust
Modified: 2011-08-13 04:35 PDT (History)
7 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Bug 648248 - Change fallback Hebrew fonts to non-buggy fonts (1.90 KB, patch)
2011-04-08 09:10 PDT, j. 'mach' wust
no flags Details | Diff | Splinter Review
patch, change Hebrew fallback fonts - updated (1.89 KB, patch)
2011-04-11 06:19 PDT, Jonathan Kew (:jfkthame)
smontagu: review+
Details | Diff | Splinter Review
patch for checkin (2.02 KB, patch)
2011-04-12 05:03 PDT, Jonathan Kew (:jfkthame)
jfkthame: review+
Details | Diff | Splinter Review

Description j. 'mach' wust 2011-04-07 06:06:49 PDT
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0) Gecko/20100101 Firefox/4.0
Build Identifier: 

On Mac OS X, Hebrew text falls back to the buggy font Arial Hebrew.

Arial Hebrew will display the dagesh mark in the wrong place.

While this is really not a mozilla bug, there is no knowing when Apple will fix this font (if ever). So for the time being, a better fallback font should be chosen.

The other default Hebrew font, Raanana for serif text, suffers from the very same bug.

Reproducible: Always

Steps to Reproduce:
View an unstyled sequence (e.g. in Firefox or Thunderbird) of: 1. any Hebrew letter, 2. any niqqud mark, 3. dagesh, 4. another Hebrew letter, for instance: בֵּית (bet-tsere-dagesh-yod-tav) 'house'
Actual Results:  
The dagesh mark is displayed on the following letter (in the example בֵּית, on the letter י (yod).

Expected Results:  
The dagesh mark should be displayed on the preceding letter (in the example בֵּית, within the letter ב (bet).

For Mac OS X, I would suggest using the following fonts (preinstalled of course) instead of the buggy fonts Arial Hebrew and Raanana:

default fallback/sans-serif: Lucida Grande or Arial
serif: Times New Roman
monospace: Courier New

Safari and Chrome will default to Lucida Grande, so they have no problem.

Incidently, the inverse order is displayed correctly (1. any Hebrew letter, 2. dagesh, 3. any niqqud vowel mark, 4. another Hebrew letter), for instance בֵּית (bet-dagesh-tsere-yod-tav). However, normalization operations will switch to the other order.
Comment 1 Jonathan Kew (:jfkthame) 2011-04-08 08:58:36 PDT
Yes, I can confirm the buggy rendering with Arial Hebrew. That looks like a font bug to me (though I haven't investigated deeply); it would make sense to specify something different as the default for Hebrew so as to avoid the issue. Simon, any thoughts on the most appropriate choices?
Comment 2 j. 'mach' wust 2011-04-08 09:02:52 PDT
I have written a simple test page that illustrates the issue in two tables (with pictures): First the buggy current fallback fonts; second the alternative correct fallback fonts I would propose:
Comment 3 j. 'mach' wust 2011-04-08 09:10:44 PDT
Created attachment 524635 [details] [diff] [review]
Bug 648248 - Change fallback Hebrew fonts to non-buggy fonts

I have tried to write my very first patch. It is supposed to change the fonts according to what I have proposed here (as illustrated on ).

I do not know whom to put in as reviewer.
Comment 4 Jonathan Kew (:jfkthame) 2011-04-08 09:45:07 PDT
Comment on attachment 524635 [details] [diff] [review]
Bug 648248 - Change fallback Hebrew fonts to non-buggy fonts

Thanks for the patch! Asking smontagu for review, as he's knowledgeable about Hebrew.
Comment 5 Simon Montagu :smontagu 2011-04-11 02:15:32 PDT
Comment on attachment 524635 [details] [diff] [review]
Bug 648248 - Change fallback Hebrew fonts to non-buggy fonts

I would prefer changing Arial Hebrew to Arial, instead of Lucida Grande, which I find rather ugly in Hebrew.
Comment 6 Jonathan Kew (:jfkthame) 2011-04-11 04:07:10 PDT
(In reply to comment #5)
> Comment on attachment 524635 [details] [diff] [review]
> Bug 648248 - Change fallback Hebrew fonts to non-buggy fonts
> I would prefer changing Arial Hebrew to Arial, instead of Lucida Grande, which
> I find rather ugly in Hebrew.

One point to note is that older versions of Arial don't render Hebrew diacritics well under Core Text. In a brief test, they look OK with v5.01 (which I think is the version currently shipped with the OS), but fail with 3.05, which I had installed locally - it probably comes from MS Office or something like that. I wouldn't be surprised if it's fairly common for users to have local versions of Arial that "hide" the default system version, in which case they may see poorer results.

Enabling harfbuzz for Hebrew fixes the rendering with Arial 3.05, so if we fix bug 623495 this will be less of a concern.
Comment 7 Jonathan Kew (:jfkthame) 2011-04-11 06:19:52 PDT
Created attachment 525063 [details] [diff] [review]
patch, change Hebrew fallback fonts - updated

Updated patch to use Arial for sans-serif., would you like to provide a full name to be included in the commit message when we make this change? Normally, we use "full name <email.address>" to record the patch author in the history.
Comment 8 Jonathan Kew (:jfkthame) 2011-04-12 05:03:29 PDT
Created attachment 525358 [details] [diff] [review]
patch for checkin

patch for checkin, carrying forward r=smontagu
Comment 9 Jonathan Kew (:jfkthame) 2011-04-12 10:46:06 PDT
Pushed to mozilla-central:

This caused reftests bidi-004 and bidi-004-j to fail on OS X 10.5, because the version of Times New Roman there doesn't include the Hebrew presentation-form characters. Pushed a followup to fix this by specifying Raanana as the first-choice font for those tests:
Comment 10 Tomer Cohen :tomer 2011-07-04 05:51:38 PDT
We are getting user complains on our community forum from osx users having fallback to wrong fonts and no text at all after disabling these fonts. Could it be caused by this issue?
Comment 11 Jonathan Kew (:jfkthame) 2011-07-04 06:13:43 PDT
Sorry, but I'm not able to read discussions in Hebrew or identify specific problem reports there. If you can point me to a reduced test-case that exhibits these problems, I'll try to look into it.

Probably best to file a new bug for any such issue, actually. Attaching a small test file that demonstrates the failure would be most helpful.

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