css - Google 字体 - CSS - 某些字符无法正常工作

标签 css html firefox google-font-api

我已经将(不)著名的 open sans 导入到我的 CSS 中。一开始一切都很好。 但是,今天我注意到某些字符 (şğü) 在 Firefox 中无法正确显示。它们在 Internet Explorer 和 Chrome 中运行良好,但在 Firefox 中将被默认字体取代。

我在想,这应该是一个快速解决的问题。有什么想法吗?

@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic);
 p {
  font-family: "Open Sans";
  font-size: 4em;
}
<p>Example şğü.</p>

最佳答案

默认情况下,许多 Google 字体仅支持 Basic Latin repertoire(有效的 Windows Latin 1 集);这包括例如ü 但不是您使用的土耳其字母。可以使用 Google 字体用户界面中的复选框来选择轨道,但这相当不引人注意。在这种情况下,您需要添加参数subset=latin,latin-ext:

@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic&subset=latin,latin-ext);

p {
    font-family: "Open Sans";
    font-size: 4em;
}
<p>Example şğü.</p>

关于css - Google 字体 - CSS - 某些字符无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26901451/

相关文章:

html - CSS 有助于在图像上定位销售横幅

jquery - 我有两个日期选择器往返我想将明年设置为日期选择器

ssl - 可以强制Firefox使用ssl而不是tls

html - iframe 高度属性不适用于 Firefox

css - React table v7固定列与react-window

css - 仅当文本适合时,如何使用 d3.js 在 SVG 矩形中显示文本?

javascript - 如何在我的 Web 应用程序中添加第三方组件?

javascript - 在 html 中显示 RTSP 流

python - Flask 无法加载 CSS 中的图像

css - 字体加载错误 : downloadable font: kern: Too large subtable, 表格被丢弃