【发布时间】:2018-12-03 21:28:53
【问题描述】:
我不了解 Chrome 加载谷歌字体的方式。这是我的html:
<html>
<head>
<title>Montserrat Regular Google Fonts</title>
<link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet">
</head>
<body>
<p style="font-family: 'Montserrat', sans-serif; font-weight: 400; font-size: 30px;">
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt..."
</p>
</body>
我的 Windows 10 机器上安装了 Montserrat Regular。 据此:https://fonts.googleapis.com/css?family=Montserrat,本地安装的字体优先。
但是当我检查开发工具时,Chrome 会在“渲染字体”下报告 - 蒙特塞拉特(网络资源 -93 字形)
我在 Firefox(报告“Montserrat Regular - System”)和 Edge(报告“Montserrat Regular used Montserrat (Local, System,95 chars))上对此进行了测试。
为什么 Chrome 更喜欢网络资源而不是本地安装的字体?
【问题讨论】:
-
我的 Windows 10 机器安装了 Ubuntu 字体。我在所有浏览器上测试了你的 Ubuntu 字体代码,不仅仅是 Chrome,所有浏览器都下载了谷歌字体。
-
@TejasSarade,实际上似乎只有 Chrome 正在下载字体。 Edge 和 Firefox 只下载 Google Fonts CSS 文件,而不是实际的 Google 字体。
-
如果我转到 Firefox 开发者控制台中的字体选项卡,我只会将 Ubuntu 视为 Web 字体。 IE/Edge 也一样。我没有看到使用任何本地字体。
标签: google-chrome google-font-api google-fonts