Munter / subfont

Command line tool to optimize your webfont loading. Aggressive subsetting based on your font use, self-hosting of Google fonts and preloading
MIT License
1.56k stars 28 forks source link

Automate font style matcher fallback font fitting #48

Open Munter opened 5 years ago

Munter commented 5 years ago

Given the traced font information, implement automation of what font style matcher lets a human do.

This could be useful for future automation of injection of a fallback for system fonts that avoids font metric jumps when webfonts load late. See the technique presented in https://www.youtube.com/watch?v=tO01ul1WNW8

Possible techniques for a heuristic that can approximate the different font settings:

Maybe we should use a canvas and overlay the two fonts, like font style matcher does, then fit on the least amount of discrepancy between the font outlines, determined by the lest color difference

papandreou commented 4 years ago

Made such a thing here: https://github.com/papandreou/font-matcher

The outstanding issue is to figure out how to make a minimal set of CSS rules and exactly how to apply them until the original font(s) have loaded.