- This topic has 6 replies, 4 voices, and was last updated 1 year, 5 months ago by
Jim.
-
AuthorPosts
-
June 24, 2019 at 2:24 pm #939950
Jim
In this topic, Tom said:
The only fonts GeneratePress has that require font-display are Google Fonts…
I was able to eliminate the Generatepress @font-face CSS from our Child stylesheet after turning the SVG icons on. I’ve also added the new
generate_google_font_display filter
, which seems to address Google fonts. So, thanks for that!Google Pagespeed, however, would still like to see font-display declared for GP Premium fonts. Insights still throws the warning: “Ensure text remains visible during webfont load”
I’ve addressed this for fonts being loaded by other plugins, but can’t seem to get it right for GP Premium. I have added the following to our Child CSS:
/* Plugin: GP Premium */ @font-face { font-family:'GP Premium'; font-display:swap; src:url(https://tripawds.net/wp-content/plugins/gp-premium/general/icons/gp-premium.eot); src:url(https://tripawds.net/wp-content/plugins/gp-premium/general/icons/gp-premium.eot#iefix) format('embedded-opentype'), url(https://tripawds.net/wp-content/plugins/gp-premium/general/icons/gp-premium.ttf) format('truetype'), url(https://tripawds.net/wp-content/plugins/gp-premium/general/icons/gp-premium.woff) format('woff'), url(https://tripawds.net/wp-content/plugins/gp-premium/general/icons/gp-premium.svg#gp-premium) format('svg'); font-weight:400; font-style:normal; }
It seems whatever was done for the GeneratePress font-family, also needs to be done for GP Premium. Or, I could use some help addressing the issue via Child CSS, or another function/filter…Thanks!
June 24, 2019 at 4:17 pm #940010Tom
Lead DeveloperLead DeveloperThe SVG option will be integrated into GP Premium 1.9. It was just released in 2.3, so GP Premium hasn’t quite caught up yet.
When it comes to icons, using
swap
doesn’t make much sense, as there is nothing to swap the icons with (unlike text, which can fallback to your system font).Let me know if you have any other questions ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJune 24, 2019 at 4:32 pm #940019Jim
Thanks for the heads up!
June 25, 2019 at 8:29 am #940759Tom
Lead DeveloperLead DeveloperNo problem ๐
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJuly 29, 2019 at 7:44 am #970064David
Hi Jim! I’m having the same warning from Google Pagespeed Insights. What value did you end up using for the GP Premium font? Or did you leave it as it was?
July 29, 2019 at 1:03 pm #970426David
StaffCustomer SupportHi there,
‘fallback’ would be the simplest option. Another user provides his method here:
https://generatepress.com/forums/topic/adding-font-display-to-css/#post-906253
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/July 29, 2019 at 6:16 pm #970609Jim
David Said:
Hi Jim! Iโm having the same warning from Google Pagespeed Insights. What value did you end up using…I use Swap, so text is always visible upon page load.
-
AuthorPosts
- You must be logged in to reply to this topic.