Site logo

[Resolved] Uploading Custom Fonts

Home Forums Support [Resolved] Uploading Custom Fonts

Home Forums Support Uploading Custom Fonts

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #2411655
    Vladimir

    Hi,

    I have custom fonts sent to me as .zip file. They were licensed from some 3rd party.

    Where in the Interface do I upload such custom fonts and do I upload them as zip file, or I have to unzip them first and upload them then?

    Vlad

    #2411707
    Leo
    Staff
    Customer Support

    Hi there,

    Follow the instructions here:
    https://docs.generatepress.com/article/adding-local-fonts/

    #2411758
    Vladimir

    I followed instructions and added extra snippet to allow font uploads to Media by adding this code to new snippet.

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

    But when I try to upload .ttf file, it does not allow me to upload despite the the function. Here is the error message I get.

    “Antenna Regular.ttf” has failed to upload.
    Sorry, you are not allowed to upload this file type.

    Are there any other ways to get that .ttf file into the website?

    #2412343
    David
    Staff
    Customer Support

    Hi there,

    do you have .woff and .woff2 copies of the font ?
    If so just use those – as they are supported by all modern browsers so the TTF isn’t required.

    #2415326
    Vladimir

    Great advice on .woff font types. Thank you. Closing ticket.

    #2416076
    David
    Staff
    Customer Support

    Glad to be of help!

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