Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Preload a font-file (.ttf)?

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #28306
    DerFuchs10
    Member

    Hello,

    i create a website that use a .ttf-file. I include this file with css (@font-face) but my problem is… sometimes when i load the page the text who is used the .ttf-file looks bad (arbitrary mark). Can i preload the font-file and is this the solutions for my problem?

    PS… I’m form Germany sorry for my bad English :oops:

    #72116
    noahgelman
    Participant

    Can you show us a copy of the code you have written up?

    #72118
    DerFuchs10
    Member

    This is my Code:

    Code:
    @font-face { font-family: navifont; src: url(‘fonts/dreamori.ttf’); }
    @font-face { font-family: navifont; src: url(‘fonts/dreamori.ttf’) format(‘truetype’); }
    #72135
    noahgelman
    Participant

    The problem might be the format that you are putting it in the style sheet. Try this:

    Code:
    @font-face { font-family: navifont; src: url(‘fonts/dreamori.ttf’) format(“truetype”);}

    body { font-family: navifont; }

    If it still has arbitrary marks, it’s possible that that font file doesn’t support the character you are using.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.