Wait for fonts to load before rendering web page

后端 未结 11 1344
终归单人心
终归单人心 2020-11-27 15:38

I\'m using @font-face to embed fonts in my website. First the text renders as the system default, and then (once the font file has loaded presumably) the correct font render

11条回答
  •  北海茫月
    2020-11-27 15:58

    Since nobody mentioned that, I believe this question needs an update. The way I managed to solve the problem was using the "preload" option supported by modern browsers.

    In case someone does not need to support old browsers.

    
    

    some useful links with more details:

    https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content http://www.bramstein.com/writing/preload-hints-for-web-fonts.html

提交回复
热议问题