google-chrome - 使用 Google Web Fonts 优先使用 SVG 字体

标签 google-chrome svg webfonts google-webfonts

除非您使用 SVG 字体,否则 Windows 上 Google Chrome 中的字体渲染非常糟糕。然而,谷歌网络字体优先考虑 WOFF 文件。

有什么方法可以强制它提供 SVG 字体,还是我必须自己手动托管字体?

最佳答案

您需要使用 @import 来托管文件。或 <link>方法引用一个只调用 WOFF 文件的 CSS 文件(因为浏览器检测)。前任。 http://fonts.googleapis.com/css?family=Open+Sans :

@font-face {
  font-family: 'Open Sans';
  font-style: normal;
  font-weight: 400;
  src: local('Open Sans'), local('OpenSans'), url('http://themes.googleusercontent.com/static/fonts/opensans/v6/cJZKeOuBrn4kERxqtaUH3T8E0i7KZn-EPnyo3HZu7kw.woff') format('woff');
}

在本地托管文件后,您可以在堆栈中向上移动 SVG 调用以对其进行优先级排序。你可以在这里看到一个例子:http://www.fontspring.com/blog/smoother-web-font-rendering-chrome
@font-face {
  font-family: 'MyWebFont';
  src: url('webfont.eot'); 
  src: url('webfont.eot?#iefix') format('embedded-opentype'),
  url('webfont.svg#svgFontName') format('svg'),
  url('webfont.woff') format('woff'),
  url('webfont.ttf')  format('truetype');
}

关于google-chrome - 使用 Google Web Fonts 优先使用 SVG 字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14438368/

相关文章:

javascript - Onclick 在 Chrome 中触发两次,而不是 IE 或 Firefox

javascript - 在调整大小期间,Chrome 和 Safari 不会可靠地更新样式(webkit 错误?)

html - 如何在 Firefox 中正确呈现@font-face?

css - 什么是 CSS 的 base 64 字体

html - Web 字体无法应用于在浏览器上工作的时事通讯(GMAIL、Yahoo Mail、Outlook、Hotmail 等)

html - 浏览器的 1px 计算问题(亚像素问题)

javascript - Chrome - 离线页面

reactjs - 两个 svgo-loader 冲突

javascript - 在 Enyo 2.0 中使用 SVG 控件处理事件(对象或嵌入标记)

javascript - Fabric .js : Problems with stroke color and width svg files on canvas