Safari and IE can't read TTF and EOT fonts

后端 未结 1 1634
囚心锁ツ
囚心锁ツ 2020-12-10 15:21
  1. I have trouble reading a font in Safari. I converted OTF to TTF - two bold and regular fonts. Both are fine in Chrome and Firefox. But in Safari, only the bold font

相关标签:
1条回答
  • 2020-12-10 16:13

    You should check Paul Irish's Bulletproof @font-face Syntax or FontSpring's @font-face Syntax which needs multiple declarations of the the same font in different file types to server multiple browsers.

    The basic declaration is like

    @font-face {
      font-family: 'MyFontFamily';
      src: url('myfont-webfont.eot?#iefix') format('embedded-opentype'), 
       url('myfont-webfont.woff') format('woff'), 
       url('myfont-webfont.ttf')  format('truetype'),
       url('myfont-webfont.svg#svgFontName') format('svg');
    }
    

    I also prefer FontSquirrel's @font-face Generator but you can Google other alternatives. FontSquirrel just needs one font to be converted and it will provide you with a basic .zip file that contains necessary font types plus a sample demo of the fonts generated.

    0 讨论(0)
提交回复
热议问题