为的tumblr的Firefox的Base64编码字体 [英] Base64 Font Encoding for Tumblr on Firefox

查看:174
本文介绍了为的tumblr的Firefox的Base64编码字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发的Tumblr主题,并希望使用的字体,我有在所有浏览器。因为Firefox不会允许对CSS字体的其他领域的http请求,现在字体不工作在Firefox,但使用标准的@字体面语法所有其他浏览器上运行。

I am developing a Tumblr theme, and want to use a font that I have across all browsers. Because Firefox does not allow http requests for other domains for css fonts, right now the font does not work in Firefox, but works in all other browsers using the standard @font-face syntax.

做了一些环顾四周,发现一个建议直接使用的base64为en code字型到CSS文件。尝试这样做,但现在它不工作。我从来没有使用过这种技术,所以我可能只是失去了一些东西。我链接到从tumblr主题的样式表,并分配FONT-FAMILY:futuraBold某些元素

Did some looking around and found a suggestion to use base64 to encode the font directly into the css file. Trying to do that now but it isn't working. I've never used this technique before, so I may just be missing something. I am linking to the stylesheet from the tumblr theme, and assigning the font-family:futuraBold to certain elements.

下面是样式表的样子:

  @font-face {
    font-family: "futuraBold";
    src: url("data:font/opentype;base64,BASE64CODE");
} 

我用的base64恩这里codeR:<一href=\"http://www.opinionatedgeek.com/dotnet/tools/base64en$c$c/\">http://www.opinionatedgeek.com/dotnet/tools/base64en$c$c/

和上载的杂项文件字体文件。

and uploaded a .otf font file.

我缺少的东西吗?

推荐答案

所有这一切都只是你我想你不需要任何引号,单人或双人正确的。
它应该只是这样的:

All that is correct except that you I think you don't need any quotes, single or double. It should just go like this:

@font-face {
    font-family: futuraBold;
    src: url(data:font/opentype;base64,BASE64CODE);
} 

希望这有助于

这篇关于为的tumblr的Firefox的Base64编码字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆