fontello / svg2ttf

SVG -> TTF font convertor
MIT License
518 stars 79 forks source link

A way to toggle OS/2 fsSelection useTypoMetrics bit. #95

Closed Malolan-Balaji closed 4 years ago

Malolan-Balaji commented 4 years ago

Feature description Since using TypoMetrics is strongly suggested for windows apps for calculating ascent and descent. and by default this is turned off. To turn it on we need to manually set the 7th bit in os2.fsSelection attribute (uint16 type) https://docs.microsoft.com/en-us/typography/opentype/spec/os2#fsselection https://glyphsapp.com/tutorials/vertical-metrics

Solution: An option called 'useTypo' or 'useTypoMetrics' should be passed from cli or the package consumer. On being true, we explicitly set the 7th bit in font.fsSelection attribute. (if false or undefined, nothing will break)

Use cases If set, it is strongly recommended that applications use OS/2.sTypoAscender - OS/2.sTypoDescender + OS/2.sTypoLineGap as the default line spacing for this font.

This'll fix issues where font-icons are properly rendered in Mac/Linux but not in windows

puzrin commented 4 years ago

Thank you for detailed description. This should be fixed by #82.

Now USE_TYPO_METRICS bit is set. No option to toggle, because i think there is no need to reset it. Option can be added later upon request.