【问题标题】:I cannot load @font-face for browser我无法为浏览器加载@font-face
【发布时间】:2021-08-10 18:53:40
【问题描述】:

我的 css 无法加载 @font-face,它可以在 Firefox 上运行,然后我尝试解决“不支持其他浏览器”的问题。现在它根本不起作用.QAQ 我认为这是因为 *.otf 文件转换为 *.woff 格式不支持 zh-hant。但我检查了几次。它没有加载到英文部分。 所以我确实需要帮助。

@font-face {
          font-family: "CJK-Regular";
          font-display: swap;
          src: url(https://time-sight.com/service/wp-includes/fonts/NotoSansCJKtc-Regular.eot);
          src: url(https://time-sight.com/service/wp-includes/fonts/NotoSansCJKtc-Regular.eot?#iefix) format("embedded-opentype"),
    url("https://time-sight.com/service/wp-includes/fonts/NotoSansCJKtc-Regular.woff2") format("woff2"),
    url("https://time-sight.com/service/wp-includes/fonts/NotoSansCJKtc-Regular.woff") format("woff"),
    url("https://time-sight.com/service/wp-includes/fonts/NotoSansCJKtc-Regular.otf") format("opentype");}

.alt-font{font-family:'CJK-Regular'} 我曾试图自己弄清楚,但我花了几天时间仍然零进展。

【问题讨论】:

  • 我检查了以下内容:1.我的服务器中存在所有字体文件,并且名称与我的代码完全相同。 2.所有文件都设置为644权限。 3.再次上传文件并使用不同的应用程序进行转换。 4.尝试单独包含css文件(仅包含@font-face的一部分)5.检查它是否在我打开chrome->F12->Source->文件时加载了源列表6.是否使用",' , (none) 引用 url abs 路径。我不得不说我不知道​​该怎么做。所以我必须发布这些以寻求帮助
  • 请在问题本身中包含您在评论中提到的内容。

标签: html css fonts font-face


【解决方案1】:

我再次检查了所有内容。我发现这是因为转换器不支持繁体中文。所以我找到 exe:'FontCreater' 来转换我的文件,认为它需要购买 lience。 好消息是它有效。

【讨论】:

    猜你喜欢
    • 2016-02-07
    • 1970-01-01
    • 2012-03-20
    • 1970-01-01
    • 2017-12-20
    • 2012-02-04
    • 2016-12-24
    • 2013-01-25
    • 2015-04-25
    相关资源
    最近更新 更多