sapegin / grunt-webfont

SVG to webfont converter for Grunt
MIT License
1.1k stars 210 forks source link

Setting ascent and descent values #270

Open klsweetwood opened 9 years ago

klsweetwood commented 9 years ago

We were having issues with vertical alignment in Safari, so I looked into the ascent and descent values. Font Forge has general ascent and descent values in addition to Win Ascent/Descent, Typo Ascent/Descent/LineGap, HHead Ascent/Descent/LineGap. Mac's use the HHead values, which were incorrect and causing alignment issues.

To fix this, I set these values in generate.py: f.hhea_ascent, f.os2_winascent, f.hhea_descent, f.os2_windescent

This is not ideal since I now must use my version of generate.py and it would be better to be able to set the values in our Gruntfile.js with the rest of the options. Also, something to note with setting these values.. it does not actually reset the value, but actually adds it to the current value. My HHead Ascent was originally 1040; I needed it to be 448, so I had to set f.hhea_ascent = -592.

Would you be able to update the options to allow for setting the Win, HHead, and Typo values?