下载的字体无法正确显示 [英] Downloaded font won't display properly
本文介绍了下载的字体无法正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我下载了一种字体,在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 */
}
为此,您可以使用字体生成器,但您必须拥有网络字体的许可证
To do this you can use a generator for font-face but you must have the license for the web font
这篇关于下载的字体无法正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文