Site logo

[Support request] Adding Local Fonts

Home Forums Support [Support request] Adding Local Fonts

Home Forums Support Adding Local Fonts

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #2509418
    Liron

    Hello GP Support,

    I am trying to add a custom local font to my website (it is not google font).

    I followed this article carefully, but it is not working correctly – https://docs.generatepress.com/article/adding-local-fonts/.

    How can I do this?

    Thank You

    #2509427
    Fernando
    Customer Support

    Hi Liron,

    Can you try adding woff and woff2 versions of the font to test?

    A site like this should help you generate them: https://www.fontsquirrel.com/tools/webfont-generator

    Try replacing the font-family name you set in the @font-face rules as well. Try setting it to cooper-std or cooperstd for instance.

    #2509444
    Sato Mori

    I have the same problem.

    It said: “BeVietnamPro-Italic.ttf” has failed to upload.
    Sorry, you are not allowed to upload this file type.”

    I also add this code to Theme function file:

    add_filter( 'upload_mimes', function( $mimes ) {
        $mimes['woff']  = 'application/x-font-woff';
        $mimes['woff2'] = 'application/x-font-woff2';
        $mimes['ttf']   = 'application/x-font-ttf';
        $mimes['svg']   = 'image/svg+xml';
        $mimes['eot']   = 'application/vnd.ms-fontobject';
    
        return $mimes;
    } );
    

    Pls help. Thanks

    #2509455
    Fernando
    Customer Support

    Hi Sato Mori,

    Try accessing your wp-config.php file through FTP then add define('ALLOW_UNFILTERED_UPLOADS', true); inside the file.

    A simple solution is to NOT bother with the .ttf and just use .woff and .woff2 as they are supported by all modern browsers.

    #2509469
    Sato Mori

    I think all of font file did not work correctly

    On dev tool, it said cant not found the font file @@

    #2509477
    Fernando
    Customer Support

    Can you open a new topic so we can address your issue there? On this topic, we’d like to focus on Liron’s issue. Your issue might not be exactly the same as Liron’s.

    #2509479
    Sato Mori

    Yes sir, Im sorry.

    #2511787
    Liron

    I have uploaded the fonts in the child theme.

    #2511871
    David
    Staff
    Customer Support

    Hi there,

    can you:

    1. Move the CSS to the top of the Customizer > Additional CSS, so it is before any other CSS.

    2. Change the font-family: 'Cooper STD'; to a word without spaces e.g font-family: 'Cooper';

    3. In your Customizer > Typography

    3.1 -> Font Manager, add: Cooper

    3.2 -> Add Typography to a element and select your Cooper font

    #2513140
    Liron

    Hello David, That worked.

    Thank You so much for your support. Appreciate it!

    #2513854
    David
    Staff
    Customer Support

    Glad to hear that!

    #2514511
    Liron

    Hey David,

    Can you please check it? Why is the custom font not loading on mobile devices?

    Thank You

    #2514597
    Ying
    Staff
    Customer Support

    I don’t see the font either on desktop or mobile, you are seeing it on desktop likely because you’ve installed the font locally on your desktop.

    Can you show us the@font-face CSS you added? Please wrap the CSS code using the CODE tags so it keeps the correct format.

    Let me know!

    #2517362
    Liron

    I can see the font when I am logged in.

    #2517367
    Liron

    Can this be a SiteGround cache and CDN Issue?

    I disabled everything from the WordPress dashboard and siteground a week ago. But just for your information.

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