fonttools / fontbakery

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

New check: Overlapping components that don't have to be #4593

Closed davelab6 closed 6 months ago

davelab6 commented 6 months ago

I heard about an issue with the Google Sans tt ligature glyph rendering on Android, where there is an expected perfect pixel alignment of the crossbar, and yet it doesn't render that way:

tt ligature pixel unalignment

Looking at the roman TTFs in https://www.axis-praxis.org/samsa/ I see:

GS tt

The crossbar of the ligature is made of 2 overlapping components, and this creates some double-printing fringe effect, somehow.

Yet, since it is possible to 'transform' components, I propose removing one rectangle and stretching the other to have the same area and position as the previous combination. This should produce zero change in ink in most scenarios, and remove the fringe.

And that situation seems like something it should be possible to write a generic checker for - where components overlap and where a single component could do instead :) @simoncozens do you see a straightforward way to do this? :)

simoncozens commented 6 months ago

I think this isn't going to happen. In this case, the crossbars are not made up of two overlapping components - the two crossbars are made up of different contours from each of two different component glyphs. And so it would not be possible to stretch either component to make a long crossbar, without distorting the t forms.

And even if it were possible, in general, searching through all the components to find a transformation matrix of one which creates the same visual appearance of two components overlapped would be... well, it would be easier to fix the rasteriser.