Google Fonts – Variable Weights?

Not specific to the beta, but I noticed that Google Fonts has added a number of variable fonts to fonts.google.com. But they’re not showing up when I go into the Font Manager.

For example, Geologica

image

Any chance we could get support for these at some point? Or is there a setting somewhere already?

2 Likes

This one is new to our list. As well as a couple of others. I will update this in a release next week. Have a great day!

3 Likes

Thanks @charlie!

1 Like

Same thing with Noto Serif. Lots of weights available via Google but only two weights inside Pro.

1 Like

The updated Gfonts list is out now! I checked and the other font weights are added to Noto Serif in this update.

1 Like

That took around 16 minutes to fix. Great job - I’ll expect all fixes in 16 mins or less from now on :wink:

3 Likes

Haha, maybe some day with AI :man_shrugging:t2:

1 Like

H!

I tired to add these two Google fonts, but they were not on the list:

https://fonts.google.com/specimen/Zalando+Sans
https://fonts.google.com/specimen/Zalando+Sans+Expanded

I enqueued them by code, because adding them manually in the UI wasn’t working.

I asked Claude Code to investigate. It found this. I have no idea if that is the actual problem, but it might help. :slight_smile:


Found two related bugs while adding custom Google Fonts via the cs_font_data filter (fonts not yet in Cornerstone’s bundled list).

Environment: Pro theme (latest), PHP 8.2, WordPress 6.9.2

Bug 1: PHP warnings when uploading custom fonts via UI

Uploading fonts through Globals > Fonts > Custom Fonts produces repeated PHP warnings:

PHP Warning: Undefined array key "_id" in .../Services/GlobalFonts.php on line 437

locateCustomItem() iterates customFontItems and accesses $value['_id'] directly. The auto-fix at lines 184-186 generates missing _id values, but it doesn’t always execute before locateCustomItem() is called.

Suggested fix:

// Line 437 - add isset() check
if (isset($value['_id']) && $id === $value['_id']) {

Bug 2: cs_font_data filter doesn’t affect the editor font picker

Adding fonts via the documented cs_font_data filter works for frontend resolution but the fonts never appear in the Cornerstone editor font picker.

Root cause: font_data() caches its result in $this->data on line 60. The filter output includes third-party additions, but the cache does not. When font_data_with_load_items() (used by cs_app_font_data for the editor) calls font_data() , it gets the cached array without the filtered additions.

Workaround: Hook into both filters:

add_filter( 'cs_font_data', 'my_custom_fonts' );
add_filter( 'cs_app_font_data', 'my_custom_fonts' );

Suggested fix: Either cache the filtered result instead of the raw merge, or document that developers must hook into both cs_font_data and cs_app_font_data .

Hope these help.