我已经使用@ font-face添加了这些字体,并且所有浏览器中的字体都在预期中,但是在firefox中。
以下是我正在处理https://fashionunited.fr/
的网站问题仅出现在带重音符的字符中,并带有粗体,在某些情况下还带有正常的字体粗细。
字体也加载了fontfaceobserver.js
这是我的代码:
JS文件和css文件
(function( w ){
// if the class is already set, we're good.
if( w.document.documentElement.className.indexOf( "fonts-loaded" ) > -1 ){
return;
}
var fontA = new w.FontFaceObserver( "Open Sans", [{
weight: 300
},{
weight: 400
}, {
weight: 700
}]);
var fontB = new w.FontFaceObserver( "Droid Serif", [{
weight: 400
}, {
weight: 700
}]);
w.Promise
.all([fontA.check(), fontB.check()])
.then(function(){
w.document.documentElement.className += " fonts-loaded";
});
}( this ));
@font-face {
font-family: 'Open Sans';
src: url('../fonts/opensans-light-webfont.woff2') format('woff2'),
url('../fonts/opensans-light-webfont.woff') format('woff'),
url('../fonts/opensans-light-webfont.ttf') format('truetype');
font-weight: 300;
font-style: normal;
}
@font-face {
font-family: 'Open Sans';
src: url('../fonts/opensans-regular-webfont.woff2') format('woff2'),
url('../fonts/opensans-regular-webfont.woff') format('woff'),
url('../fonts/opensans-regular-webfont.ttf') format('truetype');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Open Sans';
src: url('../fonts/opensans-bold-700webfont.woff2') format('woff2'),
url('../fonts/opensans-bold-700webfont.woff') format('woff'),
url('../fonts/opensans-bold-700webfont.ttf') format('truetype');
font-weight: 700;
font-style: normal;
}
@font-face {
font-family: 'Droid Serif';
src: url('../fonts/droidserif-webfont.woff2') format('woff2'),
url('../fonts/droidserif-webfont.woff') format('woff'),
url('../fonts/droidserif-webfont.ttf') format('truetype');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'Droid Serif';
src: url('../fonts/droidserif-bold-700webfont.woff2') format('woff2'),
url('../fonts/droidserif-bold-700webfont.woff') format('woff'),
url('../fonts/droidserif-bold-700webfont.ttf') format('truetype');
font-weight: 700;
font-style: normal;
}