I
I
iminby2016-10-24 13:45:12
css
iminby, 2016-10-24 13:45:12

Is what is happening with fonts normal?

Let me know if this is okay.
I connected my font on the site, when the browser loads, you can see a simple font, as I understand it, the browser's default font, literally a split second, while the page is loading ...
Then, accordingly, my font is loaded .. and everything is ok.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Gavrilenko, 2016-10-24
@Maddox

Yes, good. This is the rendering process.
You can use this simple script. Then the font change will not be noticeable

(function(){
  // if firefox 3.5+, hide content till load (or 3 seconds) to prevent FOUT
  var d = document, e = d.documentElement, s = d.createElement('style');
  if (e.style.MozTransform === ''){ // gecko 1.9.1 inference
    s.textContent = 'body{visibility:hidden}';
    var r = document.getElementsByTagName('script')[0];
    r.parentNode.insertBefore(s, r);
    function f(){ s.parentNode && s.parentNode.removeChild(s); }
    addEventListener('load',f,false);
    setTimeout(f,3000);
  }
})();

// a nice improvement to this script is to only hide the elements using webfonts 
// with visibility:hidden instead of the entire <body>
// that's up to you to select them in that textContent line, though

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question