Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #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

    #1340515

    Hey 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):

    https://github.com/KriesiMedia/enfold-library/blob/master/temp_fixes/Enfold_4_8_9_1/framework/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ünter

    #1340543

    Hey Gunter,

    Fantastic, thanks for implementing that, I look forward to trying it in 4.9 when it is released

    Regards

    Tim

    #1340882

    Hi,

    Have a great day. I will close this topic for now.

    Best regards,
    Günter

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Enfold & font:display’ is closed to new replies.