Downloaded font won't display properly

2020-05-07 18:09发布

I downloaded a font and in my CSS I have :

@font-face {
font-family: "Gotham Medium";
src: url("Gotham/Gotham-Medium.otf");}

When I call say in

 h1 { font-family:'Gotham Medium'}

the font display does not match what Gotham should look like. Nor is it a default font.

Is the problem a matter of something being changed when downloaded in my laptop ? The font is not in the google API so I can't try with an external link.

标签: css fonts
1条回答
放我归山
2楼-- · 2020-05-07 18:28

Your Css should be like this :

@font-face {
     font-family: 'MyWebFont';
     src: url('webfont.eot'); /* IE9 Compat Modes */
     src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
     url('webfont.woff2') format('woff2'), /* Super Modern Browsers */
     url('webfont.woff') format('woff'), /* Pretty Modern Browsers */
     url('webfont.ttf')  format('truetype'), /* Safari, Android, iOS */
     url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}

css Trick

To do this you can use a generator for font-face but you must have the license for the web font

查看更多
登录 后发表回答