- This topic has 14 replies, 2 voices, and was last updated 1 year, 5 months ago by
David.
-
AuthorPosts
-
March 6, 2019 at 10:01 pm #831258
Xiaowei
Would setting all font to “System stack” in Typography do?
GeneratePress 2.2.2March 7, 2019 at 1:28 am #831372David
StaffCustomer SupportHi there,
yes that would work. Customizer fonts are only loaded if they are selected.
If you wanted to completely remove them so they don’t even show in the customizer then read here:
https://docs.generatepress.com/article/remove-google-fonts/
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 7, 2019 at 2:54 am #831457Xiaowei
Thanks. What does “inherit” mean in typography settings?
March 7, 2019 at 2:58 am #831463David
StaffCustomer SupportInherit means to use the font from the parent container.
So if the body font is set to Times New Roman. And the headings are set to Inherit they will also be Times New Roman.
If you set the Body font to Inherit then it will use the root font which is set by the users browser. Similar to using System Stack fonts.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 7, 2019 at 2:59 am #831466Xiaowei
which in the Typography settings is the global font? Previously I set “body” type to be “System Stack” and left all others as “inherit”, observing network tab in chrome dev tools I still saw a request to google fonts.
You code works though. thanks. Now that request disappears.
March 7, 2019 at 3:12 am #831473David
StaffCustomer SupportOdd it should only call googles font if a font is requested.
At least the code eliminates that issue entirely. Let is know if you have any issues.Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 7, 2019 at 3:28 am #831479Xiaowei
Sure,thanks.
March 7, 2019 at 3:35 am #831485David
StaffCustomer SupportYou’re welcome
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/March 7, 2019 at 11:57 pm #832514Xiaowei
March 7, 2019 at 11:58 pm #832517Xiaowei
My site’s in China, google services isn’t fluent there, so this is kinda important. I’m willing to do dirty hacks as long as I know how … 🙂
March 8, 2019 at 12:45 am #832531Xiaowei
When I hit theme customization, I got lots of PHP Warnings:
[Fri Mar 08 16:44:07.230791 2019] [proxy_fcgi:error] [pid 16816:tid 140549776467712] [client 47.74.63.77:42096] AH01071: Got error 'PHP message: PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/54wzj/wp-content/plugins/gp-premium/typography/functions/migration.php on line 166\nPHP message: PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/54wzj/wp-content/plugins/gp-premium/typography/functions/migration.php on line 166\nPHP message: PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/54wzj/wp-content/plugins/gp-premium/typography/functions/migration.php on line 166\nPHP message: PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/54wzj/wp-content/plugins/gp-premium/typography/functions/migration.php on line 166\nPHP message: PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/54wzj/wp-content/plugins/gp-premium/typography/functions/migration.php on line 166\nPHP message: PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/54wzj/wp-content/plugins/gp-premium/typography/functions/migration.php on line 166\nPHP message: PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/54wzj/wp-content/plugins/gp-premium/typography/functions/migration.php on line 166\nPHP message: PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/54wzj/wp-content/plugins/gp-premium/typography/functions/migration.php on line 166\nPHP message: PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/54wzj/wp-content/plugins/gp-premium/typography/functions/migration.php on line 166\nPHP message: PHP Warning: array_key_exists() expects parameter 2 to be array, boolean given in /var/www/54wzj/wp-content/plugins/gp-premium/typography/functions/migration.php on line 185\n'
March 8, 2019 at 1:26 am #832552Xiaowei
That’s caused by this hook:
add_action( 'admin_init', 'wzj_remove_google_fonts_from_admin' ); function wzj_remove_google_fonts_from_admin() { add_filter( 'generate_google_fonts_array', '__return_false' ); }
and the request to google fonts turns out to be admin specific.
March 8, 2019 at 4:35 am #832666David
StaffCustomer SupportIn the above article there are the two codes. The first removes the enqueue of the fonts, the second removes them from the Customizer list hence they are Admin specific.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/September 23, 2021 at 11:58 pm #1941145Sascha
Due to GDPR it would be very useful if GP provides a simple “disable all google fonts” button in Customizer or anywhere else. I have tried many workarounds and the above mentioned code snippets, but Google fonts are still being loaded on my clients site
It would be even better, if GP allows us to choose a google font, then download it so that these google fonts will be served locally.
Any chance to implement such feature?
September 24, 2021 at 5:27 am #1941360David
StaffCustomer SupportHi there,
GP only makes Google Font requests you have selected in the Customizer > Typography settings.
If there are no google fonts selected then GP will not make any requests for them.On your client site i see 2x google fonts being requested in this link:
<link rel='stylesheet' id='wpgb-fonts-css' href='https://fonts.googleapis.com/css?family=Varela%20Round%3Aregular%7CRoboto%3A300' media='all' />
Which looks like its coming from the WP Grid Builder plugin.
Regarding Local fonts, we have plans to add this in GPP 2.2 – we have already done the ground work in GP 3.1 and GPP 2.2 ( currently in alpha/beta testing ).
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.