Font Rendering / Line-Height Issue on Mac/PC (outside of element)

前端 未结 11 2302
-上瘾入骨i
-上瘾入骨i 2020-11-27 12:45

The Design

The info widgets content should be vertically aligned in the middle as such:

\"Original

11条回答
  •  北海茫月
    2020-11-27 13:35

    I came across this problem with a custom font that had been created for a client's brand. I opened the TTF font in Font Forge. The way I created uniformity with rendering was to adjust the values in Element->Font Info->OS/2->Metrics.

    Win Ascent/Descent values appear to work differently to the other values. I had the following values:

    Win Ascent: 1000

    Win Descent: 0

    Typo Ascent: 750

    Typo Descent: -250

    HHead Ascent: 750

    HHead Descent: -250

    I changed the Win Ascent and Descent values to:

    Win Ascent: 750

    Win Descent: 250 (notice the positive value)

    It appears you need to match the values except in my case I needed to invert the value of Win Descent to a positive one.

    I have very limited knowledge about fonts but this did fix my problem. I generated the font as TTF and then ran it through a web font generator. The fonts now render identically on Mac/Windows 7/Android/iOS.

    Hope this helps someone.

提交回复
热议问题