下载的字体无法正确显示

编程入门 行业动态 更新时间:2024-10-28 20:19:57
本文介绍了下载的字体无法正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

更多推荐

下载的字体无法正确显示

本文发布于:2023-07-26 18:21:25,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1217755.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字体   正确

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!