Tagged: Fonts
-
AuthorPosts
-
February 10, 2022 at 9:38 pm #1340038
Hey guys,
Sorry, another question I can’t seem to find a clear answer to.
For the longest time I thought that the setting in Theme Options > Performance “Custom Font Display Behaviour” enabled swap for fonts on the site. But reading the description more carefully, and examining code it seems clear it only affects custom fonts and icon fonts – but not the regular fonts used site wide.
So when I inspect the headers of enfold sites, I never see a font-display:swap setting. Rather I just see something like:
<link type="text/css" rel="stylesheet" href="//fonts.googleapis.com/css?family=Playfair+Display:400,700%7COpen+Sans:400,600" id="avia-google-webfont">
and looking at the CSS I can only find the font-display setting applied to the icon font.
If I am understanding this correctly, it would be really great to include the font-display settings for heading/body fonts as well (perhaps in the new typography section?)
Thanks
Tim
February 14, 2022 at 3:32 pm #1340515Hey Tim,
Thanks again. You are right.
I think it is better to use settings of “Custom Font Display Behaviour” and add it to the link for google fonts
(https://peterdaugaardrasmussen.com/2021/04/02/how-to-add-font-display-swap-to-font-from-google/):<link type="text/css" rel="stylesheet" href="//fonts.googleapis.com/css?family=Barlow:400,500,600,700%7CAlice&display=swap" id="avia-google-webfont">
Filters will allow to change it.
I uploaded a modified file that implements this solution (replace file enfold\framework\php\class-style-generator.php):
As this file is already based on 4.9 release please keep a copy of the original file for fallback (in case you see problems).
If you want to have a copy of the latest dev release let us know.Best regards,
GünterFebruary 14, 2022 at 5:11 pm #1340543Hey Gunter,
Fantastic, thanks for implementing that, I look forward to trying it in 4.9 when it is released
Regards
Tim
February 16, 2022 at 10:10 am #1340882 -
AuthorPosts
- The topic ‘Enfold & font:display’ is closed to new replies.