belluzj / fantasque-sans

A font family with a great monospaced variant for programmers.
http://openfontlibrary.org/en/font/fantasque-sans-mono
SIL Open Font License 1.1
6.97k stars 154 forks source link

fontlint likes 1.8.0 less than 1.7.2: ‘ERROR 9 Bad glyph name’ #119

Closed nckx closed 4 years ago

nckx commented 4 years ago

Hullo,

Thanks for this great font. While updating our GNU Guix package to 1.8.0, I noticed that `Scripts/validate-font’ now complains (in red no less) that

Error in FantasqueSansMono-Italic.
Font FantasqueSansMono-Italic.sfd is not valid

It does the same for other files. bitmask is 0x200 (Invalid glyph name).

Manually running fontlint …/share/fonts/truetype/FantasqueSansMono-Italic.ttf reveals an error that wasn't there in 1.7.2:

The glyph named tilde is mapped to U+007E.
But its name indicates it should be mapped to U+02DC.
ERROR      9 Bad glyph name

I know literally nothing about fonts or how to build them, but I suspect that it has something to do with this part of this commit.

belluzj commented 4 years ago

Hello, I'm the one responsible for those errors :)

Can anyone reproduce this?

Yes, I introduced them in the latest release

Is this a serious error? Is it likely to cause errors, or wrong or missing glyphs, in practice?

Not really, I also wrote the script that reports those errors (and made them red!), and was too lazy to silence this new error that I don't consider to be a real one. Basically the ligatures are built automatically from parsing the glyph names (e.g. tilde_tilde.liga generates code to replace two tilde by the long wavy line of tilde_tilde.liga). Because those ligature names get long as more glyphs are part of them, and because there's also some arbitrary limitation on the length of glyph names, I thought I could get away with renaming "asciitilde" (too long) to "tilde" (shorter) but apparently not. Anyway, the tilde glyph still works, the ligature also works. Maybe what is broken now is something like copy-pasting a tilde from a PDF made with this font, but I haven't tried it so maybe even that still works. A better build system would be able to rename the tilde automatically to the correct name, or would allow me to name ligature glyphs with as many characters as I want, since computers are supposed to help humans and not the other way round.

These big red errors didn't halt the build. Should they?

No otherwise there wouldn't be a new release! :D sorry it's a terrible reason but I don't have the energy to devise a proper fix.

Regardless, would it be possible to display more & better information when they occur? I had to manually add print(bitmask) to Scripts/validate-font, Web-search the fontforge Python binding documentation to find out what bit 512 actually meant, and discovered fontlint largely by accident. ‘Fun’, but only once. :-)

I don't think I will introduce any improvements to the build system of this font. It's currently some terrible mess that I came up with when I knew nothing about fonts and some nicer bits that I adapted from the Monoid project. If anything I should drop most of the current build system to replace it with fontmake, but that's too much effort for what is currently for me a side project. At most I can make those errors not red if that's currently too frightening.

nckx commented 4 years ago

Thank you for taking the time to answer my questions so clearly, @belluzj! I really appreciate you explaining why, and not just that, this isn't a big deal. I'm sorry it took me so long to reply.

At most I can make those errors not red if that's currently too frightening.

Oh no. I don't blame you for not wasting energy on a build system that's still ‘good enough’. I was just worried about breaking someone else's documents by packaging this update.