Site logo

[Support request] Custom Fonts – non Google

Home Forums Support [Support request] Custom Fonts – non Google

Home Forums Support Custom Fonts – non Google

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #2537065
    Justin

    Hi

    I have tried to follow the existing threads on custom fonts but don’t seem to succeed.
    I have used the code Snippets Plugin to load 2 Snippets to upload custom fonts into Media Library.

    1)
    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;
    } );

    2)
    add_filter( ‘generate_typography_default_fonts’, function( $fonts ) {
    $fonts[] = ‘EuclidSquare’;

    return $fonts;
    } );

    I have then used the Custom Fonts Plugin to set up the Regular version of the Font and then added the following CSS in the customiser CSS section

    @font-face {
    font-family: ‘EuclidSquare’;
    font-style: normal;
    font-weight: 400;
    src: url(http://staging-carebasenet-staging.kinsta.cloud/wp-content/uploads/2023/02/EuclidSquare-Regular-WebS.woff2) format(‘woff2’);

    }

    I wonder if you can help – thank you

    Justin

    #2537147
    David
    Staff
    Customer Support

    Hi there,

    in your @font-face URL make sure the URL is https and not http as the browser may block it.

    #2537728
    David
    Staff
    Customer Support

    Glad to be of help

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