Site logo

[Resolved] Disable Google Fonts, Upload Custom Set,

Home Forums Support [Resolved] Disable Google Fonts, Upload Custom Set,

Home Forums Support Disable Google Fonts, Upload Custom Set,

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #2230923
    sparkle

    I have a project that requires me to use local fonts, not google fonts. Since the google fonts list in the customizer has a variation of this font, I’d like to disable that completely so I’m certain to be using the local fonts.

    I’ve tried using these solutions, but the customizer still loads the google font list.
    https://docs.generatepress.com/article/remove-google-fonts/

    I’m also wondering if there are instructions for uploading multiple fonts from a folder in the child theme? The project requires six variations of IBMPlexSans (Regular, Medium Bold, Semi Bold and some Italic Variations) and I have them all in a font folder in my child theme. Do I need to create blocks like this for all six type variants? What if I’m not provided with an svg version?

    /* IBM Plex Sans - Regular */
    @font-face {
      font-family: 'IBMPlexSans';
      font-style: normal;
      font-weight: 400;
      src: url('https://www.mywebsite.com/wp-content/themes/generatepress-child/fonts/IBMPlexSans-Regular.eot'); /* IE9 Compat Modes */
      src: local(''),
           url('https://www.mywebsite.com/wp-content/themes/generatepress-child/fonts/IBMPlexSans-Regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
           url('https://www.mywebsite.com/wp-content/themes/generatepress-child/fonts/IBMPlexSans-Regular.woff2') format('woff2'), /* Super Modern Browsers */
           url('https://www.mywebsite.com/wp-content/themes/generatepress-child/fonts/IBMPlexSans-Regular.woff') format('woff'), /* Modern Browsers */
           url('https://www.mywebsite.com/wp-content/themes/generatepress-child/fonts/IBMPlexSans-Regular.ttf') format('truetype'), /* Safari, Android, iOS */
           url('https://www.mywebsite.com/wp-content/themes/generatepress-child/fonts/IBMPlexSans-Regular.svg#IBMPlexSans-Regular') format('svg'); /* Legacy iOS */
    }
    #2230929
    David
    Staff
    Customer Support

    Hi there,

    you will need to create a @font-face rule for each of the font-weight variants that you want to add.
    The actual font files you will load for each rule ( eot, woff, woff2, ttf, svg etc ) is up to you.

    For modern browsers woff and woff2 are all thats generally required so you could simply load them eg.

    /* IBM Plex Sans - Regular */
    @font-face {
      font-family: 'IBMPlexSans';
      font-style: normal;
      font-weight: 400;
      src: local(''),
           url('https://www.mywebsite.com/wp-content/themes/generatepress-child/fonts/IBMPlexSans-Regular.woff2') format('woff2'), /* Super Modern Browsers */
           url('https://www.mywebsite.com/wp-content/themes/generatepress-child/fonts/IBMPlexSans-Regular.woff') format('woff'); /* Modern Browsers */
    }
    #2231045
    sparkle

    so frustrating, because even when i use your code, i still get default fonts in the display.

    #2231083
    sparkle

    included is my code and the url in the notes area.

    #2231132
    David
    Staff
    Customer Support

    Sorry i really didn’t answer your first ( and main ) part of your question.

    When you Add Font, that Google List will always be displayed, i am not sure if there is a filter for that – i can check (?).
    But if you add a Font there and make sure the Google Font toggle is unchecked then it won’t load the font from Googles servers

    #2231139
    sparkle

    yeah, i have it toggled properly in the screenshot i sent but my fonts are still default. 🙁

    #2231186
    David
    Staff
    Customer Support

    So whats the issue ?
    Is it still making a Google font request ?

    #2231192
    sparkle

    i don’t think so? i’ve added all my fonts in my css. i’ve added all of them with the google toggle off in the customizer. i’ve set the body font to an uploaded font, but am still seeing times new roman or whatever serif font it’s defaulting to

    #2231196
    David
    Staff
    Customer Support

    Can i see the site ?

    #2231197
    sparkle

    yes. link below should work. 🙂 don’t worry about a password, the content you see is all there is.

    #2231203
    David
    Staff
    Customer Support

    Ok so customizer is doing the correct thing.
    But the fonts are 404ing.

    Can you double check that the URL in the @font-face is correct ?

    #2231216
    sparkle

    yup… seems right… screenshots attached.

    #2231234
    David
    Staff
    Customer Support

    Looks like hyphen vs underscore.

    In your @font-face you have /generatepress-child and i think it should be /generatepress_child

    #2231235
    sparkle

    oh good grief. i’m going to make your holiday bloopers reel. it’s always some symbol or another. i’m sorry. lol. thank you as always for being patient with me.

    #2231237
    David
    Staff
    Customer Support

    🙂 Glad i could be of help

Viewing 15 posts - 1 through 15 (of 15 total)
  • You must be logged in to reply to this topic.