Site logo

[Resolved] Local TTF font does only work in Safari

Home Forums Support [Resolved] Local TTF font does only work in Safari

Home Forums Support Local TTF font does only work in Safari

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2516971
    Stephan

    Dear GP-Team,

    I try to use a local hosted TTF font and added it with the following CCS to the Merch theme template.

    @font-face {
        font-family: 'Creampuff';
        font-style: normal;
        font-weight: normal;
        src: url('https://example.com/wp-content/uploads/sites/3/2023/01/CREAMPUF.ttf') format('truetype');
    }

    This only works in Safari though. Other browsers throw this error:

    Failed to decode downloaded font: https://example.com/wp-content/uploads/sites/3/2023/01/CREAMPUF.ttf

    I downloaded from another source and also used different FTP programs to upload. Did I use the correct CSS?

    Thanks a lot!

    #2517269
    David
    Staff
    Customer Support

    Hi there,

    thats an issue with the TTF file itself.
    Try converting the file to a woff and woff2 file. Using a site like font squirrel

    https://www.fontsquirrel.com/tools/webfont-generator

    Then use just the woff and woff2 files in your CSS. Don’t bother with the TTF

    #2518273
    Stephan

    Hi David,

    thanks for the hint. Turned out there must have been a problem with the font file itself as the mentioned webfont generator also said it was corrupt.

    I tried this generator then https://transfonter.org/ and with that I could transform it into woff. Maybe that helps somebody.

    Thanks a lot!

    #2518421
    David
    Staff
    Customer Support

    Glad to hear you got it working!

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