CFF2 fonts get rejected by OTS, despite supposedly being v8.0.0
Categories
(Core :: Layout: Text and Fonts, defect)
Tracking
()
People
(Reporter: pomax, Unassigned)
Details
Attachments
(2 files)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:70.0) Gecko/20100101 Firefox/70.0
Steps to reproduce:
I'm running the code on https://github.com/Pomax/Font.js/tree/89abc43f8671d6de1fe4e55d9ce92f63f33cfe99 in Firefox nightly (72), using fairly simple steps:
- check out code
- run an http server in the root dir (node's http-server, python -m SimpleServer, what have you)
- open http://localhost:8080/index.html (or different port depending on the server used)
This will load 12 fonts, all Adobe Code Pro, in ttf/otf/woff/woff2 versions of both the single-face old style font, and modern variable axes font.
The plain otf version uses the older CFF table for glyph data, and the variable axis version uses the new CFF2 table. Both "flavours" should work fine in Firefox 71 and 72.
Actual results:
Instead, all the otf variable font versions (.otf, .woff, and .woff2) fail to parse, citing n OTS error about there not being a table for supplying glyph data. This error was thrown by versions of OTS prior to v8.0.0, which did not support the CFF2 format.
Expected results:
CFF2 fonts should work as of Firefox 71, as per https://bugzilla.mozilla.org/show_bug.cgi?id=1577799, where OTS was supposedly uplifted to v8.0.0
So... either there's a regression, or OTS wasn't actually properly updated?
Comment 1•6 years ago
|
||
(In reply to pomax from comment #0)
Instead, all the otf variable font versions (.otf, .woff, and .woff2) fail to parse, citing n OTS error about there not being a table for supplying glyph data. This error was thrown by versions of OTS prior to v8.0.0, which did not support the CFF2 format.
What exact error message do you see in the web console?
What I get (with today's Nightly 72.0a1) is a series of messages like:
downloadable font: not usable by platform (font-family: "Adobe Source Code Pro (variable otf woff2)" style:normal weight:400 stretch:100 src index:0) source: http://localhost:8000/test/SourceCodeVariable-Roman.otf.woff2
which is not an OTS message; it indicates that the resource made it through OTS, but was not usable by the platform font API when we tried to actually instantiate a platform font. (I'm on macOS 10.13, and I suspect it simply doesn't support CFF2.)
That's not the error I get on MacOs. On both High Sierra and Mojave I get the following error pairs in today's nightly:
downloadable font: not supported glyph shapes table(s) present (font-family: "Adobe Source Code Pro (variable otf woff)" style:normal weight:400 stretch:100 src index:0) source: http://localhost:8000/test/SourceCodeVariable-Roman.otf.woff
downloadable font: rejected by sanitizer (font-family: "Adobe Source Code Pro (variable otf woff)" style:normal weight:400 stretch:100 src index:0) source: http://localhost:8000/test/SourceCodeVariable-Roman.otf.woff
But OS support is possible also involved: trying this in Windows 10 works perfectly fine and the font gets applied without any warnings or errors.
Comment 4•6 years ago
|
||
(In reply to pomax from comment #2)
That's not the error I get on MacOs. On both High Sierra and Mojave I get the following error pairs in today's nightly:
downloadable font: not supported glyph shapes table(s) present (font-family: "Adobe Source Code Pro (variable otf woff)" style:normal weight:400 stretch:100 src index:0) source: http://localhost:8000/test/SourceCodeVariable-Roman.otf.woff downloadable font: rejected by sanitizer (font-family: "Adobe Source Code Pro (variable otf woff)" style:normal weight:400 stretch:100 src index:0) source: http://localhost:8000/test/SourceCodeVariable-Roman.otf.woff
That's curious.... could you attach the about:support data from there? I wonder what's different from my system...
Absolutely. I've attached both the raw data from about:support, and a screenshot of FF with the dev tools console open.
Also to make things more curious, Chrome seems to load all fonts just fine on the same versions of MacOS. (That noted, I'm not super familiar with either FF's or Chrome's text shaping stack, so I have no idea whether it means FF asks the OS to render the text and Chrome uses its own shaping, or whether something else is at play)
Comment 9•6 years ago
|
||
(In reply to pomax from comment #7)
Absolutely. I've attached both the raw data from about:support, and a screenshot of FF with the dev tools console open.
Your about:support says it's version 70.0.1, so it predates the OTS update in bug 1577799.
Comment 10•6 years ago
|
||
(In reply to pomax from comment #8)
Also to make things more curious, Chrome seems to load all fonts just fine on the same versions of MacOS. (That noted, I'm not super familiar with either FF's or Chrome's text shaping stack, so I have no idea whether it means FF asks the OS to render the text and Chrome uses its own shaping, or whether something else is at play)
I believe Chrome embeds a copy of Freetype, and uses it to handle fonts that the OS rasterizer doesn't support. I haven't looked to see if they take that codepath for CFF2 on macOS, but it seems at least a possibility.
| Reporter | ||
Comment 11•6 years ago
|
||
My goodness, you're right. Both macbooks were using stable rather than nightly. Making sure to actually be in Nightly, I get the same platform error, rather than OTS error.
Would it make sense for me to file a separate issue for getting CFF2 support to not rely on the OS for pre-Catalina versions of macos?
Comment 12•6 years ago
|
||
I suppose so, although I'm a bit doubtful it will get implemented. (Resource constraints, priorities, etc...) Do CFF2 fonts work in Safari on pre-Catalina?
| Reporter | ||
Comment 13•6 years ago
|
||
Safari doesn't, no. However, Chrome 100% does, and FF for Windows does, too, so making FF support this on "any macos" is probably worth it just to make sure there isn't this weird outlier.
Comment 14•6 years ago
|
||
jfkthame: Sounds like we can close this as invalid and file the follow-up bug for CFF2 support?
Comment 15•6 years ago
|
||
Sure. I filed bug 1598072.
Description
•