googlefonts / fontdiff

tool for finding visual differences between two font versions
Other
135 stars 29 forks source link

Hinting changes in CFF #23

Open jenskutilek opened 7 years ago

jenskutilek commented 7 years ago

Is there anything special I need to do to detect hinting changes in OpenType-CFF fonts?

I have two versions of a font with differences that are due to a change in the BlueFuzz value, which are clearly visible in DirectWrite and Adobe InDesign rendering. Yet fontdiff sees the fonts as identical.

I expected the FreeType CFF rasterizer to show these differences, as InDesign does show them.

chrissimpkins commented 6 years ago

Does anyone know the answer to this question?

anthrotype commented 6 years ago

fontdiff seems to be loading fonts without hinting:

https://github.com/googlei18n/fontdiff/blob/2c226d5d2b5eccd070d6aa53e2c19152fbfa7929/src/fontdiff/font.cc#L109-L112

https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_LOAD_NO_HINTING

I guess it could be possible to add an option to enable/disable the hinting by passing a different FT_LOAD_* flag.

brawer commented 6 years ago

Should we always use hinting, so that the tool stays simple to use?

anthrotype commented 6 years ago

maybe use the same default that freetypes uses. but it would indeed be very useful to be able to render with, e.g., forced-runtime-autohinting mode, no hinting, different rendering modes (LCD, greyscale), etc.

anthrotype commented 6 years ago

you could even read from an environment variable, if it's present.

chrissimpkins commented 6 years ago

I believe that FreeType permits renders with builtin autohinter only (forced) as well as with font specified hinting as default when specified. It would be helpful to us to be able to view the latter.

chrissimpkins commented 6 years ago

Werner has this mapped to the following options in his ftgrid tool (part of the FreeType2 demos source):

r4n2b-image

This source may point to an approach for implementation if it is something that you are interested in supporting here.