• <legend id='DJom5'><style id='DJom5'><dir id='DJom5'><q id='DJom5'></q></dir></style></legend>
    • <bdo id='DJom5'></bdo><ul id='DJom5'></ul>

        <small id='DJom5'></small><noframes id='DJom5'>

        <tfoot id='DJom5'></tfoot>

        <i id='DJom5'><tr id='DJom5'><dt id='DJom5'><q id='DJom5'><span id='DJom5'><b id='DJom5'><form id='DJom5'><ins id='DJom5'></ins><ul id='DJom5'></ul><sub id='DJom5'></sub></form><legend id='DJom5'></legend><bdo id='DJom5'><pre id='DJom5'><center id='DJom5'></center></pre></bdo></b><th id='DJom5'></th></span></q></dt></tr></i><div id='DJom5'><tfoot id='DJom5'></tfoot><dl id='DJom5'><fieldset id='DJom5'></fieldset></dl></div>
      1. 使用数据 URI 的 Base64 编码 OpenType 字体

        Base64 encoded OpenType font-face using data URI(使用数据 URI 的 Base64 编码 OpenType 字体)
        <tfoot id='TX2DZ'></tfoot>

          <legend id='TX2DZ'><style id='TX2DZ'><dir id='TX2DZ'><q id='TX2DZ'></q></dir></style></legend>

              <i id='TX2DZ'><tr id='TX2DZ'><dt id='TX2DZ'><q id='TX2DZ'><span id='TX2DZ'><b id='TX2DZ'><form id='TX2DZ'><ins id='TX2DZ'></ins><ul id='TX2DZ'></ul><sub id='TX2DZ'></sub></form><legend id='TX2DZ'></legend><bdo id='TX2DZ'><pre id='TX2DZ'><center id='TX2DZ'></center></pre></bdo></b><th id='TX2DZ'></th></span></q></dt></tr></i><div id='TX2DZ'><tfoot id='TX2DZ'></tfoot><dl id='TX2DZ'><fieldset id='TX2DZ'></fieldset></dl></div>
                • <bdo id='TX2DZ'></bdo><ul id='TX2DZ'></ul>

                  <small id='TX2DZ'></small><noframes id='TX2DZ'>

                    <tbody id='TX2DZ'></tbody>

                  本文介绍了使用数据 URI 的 Base64 编码 OpenType 字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想在 font-face 中添加一个 base64 编码 OpenType 字体作为数据 URI.

                  I want to add a base64 encoded OpenType font as a data URI in font-face.

                  到目前为止我有这个:

                  @font-face {
                      font-family: 'test';
                      src: url(data:font/otf;base64,
                          // Base64 string here ...
                      ) format('opentype');
                  }
                  

                  但我认为它没有将字体正确地包含在我的风格中.

                  But I believe it does not include the font correctly to my style.

                  对此的任何帮助将不胜感激.

                  Any help with this would be really appreciated.

                  推荐答案

                  数据 URI 总是采用这种格式:

                  Data URIs are always of this format:

                  data:[<mediatype>][;base64],<data>
                  

                  每个 数据 URI 的第一部分是 media-type,在 Open Type 字体的情况下是:

                  The very first part of every data URI is the media-type, which in the case of an Open Type font is:

                  font/opentype
                  

                  所以,你可以这样使用它:

                  So, you may use it like this:

                  @font-face{
                      font-family: test;
                      src: url(data:font/opentype; base64, [base64 string here]);
                  }
                  

                  更换

                  [base64 string here]
                  

                  使用您的 base-64 编码字符串的精确复制粘贴版本.

                  with the exact copy-pasted version of your base-64 encoded string.

                  备注

                  请注意:

                  • 您应该为 data 使用 font/opentype,而不是 otf.
                  • 您应该复制粘贴确切的 base-64 编码字符串,不要进行任何更改,例如添加空格等(我相信其中有一些空格)

                  在线编码工具

                  您可以使用 this 工具,将您的字体文件转换为编码字符串.

                  You may use this tool, to convert your font file to the encoded string.

                  这篇关于使用数据 URI 的 Base64 编码 OpenType 字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  quot;Each child in an array should have a unique key propquot; only on first time render of page(“数组中的每个孩子都应该有一个唯一的 key prop仅在第一次呈现页面时)
                  How do I make a TextGeometry multiline? How do I put it inside a square so it wraps like html text does inside a div?(如何制作 TextGeometry 多线?如何将它放在一个正方形内,以便它像 html 文本一样包裹在 div 内?) - IT屋-程序员软件开发技术分享社
                  Scale background image to fit ie8 window(缩放背景图像以适合 ie8 窗口)
                  @fontface in IE7 (IETEster) not working properly(IE7 (IETEster) 中的@fontface 无法正常工作)
                  Safari 5.1 breaks CSS table cell spacing(Safari 5.1 打破 CSS 表格单元格间距)
                  Put in bold part of description in metatag Drupal module(将描述的粗体部分放在元标记 Drupal 模块中)
                  <tfoot id='IgUfS'></tfoot>
                  1. <legend id='IgUfS'><style id='IgUfS'><dir id='IgUfS'><q id='IgUfS'></q></dir></style></legend>

                    <small id='IgUfS'></small><noframes id='IgUfS'>

                        <bdo id='IgUfS'></bdo><ul id='IgUfS'></ul>

                          <i id='IgUfS'><tr id='IgUfS'><dt id='IgUfS'><q id='IgUfS'><span id='IgUfS'><b id='IgUfS'><form id='IgUfS'><ins id='IgUfS'></ins><ul id='IgUfS'></ul><sub id='IgUfS'></sub></form><legend id='IgUfS'></legend><bdo id='IgUfS'><pre id='IgUfS'><center id='IgUfS'></center></pre></bdo></b><th id='IgUfS'></th></span></q></dt></tr></i><div id='IgUfS'><tfoot id='IgUfS'></tfoot><dl id='IgUfS'><fieldset id='IgUfS'></fieldset></dl></div>

                              <tbody id='IgUfS'></tbody>