简体   繁体   English

Tumblr的Base64编码@ font-face

[英]Base64 encoded @font-face for Tumblr

Since Tumblr does not accept webfont files that are hosted on other domains, I am trying to import the files directly with Base64 encoding. 由于Tumblr不接受其他域上托管的Webfont文件,因此我尝试直接使用Base64编码导入文件。

This is the format I have used: 这是我使用的格式:

@font-face {
  font-family: 'FontName';
  src: url(data:application/vnd.ms-fontobject;base64,[BASE64 CODE]);
  src: url(data:font/woff2;base64,[BASE64 CODE]) format('woff2'),
       url(data:application/font-woff;base64,[BASE64 CODE]) format('woff'),
       url(data:application/x-font-truetype;base64,[BASE64 CODE]) format('truetype');
}

I have tried pasting this with the appropriate code to the Tumblr CSS editor, HTML editor in a style tag and in a external stylesheet without any success. 我尝试使用适当的代码将此代码粘贴到Tumblr CSS编辑器,HTML编辑器中的样式标签和外部样式表中,但没有成功。 What am I doing wrong? 我究竟做错了什么?

It seems that the Base64 encoder I was using produced code that did not work. 看来我使用的Base64编码器无法正常工作。 For anyone encountering the same issue, try using this encoder: https://www.giftofspeed.com/base64-encoder/ 对于遇到相同问题的任何人,请尝试使用以下编码器: https : //www.giftofspeed.com/base64-encoder/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM