Fix for some issues on Windows (hinting, and font naming in some programs)
(nb I don’t know 100% what I’m doing here, so I’d love to hear from someone who knows this stuff what is actually going on here)
This PR contains two commits to fix some weird issues I am seeing on Windows 11.
Chinese glyphs in TTF and OTF thumbnails
This stops happening if you remove CJK from the OS/2 charsets. For that I added explicit entries in all the fonts.props files.
GIMP fails to use some fonts
The unadorned versions show the 08 weight. I don't know why the italic thumbnail is blank but that variant works. The #1 variants don't work.
I suspect some apps don’t tolerate anything else than the usual "Bold" or "Italic" styles in style names. So I changed the TTF names so the "08" and "12" becomes part of the font family name. This seems not ideal but at least I can use all the fonts now.
So for that I edited the LangName entries like this:
-LangName: 1033 ... ... ... "" "EB Garamond" "08 Regular" "EB Garamond 08 Regular"
+LangName: 1033 ... ... ... "" "EB Garamond 08" "Regular" "EB Garamond 08 Regular"
Hinting
A picture says more than a 1000 words. This is what I got on Windows 11 :worried:
TTF on the left, OTF on the right.
So it took some experimentation to figure out that:
- I have to write the opentype tables to get ligatures. (Note the word ‘officia’ in the last line)
- If a TTF file contains opentype tables it sort of counts as an opentype font file. This is important because…
- It seems
ttfautohintdoes not affect opentype font files. - Opentype in particular looks terrible if any hinting information is in the file. So the modified build scripts writes OTF files without hinting information.
- I don’t know the default flags used in
font.generate()if you don’t give it a flags argument. But be advised if you specify it at all, by default you do not get opentype tables in your font unless you use the "opentype" flag. - This commit modifies the TTF files to be plain TTF. Note the lack of ligatures so it is possibly a bad idea to make this change. But this means that
ttfautohintactually works. It was instructed to use the “slight”, or “natural” hinting.
Do not install the OTF and TTF versions of fonts at the same time. The duplicate name conflicts cause unexpected results.
I only install the OTF versions. The screenshot is the build folder.