Mac vs. Windows Browser Font Height Rendering Issue Mac vs. Windows Browser Font Height Rendering Issue windows windows

Mac vs. Windows Browser Font Height Rendering Issue


The font's ascent is too small. The Windows browsers (and Mac Safari, too, in my testing) just throw out the ascent value as incorrect, whereas Firefox and Opera on the Mac accept it.

The easiest way to fix this is with ttx, part of FontTools.

Use it like this:

% ttx bubbleboy-2.ttf[...]% edit bubbleboy-2.ttx

Change the ascent value to 1100 (or whatever works for you):

  <hhea>    <tableVersion value="1.0"/>    <ascent value="1100"/>

Then reconstitute the font:

% ttx bubbleboy-2.ttx Compiling "bubbleboy-2.ttx" to "bubbleboy-2#1.ttf"...[...]

This new font should be fixed; you can check by opening it in Font Book.

If you want a more visual picture of the problem, try FontForge, though be warned its interface is rather baroque. Once you've opened the font, double-click a capital letter; you'll see a horizontal line bisecting the glyph. This is the (wrong) ascent. You can fix the ascent in Element > Font Info, then click General. Uncheck "Scale Outlines" or the ascent will be bigger but still wrong. :-)

However, to modify the font, I would recommend ttx over FontForge for small changes like this because it's less likely to destroy what it doesn't understand.


I was able to fix my font by uploading the TTF version to FontSquirrel and selecting the "Expert" option and then keeping all default options. The one that fixes it I believe is "Fix Vertical Metrics."

Now the font line height renders the same on MAC and PC. Good luck


Actually Windows is the culprit. Windows ClearType font renderer actually hammers the font's shape into pixel boundaries to make it "clearer" whereas Mac OS doesn't touch the shape of the font (which I very much prefer). This often leads to "taller" or "thinner" glyphs on screen, whereas on Mac OS you get a true representation of the font as the designer intended.

Here's an article by Jeff Atwood explaining the differences. In any case, you're not going to be able to get around it.

http://www.codinghorror.com/blog/2007/06/font-rendering-respecting-the-pixel-grid.html