jQuery working out wrong height, due to @font-face

前端 未结 3 1881
刺人心
刺人心 2021-01-04 13:14

I have a problem with jQuery and @font-face.

I need to work out the height of a

, which works fine, but then there is a small delay for the f
3条回答
  •  星月不相逢
    2021-01-04 13:56

    The Google font api looks like it works as long as you load fonts from google, typekit or ascender. But if you are using something else (e.g. another font downloaded from fontsquirrel) you might want to try something like this to figure out the font being rendered. You may also want to check out this discussion on determining the font being used Changing Body Font-Size based on Font-Family with jQuery

提交回复
热议问题