【发布时间】:2011-08-20 03:12:22
【问题描述】:
我使用@font-face 来启用自定义字体。它适用于 Firefox、IE、Safari 和 Mac 上的 Chrome。在带有 Chrome 的 Windows 7 上,10px 处的文本看起来是绿色而不是黑色或灰色!
...经过更多测试:Firefox (Windows) 和 Safari (Windows) 存在同样的问题
可能与 Windows ClearType 渲染有关。但为什么它可以在 Internet Explorer 中运行??
页面直接链接:http://www.light-work.de/chrome.html
真的很奇怪!只有 10px 字体大小(我需要的大小)才会出现问题。在light-work.de/webfontkit/ 下可以看到标本概览。
更大的截图:http://light-work.de/styles/02.png
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>google chrome</title>
<style>
/* Generated by Font Squirrel */
@font-face {
font-family: 'M10Regular';
src: url('http://light-work.de/styles/m10/m10-webfont.eot');
src: url('http://light-work.de/styles/m10/m10-webfont.eot?#iefix') format('embedded-opentype'),
url('http://light-work.de/styles/m10/m10-webfont.woff') format('woff'),
url('http://light-work.de/styles/m10/m10-webfont.ttf') format('truetype'),
url('http://light-work.de/styles/m10/m10-webfont.svg#M10Regular') format('svg');
font-weight: normal;
font-style: normal;
}
body {
font-family: 'M10Regular';
line-height: 20px;
font-size: 10px;
color:#666666;
}
</style>
</head>
<body>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
</body>
</html>
【问题讨论】:
-
如果你想要跨浏览器的兼容性,你可以随时使用谷歌字体google.com/webfonts
-
在这种情况下您应该尝试的第一件事是验证您的 html:validator.w3.org
标签: css google-chrome font-face embedded-fonts