Archived topic
Unable to select all weights of fonts
3 replies · Started by madmanweb on July 21, 2020
Hi.
I'm trying to customise the fonts for my site headings. I'm using Playfair Display from Google fonts.
As you can see from their font page, it comes in various weights:
https://fonts.google.com/specimen/Playfair+Display
But in GP customiser, I can only see a limited set of weights: 700 and 900.
Changing the font weight in the variant drop-down does nothing visually.
Screenshot here: https://i.imgur.com/ei1DIPh.png
Short of manually loading the fonts and adding CSS, is there any way around this problem?
(Somewhat related: when are we getting support for variable fonts?)
Hi there,
You can manually update the entry like this:
add_filter( 'generate_google_fonts_array', function( $fonts ) {
$fonts['playfair_display']['variants'] = array( '300', '400', '500' ); // Add as many as you like.
return $fonts;
} );
Our Typography system is quite dated and difficult to migrate in a backward-compatible way. Once we get GP 3.0.0 and GPP 1.11.0 released, we'll be looking at completely re-building it.
Thanks.
No problem!