mozilla / tabzilla

Universal Tab for Mozilla websites
Mozilla Public License 2.0
74 stars 46 forks source link

open sans is getting rejected in firefox over "too large a kern table" #73

Closed Pomax closed 9 years ago

Pomax commented 9 years ago

Seeing the following errors when using tabzilla:

downloadable font: kern: Too large subtable., table discarded (font-family: "Open Sans" style:normal weight:bold stretch:normal src index:1) source: https://mozorg.cdn.mozilla.net/media/fonts/OpenSans-Bold-webfont.woff
downloadable font: kern: Too large subtable., table discarded (font-family: "Open Sans" style:normal weight:normal stretch:normal src index:1) source: https://mozorg.cdn.mozilla.net/media/fonts/OpenSans-Regular-webfont.woff
craigcook commented 9 years ago

We're encouraging sites to switch over to "static" Tabzilla instead of the old interactive Tabzilla, and to no longer rely on fonts included by Tabzilla. So this issue isn't necessarily Tabzilla-specific, but you're still going to see the same console errors with any unsubsetted Open Sans, wherever it's served from.

To quote myself from bug 1185685:

A kerning table is a set of instructions within a digital font file telling renderers how to kern certain character combinations. Open Sans has such a massive character set that it must also have a massive kerning table, apparently too much for the browser to handle, so it discards large chunks of it. Since it doesn't appear to significantly impact rendering, perhaps the chunks it discards are the ones for characters it's not rendering. So maybe this is just a browser doing what it should and it's only annoying that the error gets logged every time. I'd defer to someone with more expertise in how browsers process and render fonts.

So as far as I can tell the font still loads and renders just fine, only portions of the kerning table are ignored. However, I admit I haven't built a serious test case to really measure this (I could make a single page with every possible kerning pair and see which ones have bad kerning, but that's thousands of combinations). But I've looked at a number of pages in a number of languages and seen no obvious faulty rendering.

We use an unsubsetted version of Open Sans to cover the widest possible range of locales, but if your particular site is only available in a few languages you could opt for a subsetted version and eliminate this error. You could also try a different font entirely (like Fira Sans). Otherwise there doesn't seem to be a real fix, and I haven't seen any impact of the error apart from the annoyance of seeing it in the console.