gpt4 book ai didi

css - 强制浏览器使用 woff 字体文件

转载 作者:太空宇宙 更新时间:2023-11-04 11:00:26 32 4
gpt4 key购买 nike

我定义了以下 @font-face 规则:

@font-face {
font-family: "MyFont";
src: url(MyFont.eot);
src: url(MyFont.eot#iefix) format('embedded-opentype'),
url(MyFont.ttf) format('truetype'),
url(MyFont.woff) format('woff');
}

由于 woff 字体文件中存在一些错误,我已经修复了它,我现在需要测试字体是否正确。

问题是 Google Chrome 默认使用 ttf 并且我无法在运行时修改 @font-face - 我也无法修改服务器上的 CSS因为管道复杂。

我们能否以某种方式强制浏览器使用特定的字体文件类型?

最佳答案

如果你只是想测试woff文件现在是否正常工作,你可以:

  1. 试试 Firefox,我相信他们优先考虑 WOFF,或者
  2. 暂时更改您的 @font-face 代码,以便 Google Chrome 仅将 WOFF 作为一个选项:
font-family: "MyFont";
src: url(MyFont.woff) format('woff');

关于css - 强制浏览器使用 woff 字体文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34354043/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com