Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add font-face support #18

Closed
KyleAMathews opened this issue May 8, 2015 · 5 comments
Closed

Add font-face support #18

KyleAMathews opened this issue May 8, 2015 · 5 comments

Comments

@KyleAMathews
Copy link
Owner

Add an array of objects each specifying the font-face rule e.g.

{
  fontFamily: "DinNextRounded",
  src: [
    "url(../fonts/dinnnextrounded_bold.eot)",
    "url(..'fonts/dinnextrounded_bold.woff)"
  ],
  fontWeight: 700
}
@arthurvi
Copy link

arthurvi commented Sep 13, 2017

@KyleAMathews Hi, does this still work / am I using it correctly?

const typography = new Typography({
  googleFonts: [
    {
      name: 'Bitter',
      styles: ['400', '400i', '700']
    }
  ],
  fontFaces: [
    {
      fontFamily: 'Fun Font',
      fontWeight: 400,
      src: ['url(../fonts/fun-font.woff)']
    }
  ],
  includeNormalize: true,
  headerFontFamily: ['Bitter'],
  bodyFontFamily: ['Fun Font']
});

The above sadly does not work. Thanks!

@KyleAMathews
Copy link
Owner Author

Nope, removed it as decided it was a bad fit for the library.

@arthurvi
Copy link

Ah bummer, Thanks though! Any advice where I can look to use a local font (not open) in Gatsby?

@jayalfredprufrock
Copy link

I'm surprised that was removed but google font support wasn't. It looks like you need to have a global stylesheet containing the font-face definitions just to facilitate using a custom local font which is a shame considering Typography.js + styled-components seems to eliminate the need for a global stylesheet otherwise. Hope you consider bringing it back at some point, or perhaps moving it and google font support into a plugin or something.

@sergeylukin
Copy link

What's the current status of using custom font-face? Is google web fonts the only support built-in option?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants