downloadable font uses different metrics in Firefox compared to Chrome under OSX

RESOLVED WORKSFORME

Status

()

Core
Graphics: Text
RESOLVED WORKSFORME
6 years ago
4 years ago

People

(Reporter: Sean Martell, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

6 years ago
Issue: text using font-face in Firefox adds and extra ~20px to the top of the characters on OSX. Seems to be fine on Windows. I'm told turning off the sanitizer doesn't fix it.

Example page: http://mozilla.seanmartell.com/delorean/

Chrome vs Firefox on OSX:
http://cl.ly/3n430F0o1v2I0L390E3q

Chrome vs Firefox on Windows 7:
http://t.co/K7sdpHka

The fate of a fancy Delorean release date page hangs in the balance. IN THE BALANCE.

I thank you for your attention to this matter.

:)
Unfortunately, OpenType fonts contain several versions of the various font metrics (ascent, descent, line-spacing), and different applications and/or operating systems rely on different ones of these. Hence, if the font developer does not harmonize the multiple sets of metrics, the results may vary considerably.

I notice that Opera (on OS X) gives a similar result to Firefox, with "excess" space above the glyphs.

I haven't disassembled and examined the font data, but I'd guess the problem is a discrepancy between metrics in the 'head' and 'OS/2' tables.

It would be nice if we had a consistent result across all systems and browsers, but at this point you can't rely on that; the workaround is to ensure consistency within the font data.
Is this a problem with the font itself (which means we should reach out to the author and point it out), or is there an existing mechanism by which we can tweak our interpretation of font data?

Updated

6 years ago
Summary: Extra top padding on font-face in Firefox on OSX → downloadable font uses different metrics in Firefox compared to Chrome under OSX
Well, it's a bit of both, I think... the font data seems to be inconsistent in some way (I notice that if I download the font file and load it into FontForge, I see a significant amount of space above the glyphs; it's not clear to me exactly which of the various metrics are being used in each case). So I do think the author (or font vendor) could make changes that would make it more reliably consistent. The fact that Opera gives similar rendering to Firefox confirms that it's not _purely_ a Gecko problem.

On our side, I'd like to see us share more of the font-metrics code between platforms and ensure more consistent behavior, but changes in this area are tricky and need extensive testing, as there are so many sometimes-conflicting factors (and huge potential for regressions).
(Reporter)

Comment 4

4 years ago
This seems to have been fixed? Not seeing the issue now. Closing out! :)
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.