Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #847876

    Hi,

    Something weird happend to my Enfold website. It has been online for some time and out of nowhere the Google font I used (Josefin Sans) changed. Normally the tekst was thin and the strong was bold now everything is the same bold size in chrome. Also everything appeard bigger.

    I read online that Google changed it fonts overnight for no apparent reason and the you can sort of revert the changes so it renders correctly in chrome: https://stackoverflow.com/questions/45977713/google-font-josefin-changed-overnight-how-use-an-alternative

    They offer a solution of changing the way you add @import Google in css files but since this is not the way you add fonts in Enfold i am wondering if you can help me revert the website back to normal. I added the fonts like this in the functions file:

    add_filter( ‘avf_google_content_font’, ‘avia_add_content_font’);
    function avia_add_content_font($fonts)
    {
    $fonts[‘Cookie’] = ‘Cookie:400,700,400italic,700italic’;
    $fonts[‘Cookie’] = ‘Cookie:400,700’;
    $fonts[‘Josefin Sans’] = ‘Josefin Sans:400,700’;
    $fonts[‘Josefin Sans’] = ‘Josefin Sans:400,700,400italic,700italic’;
    return $fonts;
    }

    Any help on this mysterious problem would be greatly appreciated!

    #848851

    Hey vonwelzen,

    I am sorry but I could not understand the issue.
    If the font has been removed, why not change the font from the Theme Settings?

    Best regards,
    Basilis

    #848861

    Hi Ballis, the font is not removed it has changed.

    So now all fonts are thicker i want to revert back to other thickness but font-weight doesnt apply so i have to add the josefin sans font again with different font-weights but i dont’t know how to add it. Hope this makes more sense :)

    This shows my problem: https://forum.blocsapp.com/t/stumped-about-josefin-sans-and-recent-weight-change/1848

    I tried adding different font weights llike this:

    add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Cookie'] = 'Cookie:400,700';
    $fonts['Cookie'] = 'Cookie:400,700,400italic,700italic';
    $fonts['Josefin Sans'] = 'Josefin Sans:300,200,100,400,500,600,700';
    $fonts['Josefin Sans'] = 'Josefin Sans:400,700,400italic,700italic';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font', 'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    
    $fonts['Cookie'] = 'Cookie:200,400,700,400italic,700italic';
    $fonts['Cookie'] = 'Cookie:200,400,700';
    $fonts['Josefin Sans'] = 'Josefin Sans:300,200,100,400,500,600,700';
    $fonts['Josefin Sans'] = 'Josefin Sans:400,700,400italic,700italic';
    return $fonts;
    }

    But during inspect it looks like it only loads 2 font weights.

    //fonts.googleapis.com/css?family=Cookie:400,700,400italic,700italic%7CJosefin+Sans:400,700,400italic,700italic

    • This reply was modified 7 years, 2 months ago by vonwelzen.
    #849805

    Hi,

    Please replace the filter with the following.

    add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Josefin Sans New'] = 'Josefin Sans:100,100i,300,300i,400,400i,600,600i,700,700i&subset=latin-ext';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font', 'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    
    $fonts['Google fonts']['Josefin Sans New'] = 'Josefin Sans:100,100i,300,300i,400,400i,600,600i,700,700i&subset=latin-ext';
    return $fonts;
    }
    

    Go to the General Styling > Font panel and then re-select “Josefin Sans New” at the very bottom of the font selection.

    The Cookie font has “400” as the only available font weight. I’m sorry but we can’t do anything about it.

    Best regards,
    Ismael

    #849970

    Thanks a lot Ismael this worked perfect. I know Cookie only has one font weight but I need to select it for the headings. How do I add cookie for the headings? I tried the code below and it shows perfect in backend but on front-end it takes helvetica replacement font. Any idea?

    add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
    $fonts['Cookie'] = 'Cookie:400,700';
    return $fonts;
    }
    
    add_filter( 'avf_google_content_font', 'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    
    $fonts['Google fonts']['Josefin Sans New'] = 'Josefin Sans:100,100i,300,300i,400,400i,600,600i,700,700i&subset=latin-ext';
    return $fonts;
    }
    #850764

    Hi,

    Please replace the “avf_google_heading_font” with this.

    add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
       $fonts['Cookie'] = 'Cookie:400';
       return $fonts;
    }

    You should see the font at the very bottom of the selection.

    Best regards,
    Ismael

    #851045

    Hi Ismael, thanks for the code but I can’t get it to work. When I pasted the code in a demo site i have running also with enfold and I can select Cookie for headings and josefin sans for tekst and it show correct in the example (see screen 1).

    But when I saved the styling it changes to Arial for tekst and also on the front end cookie is not the heading text (see screen 2 & 3).

    screen1: https://imgur.com/GXZtZXC
    screen2: https://imgur.com/NZdt3iu
    screen3: https://imgur.com/uuqSpAg

    This is the code I use:

    add_filter( 'avf_google_heading_font', 'avia_add_heading_font');
    function avia_add_heading_font($fonts)
    {
       $fonts['Cookie'] = 'Cookie:400';
       return $fonts;
    }
    
    add_filter( 'avf_google_content_font', 'avia_add_content_font');
    function avia_add_content_font($fonts)
    {
    
    $fonts['Google fonts']['Josefin Sans New'] = 'Josefin Sans:100,100i,300,300i,400,400i,600,600i,700,700i&subset=latin-ext';
    return $fonts;
    }
    #851402

    Hi,

    It is working properly on our installation. Did you install a cache plugin or minify the stylesheets/scripts? Disable those temporarily, remove browser cache then hard refresh the page.

    Best regards,
    Ismael

    #856890

    Yes you were correct i think it was a caching issue Thannks!

    #857284

    Hi,

    Great! Let us know if you need anything else.

    Best regards,
    Ismael

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘Font change without any changes made to the website’ is closed to new replies.