googlefonts / fontdiffenator

Font comparison tool
Apache License 2.0
80 stars 13 forks source link

Visually diff VFs #18

Open m4rc1e opened 5 years ago

m4rc1e commented 5 years ago

In #15 I added support to diff VF fonts. Technically, it doesn't diff the VF. It works by instantiating an instance using fontTools.varLib.mutator. instantiateVariableFont. I believe this isn't enough for us to be 100% confident.

I spoke to @anthrotype about some of the potential downfalls/edgecases I'm not covering. The main issues were:

  1. Text libs such as CoreText may treat variable fonts differently to statics.
  2. Each text lib will produce different results.
  3. mutatormath is not used to gen variable fonts. Statics which have used mutatormath may appear different due to the libs having different rounding algorithms. I remember banker's algo was brought up.

1 & 2 I've already investigated this for Roboto VF. I noticed that each platform produced a different result. The differences were tiny but they still may cause some docs to reflow.

galaxys8-chrome-700-roman Test simply overlayed two lines of text containing all characters. One line for vf (cyan), the other static. Fonts have 3,000+ glyphs. We can see line ends don't match which means there may be slight differences for each glyph or there's several glyphs with glaring errors.

3 I guess as the font build systems mature, they'll start conforming better.

To find these differences, we should be diffing actual renders. We already do this to find hinting differences, https://github.com/googlefonts/diffbrowsers.

davelab6 commented 5 years ago

@garretrieger heads up that @m4rc1e wants to chat with you about how to approach this :)