css different font sizes on different families

后端 未结 1 1003
误落风尘
误落风尘 2020-12-03 14:53

I have a CSS declaration like this:

font-family: font1, font2, font3;

where font1 is an embedded eot/ttf font, but the problem is that this

相关标签:
1条回答
  • 2020-12-03 15:11

    There is a way to do this, but it's as of now very badly supported. The CSS property you are looking for is font-size-adjust - a new CSS3 property introduced specifically to address this problem. The specification says:

    In situations where font fallback occurs, fallback fonts may not share the same aspect ratio as the desired font family and will thus appear less readable. The font-size-adjust property is a way to preserve the readability of text when font fallback occurs. It does this by adjusting the font-size so that the x-height is the same irregardless of the font used.

    However, it is only supported in Firefox as of now, so you might want to look for alternatives.

    For examples of how to use it, see:

    http://webdesignernotebook.com/css/the-little-known-font-size-adjust-css3-property/
    https://developer.mozilla.org/en/CSS/font-size-adjust
    http://www.fonttester.com/help/css_property/font-size-adjust.html
    http://www.w3.org/TR/css3-fonts/#relative-sizing-the-font-size-adjust-pro

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