本文介绍了下载的字体无法正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我下载了一种字体,在CSS中有:
I downloaded a font and in my CSS I have :
@font-face { font-family: "Gotham Medium"; src: url("Gotham/Gotham-Medium.otf");}何时我叫
h1 { font-family:'Gotham Medium'}字体显示与Gotham的外观不匹配。也不是默认字体。
the font display does not match what Gotham should look like. Nor is it a default font.
问题是否出在笔记本电脑上下载时发生了变化? 字体不在Google API中,因此我无法尝试使用外部链接。
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应该是这样的:
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技巧
为此,您可以使用字体生成器,但您必须拥有网络字体的许可证
To do this you can use a generator for font-face but you must have the license for the web font
更多推荐
下载的字体无法正确显示
发布评论