在Web浏览器上使用.otf字体 [英] Using .otf fonts on web browsers
本文介绍了在Web浏览器上使用.otf字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在一个需要在网上进行字体试验的网站上工作,所有的字体都是.otf
有一种方法嵌入字体,
解决方案
如果没有, div>
如果您的字体是免费字体,您可以使用例如 onlinefontconverter 转换您的字体,但.otf是使用@ font-face的好类型
@ font-face {
font-family:GraublauWeb ;
src:url(path-to-the-font-file / GraublauWeb.otf)format(opentype);
}
@ font-face {
font-family:GraublauWeb;
font-weight:bold;
src:url(path-to-the-font-file / GraublauWebBold.otf)format(opentype);
}
结帐此链接以了解其工作原理。
希望这有助于
I'm working on a website that requires font trials online, the fonts I have are all .otf
Is there a way to embed the fonts and get them working on all browsers?
If not, what other alternatives do I have ?
解决方案
If your Font is a free Font, you could convert your Font using for example a onlinefontconverter, but .otf is a good type for using @font-face
@font-face {
font-family: GraublauWeb;
src: url("path-to-the-font-file/GraublauWeb.otf") format("opentype");
}
@font-face {
font-family: GraublauWeb;
font-weight: bold;
src: url("path-to-the-font-file/GraublauWebBold.otf") format("opentype");
}
checkout this link to see how it works.
hope this helps
这篇关于在Web浏览器上使用.otf字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文