【发布时间】:2019-08-08 02:42:00
【问题描述】:
格式为 .ttf 的特定字体未加载到网络服务器上。它是我从 adobe typekit 中使用的一种名为 Edwardian Script 的 adobe 字体。
我已尝试在实时网站上加载此字体,但似乎不想加载。
我已尝试更改文件路径,我已将 format("truetype") 添加为另一个 SO Question 中的建议答案,但这也不起作用。
我曾考虑从 google 字体加载它,但这里需要花钱,而且我们的库中已经有了这种字体。
我一直在清空缓存并在另一台计算机上重试。
我可能会注意到它确实显示在 Dreamweaver 中,因此我一直在使用单独的计算机来确认它是否已更正。
我觉得这是一个文件路径问题,但我似乎没有找到正确的路径。
它由 cPanel 托管,位于名为 fonts 的文件夹中的 public_html 文件夹中
public_html > 字体 > Edwardian-Script > Edwardian-Script-ITC.ttf
CSS
@font-face {
font-family: Edwardian Script ITC;
src: url('/fonts/Edwardian-Script/Edwardian-Script-ITC.ttf') format("truetype");
}
.logo-text {
font-family: Edwardian Script ITC;
text-transform: none;
font-weight: 100;
font-kerning: none;
font-stretch: normal;
letter-spacing: normal;
}
HTML
<h3 class="logo-text"> Header Title </h3>
预计会从服务器字体文件夹中看到加载的字体
【问题讨论】: