无法在 html 中包含自定义字体(Helvetica LT 25 Ultra Light)

发布于 2025-01-01 09:57:13 字数 316 浏览 2 评论 0原文

我已经下载了整个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

终陌 2025-01-08 09:57:13

使用网络字体时,您需要记住不同的浏览器需要不同的文件类型。 此页面包含详细说明如何使用@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.

焚却相思 2025-01-08 09:57:13

将其添加到您的 html 文件中:

<style type="css/text">
    @font-face{
    font-family: 'HelveticaNeue';
    src: url(' YOUR FOLDER /fonts/Helvetica LT 25 Ultra Light.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    }
</style>

relace 您的文件夹

add it in your html file :

<style type="css/text">
    @font-face{
    font-family: 'HelveticaNeue';
    src: url(' YOUR FOLDER /fonts/Helvetica LT 25 Ultra Light.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    }
</style>

relace YOUR FOLDER

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文