didierfranc / gatsby-plugin-google-fonts

Bring Google Fonts to Gatsby https://www.gatsbyjs.org/
MIT License
88 stars 18 forks source link

Support WebFontLoader #5

Closed sloria closed 6 years ago

sloria commented 6 years ago

Using WebFontLoader is the recommended way to load web fonts (see here and here).

It would be great if this plugin could inject the proper code for WebFontLoader.

jshakes commented 6 years ago

+1. The current method (<link> tag in the <head>) blocks rendering

gilesbutler commented 6 years ago

I agree it's the recommended way but something else to consider... it also has an effect on the time it takes for the page to become interactive. Plus on iOS and in some webkit browser you can get a flash of un-styled text.

Just some considerations to make before switching :)

kennedyrose commented 6 years ago

I've made a separate plugin to support async loading of fonts via webfontloader. This should take care of this request.

https://www.npmjs.com/package/gatsby-plugin-web-font-loader

didierfranc commented 6 years ago

👍