"Download font-family to server instead of using the Google CDN"
Issue description:
Hello, I cant seem to see this checkbox under the font family select any more. Has this feature been removed?
Cheers, Jakson
Version used:
3.0.41
Using theme_mods or options?
vanilla WP install
Code to reproduce the issue (config + field(s))
// initial Setup Kirki::add_config( 'theme_config_id', array( 'capability' => 'edit_theme_options', 'option_type' => 'theme_mod', ) );
// fields Kirki::add_field( 'theme_config_id', [ 'type' => 'typography', 'settings' => 'my_setting', 'label' => esc_html__( 'Control Label', 'kirki' ), 'section' => 'colors', 'default' => [ 'font-family' => 'Roboto', 'variant' => 'regular', 'font-size' => '14px', 'line-height' => '1.5', 'letter-spacing' => '0', 'color' => '#333333', 'text-transform' => 'none', 'text-align' => 'left', ], 'priority' => 10, 'transport' => 'auto', 'output' => [ [ 'element' => 'body', 'property' => 'font-family', ], ], ] );
Hi @JakJakson, it is now the default to download the fonts locally, so the checkbox isn't required.
No wonder I'm getting all kinds of CORS errors in Customizer on my Multisite. I've said this before. Downloading fonts should be optional, and it should be a setting to have it shown.
@bahia0019 While changing font-families in the customizer google-fonts are loaded via webfont-loader using the default google URLs, not the ones downloaded on your site. If you're getting errors while in the customizer then something else is wrong... Could you please post the errors you're getting? What is the URL throwing that error? What is the URL structure for sites on your multisite? Do you perhaps have domain-mapping enabled for that site? Any info you can share would be appreciated.
I am having a few issues right now admittedly, but I think the problem I'm having with the fonts, is fonts from other subsites on my multisite network are being called. In this example, the fonts from alfredparra.flauntsites.com are being called for deannabrock.flaunsites.com causing CORS issues. The network is setup as subdomains. Yes, domain mapping is set.
If you have some time, I'm happy to do a Zoom call to walk through things, or add you as a User.

@bahia0019 This is a bit of a weird one, and hard for me to replicate since I don't have a multisite right now - let alone one using domain mapping.
However I believe I found the issue, if you can test the solution I have in mind that would be great.
The commit is here: https://github.com/aristath/kirki/pull/2179/commits/d2588862255eca5e92405f2927a427629075bfa4
Can you try it and let me know if that fixes your issue?
The easiest way is to simply login to your site via FTP and replace the wp-content/plugins/kirki/modules/webfonts/class-kirki-modules-webfonts-embed.php file with the contents of this one:
https://raw.githubusercontent.com/aristath/kirki/d2588862255eca5e92405f2927a427629075bfa4/modules/webfonts/class-kirki-modules-webfonts-embed.php
Let me know if that works!
I think that fixed it. At least I don't see the other site being referenced. I have other issues, but I think that's an issue with WP-Ultimo's mapping (Which they're looking into). I'll keep an eye on it, and see if I spot any other weird behaviors. Appreciate your help on that!
:tada: Great. I'll release a new version with that fix now. Once v3.0.43 is released in a few minutes you can just update to that and it will be OK. :+1:
I've said this before. Downloading fonts should be optional, and it should be a setting to have it shown.
+1