Font: poor vertical metrics cause inconsistent line-height rendering across browsers. Solution?

前端 未结 1 1881
不思量自难忘°
不思量自难忘° 2020-12-16 03:16

After hours of debugging and pottering around I found out that it is impossible to vertically align a font with poor vertical metrics consistently across browsers.

相关标签:
1条回答
  • 2020-12-16 04:02

    It took me a while, but I just found out that my font distributor lets me configure fonts before download. I was able to add "Line Height Adjustments" to the font. These were the available options:

    Line Height Adjustments

    • Best (Use the best method to normalize the line height for this font)
    • 120% (Redefine the line height as 120% of the point size)
    • Automatic (Distributes OS/2.Typo values across ascender, descender and line gap)
    • Bounding Box (Match the bounding box of the glyphs, line gap will always be 0)
    • Native (Use the line height as defined in the font, results may differ between browsers)

    The "Bounding Box" option did the trick. Now "Segoe Print" is nicely adjusted.

    Whenever I face this problem again I will either use the fontsquirrel generator for free fonts or purchase a font from a distributor that offers an option to adjust the line heights right out of the box...

    0 讨论(0)
提交回复
热议问题