Sometimes, we want to dynamically load google fonts after page has loaded.
In this article, we’ll look at how to dynamically load google fonts after page has loaded.
How to dynamically load google fonts after page has loaded?
To dynamically load google fonts after page has loaded, we can add the script tag for Google web font.
Then we write:
WebFont.load({
google: {
families: ['Droid Sans', 'Droid Serif']
}
});
We call Webfont.load
with an object to specify the fonts to load.
Conclusion
To dynamically load google fonts after page has loaded, we can add the script tag for Google web font.