【发布时间】:2012-03-05 18:35:43
【问题描述】:
我在 Windows 计算机上使用 @font-face 时遇到了问题(不知道是什么浏览器)。它在 linux 和 osx 中运行良好。
这是我正在使用的 css 代码(使用 font-squirel 生成)
检查屏幕截图是否有问题.. 似乎有 2 个问题
- 在 Windows 上,字体是“跳舞”的。未在基线上对齐。
- 在 Windows 上,字体看起来没有消除锯齿。
有人有想法吗?提前致谢。
OSX 和 Linux 中的屏幕截图:
(来源:j3rn.org)
Windows 中的屏幕截图:
(来源:j3rn.org)
CSS 代码
@font-face {
font-family: 'SchulbuchNordFett';
src: url(assets/fonts/schulbuchnord-fett-webfont.eot');
src: url('assets/fonts/schulbuchnord-fett-webfont.eot?#iefix') format('embedded-opentype'),
url('assets/fonts/schulbuchnord-fett-webfont.woff') format('woff'),
url('assets/fonts/schulbuchnord-fett-webfont.ttf') format('truetype'),
url('assets/fonts/schulbuchnord-fett-webfont.svg#SchulbuchNordFett') format('svg');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'SchulbuchNordNormal';
src: url('assets/fonts/schulbuchnord-normal-webfont.eot');
src: url('assets/fonts/schulbuchnord-normal-webfont.eot?#iefix') format('embedded-opentype'),
url('assets/fonts/schulbuchnord-normal-webfont.woff') format('woff'),
url('assets/fonts/schulbuchnord-normal-webfont.ttf') format('truetype'),
url('assets/fonts/schulbuchnord-normal-webfont.svg#SchulbuchNordNormal') format('svg');
font-weight: normal;
font-style: normal;
}
【问题讨论】:
-
1) 第一张截图根本不是 OS X,那只是 Linux 2) 回到 Font Squirrel 的生成器,选择专家选项,并确保启用了提示。用新生成的字体文件替换,看看渲染是否有改善。
-
谢谢boltclock,你说得对,这是一个linux截图。我立即尝试了您的建议。但我没有给出解决方案。我确实看到默认情况下会检查“提示”。我只是尝试了一下以确保。这也不是缓存问题(我给字体新的文件名并更改了 css 文件路径)。
-
I've tried this answer 但我不会在 Firefox 上工作,而且它也不能完全正确,问题是在 chrome/safari/opera 上显示 utf-8 外国字符。
-
Windows 会在多种情况下关闭字体抗锯齿功能:如果字体较大、字体较小、使用 Postscript 轮廓而不是 TrueType 轮廓等。
标签: css windows font-face typography