KyleAMathews / typography.js

A powerful toolkit for building websites with beautiful design
http://kyleamathews.github.io/typography.js/
MIT License
3.84k stars 182 forks source link

googleFonts specifying subset #173

Closed Shooshte closed 6 years ago

Shooshte commented 6 years ago

Did not find this mentioned anywhere in the documentation, I would like to specify a specific subset for the google fonts I am using.

I tried:

const typography = new Typography({
  baseFontSize: "16px",
  baseLineHeight: 1.4,
  scaleRatio: 2.5,
  headerFontFamily: ["Roboto"],
  bodyFontFamily: ["Roboto"],
  blockMarginBottom: 0.5,
  googleFonts: [
    {
      name: "Ubuntu",
      styles: ["400", "500", "700"],
      subset: ["latin-ext"]
    },
    {
      name: "Roboto",
      styles: ["400", "500", "700"],
      subset: ["latin-ext"]
    }
  ]
});

But nothing changes. I also tried adding it directly to styles (styles: ["400", "subset:latin-ext"]) but nothing happened as well.

Is this supported at the moment?

Thanks

Shooshte commented 6 years ago

Figured out the problem, had to add sans-serif to the font family and now everything loads as expected...