Custom font-face available only on refresh

Discussion in 'CSS' started by Simple Link Media, Feb 23, 2011.

  1. #1
    I have ran into a small problem - my custom font-face definition works but only after the page have been reloaded at least for once.
    Basically, when I open my browser, it shows the default Verdana - only when I reload it, it switches to my custom font and stays at it.

    Is there a way to make it look ok right from the very beginning ?
    I know I could simply put a redirect to reload it but IMHO it would be quite lame ..

    Also, does anybody know how to get custom font-faces ( e.g. MyriadPro ) work on IE ?
     
    Simple Link Media, Feb 23, 2011 IP
  2. buzenko

    buzenko Peon

    Messages:
    93
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    For IE use EOT font format.

    Example

    @font-face { font-family : "MyriadPro";
    src : url("MyriadPro.eot");
    src : url("MyriadPro.ttf") format("truetype");
    }

    Use http://www.fontsquirrel.com/ for font code generation and all format fonts download.

    Read this
    http://www.960development.com/how-to-write-cross-browser-font-face-syntax/
     
    Last edited: Feb 23, 2011
    buzenko, Feb 23, 2011 IP
  3. radiant_luv

    radiant_luv Peon

    Messages:
    1,327
    Likes Received:
    34
    Best Answers:
    1
    Trophy Points:
    0
    #3
    radiant_luv, Feb 23, 2011 IP
  4. Simple Link Media

    Simple Link Media Peon

    Messages:
    38
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Converted it to eot and still got nothing - IE continues to ignore me ..
     
    Simple Link Media, Feb 23, 2011 IP
  5. Divisive Cottonwood

    Divisive Cottonwood Peon

    Messages:
    1,674
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Have you used the right CSS syntax? For font-face it is quite convoluted like below:

    @font-face {
        font-family: 'LeagueGothicRegular';
        src: url('League_Gothic-webfont.eot');
        src: url('League_Gothic-webfont.eot?iefix') format('eot'),
             url('League_Gothic-webfont.woff') format('woff'),
             url('League_Gothic-webfont.ttf') format('truetype'),
             url('League_Gothic-webfont.svg#webfontFHzvtkso') format('svg');
        font-weight: normal;
        font-style: normal;
    }
    Code (markup):
     
    Divisive Cottonwood, Feb 25, 2011 IP