fonttools / fontbakery

🧁 A font quality assurance tool for everyone
https://fontbakery.readthedocs.io
Apache License 2.0
548 stars 99 forks source link

tabular_kerning check still has issues and should remain marked as experimental for a bit longer #4640

Closed felipesanches closed 4 months ago

felipesanches commented 5 months ago

@yanone had told me this on a private message roughly a month ago:

The tabular_kerning check has some issues. I was able to address one of them, but not the other. So please keep it as experimental for the time being even if nobody else complains.

Since it was a month-old private chat message, I ended up forgetting about it and removed the experimental flag on last Friday's release of FontBakery v0.12.0. But since Yanone contacted me again on Friday to remind me about that request, I'll now re-add the experimental flag.

Yanone, please describe here in more detail what is the remaining issue to be addressed on that check, so that we keep a public record of the request (which, being assigned to v0.12.2 milestone, would be much less likely to be missed)

yanone commented 5 months ago

The check, after https://github.com/fonttools/fontbakery/pull/4579 that was recently merged, still produces some false positives for a few fonts that I wasn't yet able to get behind. They stem from the way I measure the kerning, which is a non-standard way of invoking Harfbuzz by creating a buffer of unencoded glyphs as opposed to inputting encoded characters. I just couldn't find the time and concentration yet to address it, as it's not a straight-forward fix.

felipesanches commented 5 months ago

ok, thanks

yanone commented 5 months ago

@behdad Please take a look here. Particularly the buffer_for_GIDs method might be unethical; that's what Simon helped me with. I thought that this could be responsible for the false positives.

You can run the check on Alatsi. It has a few false positives that I can't find in the font: fontbakery check-googlefonts -l FAIL -c kerning fonts/ttf/Alatsi-Regular.ttf

behdad commented 5 months ago

might be unethical

Yeah that's not kosher. You should map the GIDs to Unicode Private Area and add those to the buffer. Otherwise the GIDs get interpretted as marks and whatnot based on the Unicode property of their number.

behdad commented 5 months ago

That is, add 0xF0000 to the GID before adding to buffer, and subtract it to the nominal_glyph_func

kontur commented 4 months ago
Screenshot 2024-05-20 at 12 11 09

This still seems to throw false positives en masse for some fonts.

yanone commented 4 months ago

I need the font please to debug this.

kontur commented 4 months ago

Debug.zip

Not the font I am working on, but this trial font of the same family seems to exhibit the same categorical issue.

yanone commented 4 months ago

Thank you. I can reproduce the issue and will try to debug it.

yanone commented 4 months ago

@kontur Fixed in PR #4738, waiting for merge