didierfranc / gatsby-plugin-google-fonts

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

Support for font weights #3

Closed dlbnco closed 6 years ago

dlbnco commented 6 years ago

Is there any way to specify font weights? I'm trying to use font-weight: 900 but it seems like it's going up to just 700.

dlbnco commented 6 years ago

Got it. Just add the font weights after the font name, like:

fonts: [
   `montserrat`, `montserrat\:700`, `montserrat\:900`, `open sans`
  ]
didierfranc commented 6 years ago

Great tip !

kodepareek commented 6 years ago

Hi. How can I add the font style in the above syntax? Trying to inject Heebo into the mix and on inspecting the header I can only see that the plugin is requesting different font weights but only 1 font style - normal.

          fonts: [
            'heebo\:normal', 'heebo\:medium', 'heebo\:bold', 'heebo\:light',
          ]

This is what my gatsby config looks like.

EDIT: My bad. I realized what google font was calling the 'style' was actually the font weight. I can import it using the format above.

rohittagadiya commented 1 year ago

Got it. Just add the font weights after the font name, like:

fonts: [
   `montserrat`, `montserrat\:700`, `montserrat\:900`, `open sans`
  ]

This works for me! Thanks