finding all other formats for a Google font beside “woff2”

不羁的心 提交于 2019-12-10 18:17:59

问题


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.

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');}

Suggested 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');
    }

So what I am trying to do is to find all other formats (truetype, woff etc) for 'Dosis' for example..

I used : http://webfonts.azurewebsites.net/?fontname=Dosis It gives me only the 400 weight version of Dosis.

Do you know other ways so I can have the correct versions of Dosis in the necessary formats?


回答1:


You can also use google font following way

<link href='https://fonts.googleapis.com/css?family=Dosis:400' rel='stylesheet' type='text/css'>

Change the font weight according to your choose like href='https://fonts.googleapis.com/css?family=Dosis:200'

In that case you need not to worry about different format. just use font-family:'Dosis'; in your style.



来源:https://stackoverflow.com/questions/34453010/finding-all-other-formats-for-a-google-font-beside-woff2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!