【发布时间】:2014-07-18 17:49:41
【问题描述】:
我在 Windows 版 Chrome 上遇到烦人的字体渲染问题。
这是@font-face 在 Ubuntu 14.04/Chromium 36 下的渲染方式
这就是@font-face 在 Win7/Chrome 35 上的呈现方式
您可能需要点击图片才能看到区别。
这是 CSS:
@font-face {
font-family: 'SourceSansPro';
src: url('../fonts/SourceSansPro-Regular.eot');
src: local('☺'),
url('../fonts/SourceSansPro-Regular.eot?#iefix') format('embedded-opentype'),
url('../fonts/SourceSansPro-Regular.svg#sourceSansPro') format('svg'),
url('../fonts/SourceSansPro-Regular.woff') format('woff'),
url('../fonts/SourceSansPro-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'SourceSansPro';
src: url('../fonts/SourceSansPro-Italic.eot');
src: local('☺'),
url('../fonts/SourceSansPro-Italic.eot?#iefix') format('embedded-opentype'),
url('../fonts/SourceSansPro-Italic.svg#sourceSansPro') format('svg'),
url('../fonts/SourceSansPro-Italic.woff') format('woff'),
url('../fonts/SourceSansPro-Italic.ttf') format('truetype');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'SourceSansPro';
src: url('../fonts/sourcesanspro-semibold-webfont.eot');
src: local('☺'),
url('../fonts/sourcesanspro-semibold-webfont.eot?#iefix') format('embedded-opentype'),
url('../fonts/sourcesanspro-semibold-webfont.svg#sourceSansPro') format('svg'),
url('../fonts/sourcesanspro-semibold-webfont.woff') format('woff'),
url('../fonts/sourcesanspro-semibold-webfont.ttf') format('truetype');
font-weight: 600;
font-style: normal;
}
@font-face {
font-family: 'SourceSansPro';
src: url('../fonts/SourceSansPro-Bold.eot');
src: local('☺'),
url('../fonts/SourceSansPro-Bold.eot?#iefix') format('embedded-opentype'),
url('../fonts/SourceSansPro-Bold.svg#sourceSansPro') format('svg'),
url('../fonts/SourceSansPro-Bold.woff') format('woff'),
url('../fonts/SourceSansPro-Bold.ttf') format('truetype');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'Heuristica';
src: url('../fonts/Heuristica-Regular.eot');
src: local('☺'),
url('../fonts/Heuristica-Regular.eot?#iefix') format('embedded-opentype'),
url('../fonts/Heuristica-Regular.svg#heuristica') format('svg'),
url('../fonts/Heuristica-Regular.woff') format('woff'),
url('../fonts/Heuristica-Regular.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Heuristica';
src: url('../fonts/Heuristica-Italic.eot');
src: local('☺'),
url('../fonts/Heuristica-Italic.eot?#iefix') format('embedded-opentype'),
url('../fonts/Heuristica-Italic.svg#heuristica') format('svg'),
url('../fonts/Heuristica-Italic.woff') format('woff'),
url('../fonts/Heuristica-Italic.ttf') format('truetype');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'Heuristica';
src: url('../fonts/Heuristica-Bold.eot');
src: local('☺'),
url('../fonts/Heuristica-Bold.eot?#iefix') format('embedded-opentype'),
url('../fonts/Heuristica-Bold.svg#heuristica') format('svg'),
url('../fonts/Heuristica-Bold.woff') format('woff'),
url('../fonts/Heuristica-Bold.ttf') format('truetype');
font-weight: bold;
font-style: normal;
}
我尝试将 SVG 声明移到第二个位置,但没有帮助。
字体在IE11下正确渲染
感谢您的帮助
【问题讨论】:
标签: html css windows google-chrome font-face