下载的字体无法正常显示 [英] Downloaded font won't display properly

查看:27
本文介绍了下载的字体无法正常显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了一种字体,在我的 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

这篇关于下载的字体无法正常显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆