Load Google Font with asynchronously or deferred without Font Face Observer

You can load the web fonts asynchronously with this script: <script> WebFontConfig = { typekit: { id: ‘xxxxxx’ } }; (function(d) { var wf = d.createElement(‘script’), s = d.scripts[0]; wf.src=”https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js”; wf.async = true; s.parentNode.insertBefore(wf, s); })(document); </script> You’ll need this library, it’s pretty easy to implement. I’ve learn this from a course I took recently, … Read more

How to use font-family lato? [closed]

Please put this code in head section <link href=”https://fonts.googleapis.com/css?family=Lato:400,700″ rel=”stylesheet” type=”text/css”> and use font-family: ‘Lato’, sans-serif; in your css. For example: h1 { font-family: ‘Lato’, sans-serif; font-weight: 400; } Or you can use manually also Generate .ttf font from fontSquiral and can try this option @font-face { font-family: “Lato”; src: url(‘698242188-Lato-Bla.eot’); src: url(‘698242188-Lato-Bla.eot?#iefix’) format(’embedded-opentype’), url(‘698242188-Lato-Bla.svg#Lato … Read more

Google Fonts violates Content Security Policy

There are two things to fix here: Use https for the Google fonts link (https://fonts.googleapis.com/css?family=Whatever) Authorize https://fonts.googleapis.com in style-src directive and https://fonts.gstatic.com in font-src directive: “style-src ‘self’ https://fonts.googleapis.com; font-src ‘self’ https://fonts.gstatic.com”

How to use Google fonts in React.js?

In some sort of main or first loading CSS file, just do: @import url(‘https://fonts.googleapis.com/css?family=Source+Sans+Pro:regular,bold,italic&subset=latin,latin-ext’); You don’t need to wrap in any sort of @font-face, etc. the response you get back from Google’s API is ready to go and lets you use font families like normal. Then in your main React app JavaScript, at the top … Read more

How to host google web fonts on my own server?

Please keep in mind that my answer has aged a lot. There are other more technically sophisticated answers below, e.g.: neverpanic/google-font-download google-webfont-helper localfont so don’t let the fact that this is the currently accepted answer give you the impression that this is still the best one. You can also now also download google’s entire font … Read more