Changing Body Font-Size based on Font-Family with jQuery

后端 未结 7 2122
日久生厌
日久生厌 2020-11-28 12:11

I\'m trying to use Myriad Pro as my primary font with Arial and such as a fall-back like so:

font: 13px \"Myriad Pro\", \"Helvetica\", \"Arial\", \"sans-seri         


        
7条回答
  •  生来不讨喜
    2020-11-28 12:55

    You can't detect what font is used to render the text. The style is not changed according to what fonts are available.

    What you could do is to measure the size of an element that contains text, and from that decuce what font might be used to render the text.

    (Consider also that the user setting for font size also may affect how it's rendered.)

提交回复
热议问题