EB-Garamond icon indicating copy to clipboard operation
EB-Garamond copied to clipboard

Fix for some issues on Windows (hinting, and font naming in some programs)

Open roelandschoukens opened this issue 1 year ago • 2 comments

(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

image

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

image
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.

image

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 ttfautohint does 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 ttfautohint actually works. It was instructed to use the “slight”, or “natural” hinting.

image

roelandschoukens avatar Mar 16 '24 07:03 roelandschoukens

Do not install the OTF and TTF versions of fonts at the same time. The duplicate name conflicts cause unexpected results.

kenmcd avatar Mar 16 '24 16:03 kenmcd

I only install the OTF versions. The screenshot is the build folder.

roelandschoukens avatar Mar 16 '24 20:03 roelandschoukens