问题描述
在我之前的一个问题中,我指出 woff2 格式在 Microsoft Edge 上无效。所以我必须使用@ font-face的替代语法,如果我想让我的网站在Microsoft Edge看起来不错。
In a previous question of mine it was pointed out to me that "woff2" format doesn't work on Microsoft Edge. So I have to use an alternative syntax of @font-face if I want my website to look good in Microsoft Edge.
原始CSS / p>
Original CSS
@font-face{font-family:'Dosis';font-style:normal;font-weight:200;src:local('Dosis ExtraLight'), local('Dosis-ExtraLight'), url(http://fonts.gstatic.com/s/dosis/v4/RPKDmaFi75RJkvjWaDDb0vesZW2xOQ-xsNqO47m55DA.woff2) format('woff2');}
@font-face{font-family:'Dosis';font-style:normal;font-weight:700;src:local('Dosis Bold'), local('Dosis-Bold'), url(http://fonts.gstatic.com/s/dosis/v4/22aDRG5X9l7obljtz7tihvesZW2xOQ-xsNqO47m55DA.woff2) format('woff2');}
建议的CSS
@font-face {
font-family: 'MyFontFamily';
src: url('myfont-webfont.eot?#iefix') format('embedded-opentype'),
url('myfont-webfont.woff') format('woff'),
url('myfont-webfont.ttf') format('truetype'),
url('myfont-webfont.svg#svgFontName') format('svg');
}
所以我想做的是找到所有其他格式(truetype,
So what I am trying to do is to find all other formats (truetype, woff etc) for 'Dosis' for example..
我使用:
它给我只有400重量版本的Dosis。
I used : http://webfonts.azurewebsites.net/?fontname=DosisIt gives me only the 400 weight version of Dosis.
您知道其他方法,以便我可以拥有必要格式的Dosis的正确版本吗?
Do you know other ways so I can have the correct versions of Dosis in the necessary formats?
推荐答案
使用google字体以下方式
You can also use google font following way
<link href='https://fonts.googleapis.com/css?family=Dosis:400' rel='stylesheet' type='text/css'>
根据您的选择更改字体重量 href ='https: /fonts.googleapis.com/css?family=Dosis:200'
Change the font weight according to your choose like href='https://fonts.googleapis.com/css?family=Dosis:200'
在这种情况下,您不必担心不同的格式。只需在你的风格中使用 font-family:'Dosis';
。
In that case you need not to worry about different format. just use font-family:'Dosis';
in your style.
这篇关于找到“woff2”旁边的Google字体的所有其他格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!