Tagged: ,

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1342183

    Hello
    due to current reports regarding GDPR and an email by complianz I decided to move Google Fonts locally.

    Lato is set to my Header and Body font. So search for it on
    https://google-webfonts-helper.herokuapp.com/fonts/lato?subsets=latin

    I created a folder under wp-content/themes/fonts and uploaded Lato 300, 400 and 700.
    In enfold-child/styles.css I added the following…

    /* lato-300 – latin */
    @font-face {
    font-family: ‘Lato’;
    font-style: normal;
    font-weight: 300;
    src: url(‘../fonts/lato-v22-latin-300.eot’); /* IE9 Compat Modes */
    src: local(”),
    url(‘../fonts/lato-v22-latin-300.eot?#iefix’) format(’embedded-opentype’), /* IE6-IE8 */
    url(‘../fonts/lato-v22-latin-300.woff2’) format(‘woff2’), /* Super Modern Browsers */
    url(‘../fonts/lato-v22-latin-300.woff’) format(‘woff’), /* Modern Browsers */
    url(‘../fonts/lato-v22-latin-300.ttf’) format(‘truetype’), /* Safari, Android, iOS */
    url(‘../fonts/lato-v22-latin-300.svg#Lato’) format(‘svg’); /* Legacy iOS */
    }
    /* lato-regular – latin */
    @font-face {
    font-family: ‘Lato’;
    font-style: normal;
    font-weight: 400;
    src: url(‘../fonts/lato-v22-latin-regular.eot’); /* IE9 Compat Modes */
    src: local(”),
    url(‘../fonts/lato-v22-latin-regular.eot?#iefix’) format(’embedded-opentype’), /* IE6-IE8 */
    url(‘../fonts/lato-v22-latin-regular.woff2’) format(‘woff2’), /* Super Modern Browsers */
    url(‘../fonts/lato-v22-latin-regular.woff’) format(‘woff’), /* Modern Browsers */
    url(‘../fonts/lato-v22-latin-regular.ttf’) format(‘truetype’), /* Safari, Android, iOS */
    url(‘../fonts/lato-v22-latin-regular.svg#Lato’) format(‘svg’); /* Legacy iOS */
    }

    It works for Lato – it is now loaded locally.
    @font-face { font-family: “Lato”; src: local(“”), url(“https://sinnvoll-fuehren.com/wp-content/themes/fonts/lato-v22-latin-regular.eot?#iefix”) format(“embedded-opentype”), url(“https://sinnvoll-fuehren.com/wp-content/themes/fonts/lato-v22-latin-regular.woff2”) format(“woff2”), url(“https://sinnvoll-fuehren.com/wp-content/themes/fonts/lato-v22-latin-regular.woff”) format(“woff”), url(“https://sinnvoll-fuehren.com/wp-content/themes/fonts/lato-v22-latin-regular.ttf”) format(“truetype”), url(“https://sinnvoll-fuehren.com/wp-content/themes/fonts/lato-v22-latin-regular.svg#Lato”) format(“svg”); font-style: normal; font-weight: 400; }

    However, Lato-Light still loads from https://fonts.gstatic.com/s/lato/v22/S6u9w4BMUTPHh7USSwiPGQ3q5d0.woff2
    @font-face { font-family: “Lato”; src: url(“https://fonts.gstatic.com/s/lato/v22/S6u9w4BMUTPHh7USSwiPGQ3q5d0.woff2”) format(“woff2”); font-style: normal; font-weight: 300; unicode-range: U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

    Why does it not work? Any hints on what I need to change?

    Cheers,
    Ralph

    PS: Shouldn’t this become a standard feature in Enfold, to host fonts locally?

    #1342221

    Hey Ralph,

    Thank you for the inquiry.

    You can actually upload Google fonts to your own server using the Enfold > Import/Export > Custom Font Manager. Please check this documentation for more info.

    // https://kriesi.at/documentation/enfold/typography/#how-to-upload-custom-fonts

    Best regards,
    Ismael

    #1342250

    Hey Ismael

    I tried that – I didn’t get this to work. I uploaded Lato zip with 300,400,700 – it only recognised 400.
    Thus I tried the other way. That works apart from Lato-Light. Thus my question – how do I get it to work?

    Cheers,
    Ralph

    #1342269

    if you only use these selfhosted fonts – you can hamper Enfold to load google fonts at all.

    this here seems to be the actual prefered snippet:

    function my_output_google_webfonts_script( $activate ){
      return false;
    }
    add_filter( 'avf_output_google_webfonts_script', 'my_output_google_webfonts_script', 10, 1 );
    • This reply was modified 2 years ago by Yigit.
    #1342271

    Dear Guenni

    Thanks for this hint.

    Strange – at first, Lato Light wasn’t loaded but it was replace by Lato normal. Then I thought I change the style for H3 explictly – Lato + 300. This didn’t look good, so I removed H3 again. Reload page and suddenly Lato Light is loaded… I’m puzzled – and it seems it works now. Maybe it was a cache problem? However, I emptied the caches. I guess I know now more where to play around with this.

    Cheers,
    Ralph

    #1342285

    Hi Ralph,

    Great, I’m glad that you got it working, it might have been caching. Please let us know if you should need any further help on the topic or if we can close it.

    Best regards,
    Rikard

    #1342521

    Hi

    On another site I got it to work in the intended way.
    May I suggest a little feature fix: when uploading a font file with several fonts in it, it would be great to see this in the Custom Font Manager. Despite that I uploaded 100, 300, 400, 700, … it only shows

    Font: lato v22 latin ( font-family: lato-v22-latin )
    normal: 400
    italic: 400

    Cheers,
    Ralph

    #1342796

    Hi,

    Thank you for the update.

    The variations should be listed properly in the font manager after uploading a font. Would you mind posting the zip file that you actually uploaded in the site? We would like to test it on our installation.

    Best regards,
    Ismael

    #1342805

    Hi Ismael

    I downloaded the font package from https://google-webfonts-helper.herokuapp.com/fonts/lato?subsets=latin
    Where do you get the fonts from?

    Link to the actual zip file is attached below.

    Thanks for testing this on your site.

    Cheers,
    Ralph

    #1342951

    Hi,

    You may need to retrieve the font directly from Google fonts instead of the third party application or site. Have you tried uploading fonts that have been downloaded directly from Google?

    // https://fonts.google.com/

    Best regards,
    Ismael

    #1342969

    Hi,

    that looks a lot better. Sorry for the discussion. Maybe add the link https://fonts.google.com/ to your documentation regarding installing own fonts?

    Cheers,
    Ralph

    #1342998
    #1343018

    Ok – I missed that. Sorry. You can close this ticket.

    Best wishes
    Ralph

    #1343023

    Hi,

    No worries at all, Ralph! Let us know if you have any other questions and enjoy the rest of your day :)

    Best regards,
    Yigit

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Localize Google Fonts’ is closed to new replies.