UNPKG

webfontloader

Version:

Web Font Loader gives you added control when using linked fonts via @font-face.

39 lines (38 loc) 867 B
<!doctype html> <html> <head> <link href="/basic.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="/webfont.js"></script> <script type="text/javascript"> WebFont.load({ google: { families: ['Droid Sans'], api: '/fonts/api' } }); </script> <style type="text/css"> h1 { visibility: hidden; } html.wf-active h1 { visibility: visible; font-family: 'Droid Sans'; } </style> </head> <body> <h1> Hello World. I am Droid Sans. </h1> <hr> <p> <a href="#" onclick="document.getElementsByTagName('body')[0].style.color = '#fff';return false;">Hide Page</a> | <a href="/event-css-active.html">Reload Cached</a> </p> <p> The goal of this page is to use CSS to hide the headline until its font has completely rendered. </p> </body> </html>