Closed
Bug 410954
Opened 17 years ago
Closed 17 years ago
[mac] Latin font incorrect/bold after certain Hebrew character
Categories
(Core :: Graphics, defect, P4)
Tracking
()
RESOLVED
FIXED
People
(Reporter: uriber, Assigned: jtd)
References
()
Details
(Keywords: regression, testcase)
Attachments
(6 files, 2 obsolete files)
(deleted),
text/html,charset=windows-1255
|
Details | |
(deleted),
image/png
|
Details | |
(deleted),
text/html
|
Details | |
(deleted),
text/plain
|
Details | |
(deleted),
text/plain
|
Details | |
(deleted),
patch
|
pavlov
:
review+
pavlov
:
superreview+
|
Details | Diff | Splinter Review |
On a page with Hebrew and English text, using the default fonts, the font used to display English becomes sans-serif and bold, following a specific Hebrew character (U+05BE HEBREW PUNCTUATION MAQAF).
This seems to also depend on the length and position of the Hebrew and English texts. There might be other characters that trigger this bug as well.
Flags: blocking1.9?
Reporter | ||
Comment 1•17 years ago
|
||
Reporter | ||
Updated•17 years ago
|
Attachment #295534 -
Attachment mime type: text/html → text/html,charset=windows-1255
Reporter | ||
Comment 2•17 years ago
|
||
This is on OS X 10.4.11 PPC, BTW.
I see serif and italics on 10.5.1 Intel, so it's only half as broken ;)
Reporter | ||
Comment 4•17 years ago
|
||
In this utf-8 testcase the Hebrew fonts are messed up, and the culprit is the NIS sign (U+20AA).
This is based on a google.com search result page, where a NIS sign appearing somewhere in the middle affected the font of (almost) everything beneath it.
Assignee | ||
Comment 5•17 years ago
|
||
I'm fairly sure I know the cause of this but I can't reproduce the same results you're seeing. My guess is that your font settings are slightly different than the defaults or the fonts you have available on your system are different.
If possible, could you attach the following:
(1) the prefs.js for the profile you used
(e.g. ~/Library/Application Support/Firefox/Profiles/xxxxx/prefs.js)
(2) a listing of the fonts on your system
ls -l /System/Library/Fonts
ls -l /Library/Fonts
ls -l ~/Library/Fonts
Another way to track this down if you have a debug build available is to enable text run dumping in gfxAtsuiFonts.cpp by uncommenting the line here:
http://mxr.mozilla.org/seamonkey/source/gfx/thebes/src/gfxAtsuiFonts.cpp#69
Then enable logging:
export NSPR_LOG_MODULES=atsuiTextRun:5
export NSPR_LOG_FILE=atsuiTextRun.log
In the output file, for each text run you'll see the content of the text run along with the fonts that were matched:
InitTextRun 3fd21910 fontgroup 3f9b39b0 (sans-serif) len 6 TEXTRUN "foobar" ENDTEXTRUN
InitTextRun font: ArialHebrew
InitTextRun 3fd21910 fontgroup 3f9b39b0 font 3fd21c60 match Times-Roman (1-6)
InitTextRun 3fd25fb0 fontgroup 3f9b39b0 (sans-serif) len 3 TEXTRUN "א־ב" ENDTEXTRUN
InitTextRun font: ArialHebrew
InitTextRun 3fd25fb0 fontgroup 3f9b39b0 font 3fd0d830 match ArialHebrew (1-1)
InitTextRun 3fd25fb0 fontgroup 3f9b39b0 font 35830c90 match TimesNewRomanPSMT (2-1)
InitTextRun 3fd25fb0 fontgroup 3f9b39b0 font 3fd0d830 match ArialHebrew (3-1)
InitTextRun 3fd219a0 fontgroup 3f9b39b0 (sans-serif) len 6 TEXTRUN "barfoo" ENDTEXTRUN
InitTextRun font: ArialHebrew
InitTextRun 3fd219a0 fontgroup 3f9b39b0 font 35830c90 match TimesNewRomanPSMT (1-6)
The font match information indicates the font matched for a specific subsection of the text run above it, the numbers in () indicate position-length. As you can see above, with my profile "barfoo" is matched with "Times New Roman" which is not correct, it should be matched with "Times". I spotted this last week, the code for looking up fonts automatically adds the font to the font group:
http://mxr.mozilla.org/seamonkey/source/gfx/thebes/src/gfxAtsuiFonts.cpp#469
When the script changes, fonts in the font group will be considered first and this will be incorrect. This same routine on Windows doesn't do this:
http://mxr.mozilla.org/seamonkey/source/gfx/thebes/src/gfxWindowsFonts.cpp#464
Assignee: nobody → jdaggett
Assignee | ||
Updated•17 years ago
|
Priority: -- → P4
Reporter | ||
Comment 6•17 years ago
|
||
prefs.js from a clean, new profile (which I see the problem with).
Reporter | ||
Comment 7•17 years ago
|
||
This lists fonts from the three folders (the user one is empty).
Reporter | ||
Comment 8•17 years ago
|
||
I don't have a recent debug build right now. If I have time, I'll build one, and report the results here.
Reporter | ||
Comment 9•17 years ago
|
||
Here's the log from my debug build:
-1610551928[1506cb0]: InitTextRun 35de88a0 fontgroup 2be1dc80 (sans-serif) len 6 TEXTRUN "foobar" ENDTEXTRUN
-1610551928[1506cb0]: InitTextRun font: ArialHebrew
-1610551928[1506cb0]: InitTextRun 35de88a0 fontgroup 2be1dc80 font 2be99140 match Times-Roman (1-6)
-1610551928[1506cb0]: InitTextRun 35d46250 fontgroup 2be1dc80 (sans-serif) len 3 TEXTRUN "א־ב" ENDTEXTRUN
-1610551928[1506cb0]: InitTextRun font: ArialHebrew
-1610551928[1506cb0]: InitTextRun 35d46250 fontgroup 2be1dc80 font 2be99400 match ArialHebrew (1-1)
-1610551928[1506cb0]: InitTextRun 35d46250 fontgroup 2be1dc80 font 35d586c0 match LucidaGrande-Bold (2-1)
-1610551928[1506cb0]: InitTextRun 35d46250 fontgroup 2be1dc80 font 2be99400 match ArialHebrew (3-1)
-1610551928[1506cb0]: InitTextRun 35d90e00 fontgroup 2be1dc80 (sans-serif) len 6 TEXTRUN "barfoo" ENDTEXTRUN
-1610551928[1506cb0]: InitTextRun font: ArialHebrew
-1610551928[1506cb0]: InitTextRun 35d90e00 fontgroup 2be1dc80 font 35d586c0 match LucidaGrande-Bold (1-6)
Lucida Grande Bold is picked for the MAQAF in the middle of the second textrun, and then used for the third textrun as well.
Assignee | ||
Comment 10•17 years ago
|
||
Steps to reproduce:
1. Remove fonts from user font directory (~/Library/Fonts)
2. Open testcase
Result: with default fonts and default prefs, 'barfoo' is displayed using Lucida Grande Bold
There are actually two bugs here:
1. fallback fonts are appended to the end of font group list when used
The default pref settings will use Arial Hebrew for Hebrew codepoints. However, the MAQAF character (U+05BE) is not available in Arial Hebrew so fallback will occur to system fonts. Only Lucida Grande and Lucida Grande Bold contain glyphs for this character.
Solution: remove automatic insertion of font face into font group upon lookup in GetOrMakeFont (gfxAtsuiFonts version).
2. a bold face is chosen instead of a normal weight face
This is because the font matching code attempts to match the weight of the font used for preceding characters, in this case Arial Hebrew. Arial Hebrew has a weight of 400, Lucida Grande has a weight of 500, so they don't match exactly and the relative ranks of the normal and bold face are the same. The tie between two fonts is always broken by taking the latter one.
Solution: add code to bump the rank of "nearby" weight faces in gfxQuartzFontCache::FindFontForCharProc.
Status: NEW → ASSIGNED
Assignee | ||
Comment 11•17 years ago
|
||
Font matching output with testcase and patch build:
InitTextRun 3fc5a9b0 fontgroup 3fc59890 (sans-serif) len 6 TEXTRUN "foobar" ENDTEXTRUN
InitTextRun font: ArialHebrew
InitTextRun 3fc5a9b0 fontgroup 3fc59890 font 3fc5acb0 match Times-Roman (1-6)
InitTextRun 3fc5b2f0 fontgroup 3fc59890 (sans-serif) len 3 TEXTRUN "א־ב" ENDTEXTRUN
InitTextRun font: ArialHebrew
InitTextRun 3fc5b2f0 fontgroup 3fc59890 font 3fc59aa0 match ArialHebrew (1-1)
InitTextRun 3fc5b2f0 fontgroup 3fc59890 font 3fc8eb50 match LucidaGrande-Bold (2-1)
InitTextRun 3fc5b2f0 fontgroup 3fc59890 font 3fc59aa0 match ArialHebrew (3-1)
InitTextRun 3fc5aa40 fontgroup 3fc59890 (sans-serif) len 6 TEXTRUN "barfoo" ENDTEXTRUN
InitTextRun font: ArialHebrew
InitTextRun 3fc5aa40 fontgroup 3fc59890 font 3fc5acb0 match Times-Roman (1-6)
Note that barfoo matches against Times Roman, not Lucida Grande or Times New Roman. Lucida Grande Bold is still matched, that fix coming up...
Assignee | ||
Comment 12•17 years ago
|
||
Attachment #295906 -
Attachment is obsolete: true
Attachment #296086 -
Flags: superreview?(pavlov)
Attachment #296086 -
Flags: review?(pavlov)
Assignee | ||
Comment 13•17 years ago
|
||
oops, sorry about that...
Attachment #296086 -
Attachment is obsolete: true
Attachment #296087 -
Flags: superreview?(pavlov)
Attachment #296087 -
Flags: review?(pavlov)
Attachment #296086 -
Flags: superreview?(pavlov)
Attachment #296086 -
Flags: review?(pavlov)
Updated•17 years ago
|
Attachment #296087 -
Flags: superreview?(pavlov)
Attachment #296087 -
Flags: superreview+
Attachment #296087 -
Flags: review?(pavlov)
Attachment #296087 -
Flags: review+
Updated•17 years ago
|
Flags: blocking1.9? → blocking1.9+
Assignee | ||
Updated•17 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Updated•17 years ago
|
Flags: in-testsuite?
You need to log in
before you can comment on or make changes to this bug.
Description
•