Closed Bug 476504 Opened 15 years ago Closed 15 years ago

fonts with bad metrics cause portions of pages to not render

Categories

(Core :: Graphics, defect, P2)

x86
macOS
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: ian, Assigned: jtd)

References

()

Details

(Keywords: fixed1.9.1)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/530.0+ (KHTML, like Gecko) Version/3.2.1 Safari/525.27.1
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.5) Gecko/2008120121 Firefox/3.0.5

This problem is strange and horrible. Last week, Firefox stopped rendering parts of pages. It seems to be related to fonts and/or colors. Normal text renders, but stylized text doesn't.

I have extensively troubleshot the problem, with no resolution. I have done the following:

 - Restarted Firefox
 - Restarted my system.
 - Downgraded from Firefox 3.1b2 to 3.0.5.
 - Created a new profile.
 - Disabled all extensions.
 - Started Firefox in safe mode.
 - Finally, located every Firefox-related file on my system ("sudo find / -xdev -iname \*firefox\*") and rm -rf'd it; rebooted; downloaded and installed Firefox 3.0.5.

The problem persists. It does not happen on a co-worker’s system. It doesn't happen on my other laptop.

I see these errors in my console:

firefox-bin[10874] <Error>: GCGetStrikeMetrics failed: error 3.

Reproducible: Always

Steps to Reproduce:
1. Visit the provided URL
2. Scroll down

Actual Results:  
I get an empty gray box.

Expected Results:  
I should see sample code.

Firefox rendering: http://idisk.mac.com/ieure-Public/firefox.png
Safari 3 rendering: Firefox’s rendering: http://idisk.mac.com/ieure-Public/safari.png
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1b3pre) Gecko/20090202 Shiretoko/3.1b3pre

I can't reproduce the problem on Windows XP; I see no gray boxes without text.
Version: unspecified → 3.1 Branch
Did you check your fonts with the OS X fontbook ?
Can you try a nightly build because Beta2 is very old and OS X fonts got a few fixes ?
Component: General → GFX: Thebes
Product: Firefox → Core
QA Contact: general → thebes
Version: 3.1 Branch → 1.9.1 Branch
(In reply to comment #2)
> Did you check your fonts with the OS X fontbook ?
As I've nuked my preferences, they're using the default fonts: Helvetiva, Times, and Courier. I haven't removed my system fonts or anything crazy like that. The fonts Firefox is asking for all exist.

Just to be sure, I changed them to Lucida Grande (serif and sans-serif) and Monaco (monospace). I still get the same behavior.


> Can you try a nightly build because Beta2 is very old and OS X fonts got a few
> fixes ?
Just tried:

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090202 Minefield/3.2a1pre

(Downloaded from http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/)

It exhibits the same issue.
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2a1pre) Gecko/20090202 Minefield/3.2a1pre ID:20090202033956 exhibits desired behavior for me.

Warning: Error in parsing value for 'border-width'.  Declaration dropped.
Source File: http://www.phpunit.de/manual/3.3/en/docbook.css
Line: 50

Is the only thing I see in my error console, but I don't think that will affect your problem sections. Didn't look at the HTML too deeply though. Could be Mac only.
Version: 1.9.1 Branch → Trunk
(In reply to comment #3)
> (In reply to comment #2)
> > Did you check your fonts with the OS X fontbook ?
> As I've nuked my preferences, they're using the default fonts: Helvetiva,
> Times, and Courier. I haven't removed my system fonts or anything crazy like
> that. The fonts Firefox is asking for all exist.

Font Book has a feature that checks for corrupt fonts and another one that checks for duplicate fonts; matti was asking you to use those features to check your fonts.
Not apparently a Camino trunk build problem; 2.0b2pre (1.9.0.7pre 2009020302) running under Mac OS X 10.4.11 properly displays the gray boxes with text at the given URL.

I'd do what Matti and Smokey suggest.  There exists some weirdness with OS X and fonts.  Since the problem appears to be on a single machine, it's quite possible something's awry with fonts.
(In reply to comment #5)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > Did you check your fonts with the OS X fontbook ?
> > As I've nuked my preferences, they're using the default fonts: Helvetiva,
> > Times, and Courier. I haven't removed my system fonts or anything crazy like
> > that. The fonts Firefox is asking for all exist.
> 
> Font Book has a feature that checks for corrupt fonts and another one that
> checks for duplicate fonts; matti was asking you to use those features to check
> your fonts.
I see, I had no idea there was such a feature.

It found one minor problem with one font Firefox was not using. I:

 - Uninstalled the font
 - Nuked all Firefox stuff except the app (dropped Firefox on AppZapper, deselected the application, zapped, emptied trash)
 - Launched Firefox (it wasn't running)

Problem is still there.
Okay, found what causes the problem, and it is a busted font, though Font Book didn't say so.

The font is Terminus, available here: http://fractal.csie.org/~eric/wiki/Terminus_font

It's the second set:
http://chlamydia.fs.ei.tum.de/~corecode/unsorted/Terminus.ttf
http://chlamydia.fs.ei.tum.de/~corecode/unsorted/TerminusBold.ttf

MD5 hashes:
5eac97fcbda2740d70085e43d9194c89  Terminus.ttf
7e2b4bb6a8528c3b1ba47efe0a27f05c  TerminusBold.ttf

If either of those files are placed in ~/Library/Fonts, Firefox exhibits the behavior.

The issue is that the markup specifically asks for Terminus, which is broken and doesn't render anything.

I don't know if there's a workaround for this, but it would be nice if Firefox would fall back to a less-hosed font in this case.
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to comment #8)
> The issue is that the markup specifically asks for Terminus, which is broken
> and doesn't render anything.
> 
> I don't know if there's a workaround for this, but it would be nice if Firefox
> would fall back to a less-hosed font in this case.

Depending on the manner in which the font file is busted, it might be possible.  Safari appears to fall back to Lucida Grande on this page.
The font noted in comment 8 is a sfnt-format bitmap font, it lacks head and glyf tables.  The problem here is that we're not checking for errors from ATSFontGetHorizontalMetrics when initializing font metrics.

http://mxr.mozilla.org/mozilla-central/source/gfx/thebes/src/gfxAtsuiFonts.cpp#269

Oddly, Font Book seems to think this font is fine.
Assignee: nobody → jdaggett
Status: NEW → ASSIGNED
Flags: blocking1.9.1?
Priority: -- → P2
Summary: Portions of pages not rendering → fonts with bad metrics cause portions of pages to not render
Ian, I've set up a tryserver build that includes the fix for this problem.  

  http://tinyurl.com/badmetrics

Could you try it out and let me know if it works for you?  You'll need to drop the Terminus fonts back in your font folder, run the test, then take them out again.
Note: you'll still see the console error message (same as Safari) but the test page should render just fine, normal font fallback will occur.
(In reply to comment #12)
> Ian, I've set up a tryserver build that includes the fix for this problem.  
> 
>   http://tinyurl.com/badmetrics
> 
> Could you try it out and let me know if it works for you?  You'll need to drop
> the Terminus fonts back in your font folder, run the test, then take them out
> again.

Bingo, this works as I'd expect.
Flags: blocking1.9.1? → blocking1.9.1+
Attachment #360862 - Flags: review?(vladimir)
pushed
http://hg.mozilla.org/mozilla-central/rev/37c32758f73d
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Keywords: fixed1.9.1
Blocks: 489948
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: