-
Notifications
You must be signed in to change notification settings - Fork 475
[subset] EOT requires name entries for 3, 4, 5, 6 #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
That's in addition to 1 and 2 I hear. Also, only happens with IE 10 and before I hear. |
Missing PostScript names break some Java-related platforms. Also, dropping copyright and license info has hairy legal implications. |
From Pomax to me in another thread: Pomax As pointed out, it turns out the "name" table is incomplete as far as Windows is concerned the way I was building (using only IDs 1, 2, 4, and 5). While the Microsoft Font Validator does not flag any issues with it, not even a warning that the name table might be missing values necessary by Windows, the font must list the following name table entries for it to be installable: 1: the regular font name The highly amusing part is that while 4 and 5 are required for passing Font Validator (which, while no longer maintained, is still pretty accurate when it comes to "windows is going to die on this font" issues. usually), they turn out to be utterly irrelevant for previewing and/or installation in Windows, whereas 3 and 6 are critical. Which is a bit odd because the combination of id 1 and 2 is supposed to already be unique (otherwise it will do an override of a preexisting font when it gets installed), so you'd imagine 3 to be entirely optional. It's not. Similary, 6 is "useful" but practically doesn't matter: there is no different behaviour in Windows when trying to install an older font on top of a newer font. They don't get to happily goexist, the installed one gets the boot in favour of the new one, even if that's an older version. Repeating these tests in OSX, all six NameID records are necessary font the font installable. And even then, FontBook will signal a warning (but not an error) about the hhea table being funny for my font. Unfortunately, it then tells you absolutely nothing about why it thinks that, and if you mark the font with a little check, you get to install it anyway, at which point it's in the right place in the filesystem, but FontBook won't actually show the font in its list of installed fonts... So, in OSX it turns out that installation is not quite the same as installation, and is more a checked file system operation. I haven't quite figured out what needs to happen for the font to also show up in FontBook after installing, but at this point I have NameIDs 0, 1, 2, 3, 4, 5, 6, 7 and 13 included, and the font is still missing after installation. For browsers, it appears that simply having NameIDs 1 and 2 is enough. The font will happily be loaded in Chrome,Firefox, and IE11. I assume this is because the other records are simply never used in a webcontext, with the external name and style coming from the CSS @font-face rules rather than the font itself. |
To load a font in Java NameID 4 is required. Without it, it crashes with the following exception when trying to createFont() from the ttf file. NotoSansSymbols-Regular-Subsetted.ttf and AndroidEmoji.ttf are missing this NameID. java.awt.FontFormatException: Font name not found at sun.font.TrueTypeFont.init(TrueTypeFont.java:562) at sun.font.TrueTypeFont.(TrueTypeFont.java:191) at sun.font.SunFontManager.createFont2D(SunFontManager.java:2460) at java.awt.Font.(Font.java:614) at java.awt.Font.createFont(Font.java:1055) |
subsetter now keeps all entries from 0 to 6 inclusive, so this should now be fixed |
Not sure if I want to add those by default.
The text was updated successfully, but these errors were encountered: