css - @font-face 在 windows 和 mac 上抗锯齿

标签 css font-face antialiasing font-embedding

我用过 http://www.fontsquirrel.com/创建一个@font-face 工具包。
它工作正常,但在 windows 上的结果与在 mac 上的结果不同。
在 Windows 上,字体似乎有错误的抗锯齿:
Font face on Mac这是在 Mac 上使用 FF、Chrome 或 Safari(全部更新到最新版本)的结果。
Font face on Windows这是在带有 FF 或 Chrome 的 Windows 上的结果。

如您所见,结果并不相同。在 Windows 上字体更粗更粗糙。
我该如何解决这个问题?

最佳答案

我也曾在 Chrome 上遇到过这个问题,我想我刚刚找到了答案!

Chrome 不喜欢 fontsquirrel.com 默认生成的 CSS。

@font-face {
    font-family: 'HLC';
    src: url('/_styles/hlc/hl-webfont.eot');
    src: url('/_styles/hlc/hl-webfont.eot?#iefix') format('embedded-opentype'),
         url('/_styles/hlc/hl-webfont.woff') format('woff'),
         url('/_styles/hlc/hl-webfont.ttf') format('truetype'),
         url('/_styles/hlc/hl-webfont.svg#HLC') format('svg');
    font-weight: normal;
    font-style: normal;
}

为了修复,我移动了 SVG 行:

url('/_styles/hlc/hl-webfont.svg#HLC') format('svg')

到列表的顶部。现在我看到了抗锯齿字体!我猜 Chrome 想成为第一个...

/* THIS WORKS FOR ME */
@font-face {
    font-family: 'HLC';
    src: url('/_styles/hlc/hl-webfont.eot');
    src: url('/_styles/hlc/hl-webfont.svg#HLC') format('svg'),
         url('/_styles/hlc/hl-webfont.eot?#iefix') format('embedded-opentype'),
         url('/_styles/hlc/hl-webfont.woff') format('woff'),
         url('/_styles/hlc/hl-webfont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

希望它也对你有用。享受吧!

关于css - @font-face 在 windows 和 mac 上抗锯齿,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4060607/

相关文章:

Java 如何使用 Graphics2D 制作抗锯齿线?

compact-framework - 如何在 Compact Framework 上使用带有双缓冲的 ClearType?

svg - 抗锯齿、Web SVG 和 Raphaël.js

Css 粘性页脚 - 响应

css - 在 div 中居中 img,垂直对齐 : middle

html - 在表格中,TD 标签宽度在 HTML 中没有正确对齐?

html - @font-face 不工作。我是新手 html & css 用户

gwt - GWT 中的@font-face

Chrome、Firefox + Safari 之间的 CSS Padding 变化

html - IFrame 中的滚动条不显示