无法在 html 中包含自定义字体(Helvetica LT 25 Ultra Light)
我已经下载了整个 Helvetica Neue。当我尝试导入它们时,几乎所有字体都可以工作,但“Helvetica LT 25 Ultra Light”却不能。
知道问题是什么吗?
代码:
@font-face{
font-family: 'HelveticaNeue';
src: url('/fonts/Helvetica LT 25 Ultra Light.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
我做错了什么吗?
I have downloaded the entire Helvetica Neue. Almost all the fonts work when I try to import them, but "Helvetica LT 25 Ultra Light" does not.
Anyidea what the issue could be ?
code:
@font-face{
font-family: 'HelveticaNeue';
src: url('/fonts/Helvetica LT 25 Ultra Light.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
Am I doing anything wrong ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用网络字体时,您需要记住不同的浏览器需要不同的文件类型。 此页面包含详细说明如何使用@font-face的全面教程。
基本上,唯一能显示 truetype 字体的浏览器是 Opera 和 Safari。 Firefox、Chrome 和 IE9 使用“woff”文件。如果您在 Opera 或 Safari 中测试代码,它应该可以正确显示。
更新:
这里有一个网站,可以更轻松地包含您要使用的字体。他们创建了一个工具包,您可以将其放入页面中,而您不必担心自己创建/查找所有不同的格式。
When using web fonts, you need to remember that different browsers require different file types. This page includes a comprehensive tutorial spelling out how to use @font-face.
Basically, the only browsers that will display truetype fonts are Opera and Safari. Firefox, Chrome, and IE9 use 'woff' files. If you test your code in Opera or Safari, it should display correctly.
Update:
Here's a site that makes it easier to include the font you're looking to use. They create a kit that you drop into your pages and you don't have to worry about creating/finding all the different formats yourself.
将其添加到您的 html 文件中:
relace 您的文件夹
add it in your html file :
relace YOUR FOLDER