googlefonts / fontdiffenator

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

Find glyph differences by comparing rendered glyphs #16

Closed m4rc1e closed 5 years ago

m4rc1e commented 6 years ago

Uses Harfbuzz to render each glyph which are then compared by counting pixel differences.

Implementation is based on https://github.com/googlei18n/nototools/blob/master/nototools/shape_diff.py

Fixes #4

@davelab6 Still wip, keep this open.

m4rc1e commented 6 years ago

We can also use hb-view for generating screenshots for each diff result. I made a quick sketch last night which produced the following output:

kerns_modified

It's around x100 faster than diffbrowsers when producing gifs which don't need require platform rendering.

@davelab6 @madig

davelab6 commented 5 years ago

@m4rc1e ready to resolve conflicts and merge?

m4rc1e commented 5 years ago

Not yet.

Implementation here is rough. It takes into account a glyph's sidebearings, we don't want this. We simply want to spot glyph outline modifications, not metrics.

m4rc1e commented 5 years ago

@davelab6 Done for now.

It still doesn't take into account if a glyph's sidebearings have been modified. However, I'm finding the current implementation of this pr useful for diffing static vs vfs since their sidebearings should be identical anyway.

chrissimpkins commented 5 years ago

This kicks ass. I love it :)

Do you happen to know if it is possible to overlay renders in transparent colors so that you can view as an overlay rather than a/b?

m4rc1e commented 5 years ago

@chrissimpkins thanks!

It doesn't but this should be pretty easy to add. I'll try and add this feat when I tackle #18

chrissimpkins commented 5 years ago

excellent! will keep an eye out for it. have wanted a way to view visualize diffs like this for some time...

m4rc1e commented 5 years ago

ping @davelab6

m4rc1e commented 5 years ago

ping @davelab6

davelab6 commented 5 years ago

🎉