[Resolved] Custom Font not Working

Home Forums Support [Resolved] Custom Font not Working

Home Forums Support Custom Font not Working

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #433529
    Amos

    Hello. i want to add custom font to load from my server…
    i read this article but it is not working.
    the name of the font (from google fonts ) “Rubik-Regular”
    this it my fonts folder inside the child theme : https://i.imgur.com/i9IKoKV.png
    my css file: https://i.imgur.com/k1jZOAi.png
    my functions: https://i.imgur.com/dF42rzz.png
    my settings: https://i.imgur.com/Z2fT65f.png

    what i am doing wrong ? Thank You.

    #433696
    Leo
    Staff
    Customer Support

    Hi there,

    For Google fonts, check this article: https://docs.generatepress.com/article/customizing-the-google-font-list/

    #433704
    Amos

    Thank leo but this is not what i need.
    i want to use the font on my server.
    i know how to add more google font to the list – this is not what i need.
    “rubik” it just an example it is not working with any font – not only google font.

    #433926
    Tom
    Lead Developer
    Lead Developer

    Hmm, what you have shown looks like it should work.

    Can you try inputing the full URL to the font file in your CSS, just to make sure file is being reached?

    #433944
    Amos

    i try to change it to this:

    @font-face {
    	font-family: 'Rubik-Regular';
    	src:url('/wp-content/themes/generatepress_child/fonts/rubik-regular.ttf')  format('truetype'),
    }
    

    but still not working…

    #434066
    Amos

    Ok i fixed this issue
    the problem was :
    i change this:
    format(‘truetype’),
    to :
    format(‘truetype’);

    and change this:
    fonts/rubik-regular.ttf’
    to :
    fonts/Rubik-Regular.ttf’

    #434103
    Leo
    Staff
    Customer Support

    Glad you found the solution!

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