css - Woff 开放式字体在本地不起作用?

标签 css fonts font-face webfonts

我已经下载了.Woff字体(Ubuntu),以下是与其相关的代码:

  @font-face {
  font-family: 'Ubuntu';
  font-style: normal;
  font-weight: 400;
  src: local('Ubuntu'), url(http://themes.googleusercontent.com/static/fonts/ubuntu/v4/_xyN3apAT_yRRDeqB3sPRg.woff) format('woff');
}

我下载了它并直接将其放入我的 css 文件夹中。

我将 src 值更改为:

src: local('Ubuntu'), url(ubuntu.woff) format('woff');

(我将字体重命名为 Ubuntu.woff) 但该字体不适用于本地 URL,我检查了 Chrome 给我的路径(找不到位于whatever/whatever/css/Ubuntu.woff 的字体),它是正确的路径。有人知道为什么它不起作用吗?

最佳答案

我用另一种 .woff Google 网络字体尝试了同样的操作,但是是在 Windows 上。 显然 Windows 表示文件格式无效。

关于css - Woff 开放式字体在本地不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11562018/

相关文章:

html - 自定义字体无法在 Chrome 中正确加载

ios - Xcode 字体 : How to know if I need to purchase a license?

html - @font-face vitesseSans 书在 ie 中不工作

html - 垂直滚动条?

html - 在不调整 div 大小的情况下调整图像大小

Android material 对齐字体基线到 4dp 网格

android - @font face 不适用于 Android

html - Windows 版 Chrome,糟糕的@font-face 渲染

javascript - 悬停在图像上时添加 div 元素类

CSS:两个高度相等的 float div列,垂直分割右div