【问题标题】:SVG rendering with custom fonts fails on ipad使用自定义字体的 SVG 渲染在 ipad 上失败
【发布时间】:2013-11-21 11:15:38
【问题描述】:

我使用 svg 编写了此文本,并且在我检查时它适用于 chrome 和 IE,但我在 iPad 的 Chome 上没有显示任何内容。

<svg width="180" height="76" xmlns="http://www.w3.org/2000/svg">
 <title>eQuotes</title>
 <defs>
  <style type="text/css">
    @font-face {
        font-family: 'MYFONT';
        src: url('./fonts/berlin.eot');
        src: url('./fonts/berlin.eot?#iefix') format('embedded-opentype'),
            url('./fonts/berlin.woff') format('woff'),
            url('./fonts/berlin.ttf') format('truetype'),
            url('./fonts/berlin.svg#berlin') format('svg');
    }
  </style>
 </defs>
 <g>
  <title>Layer 1</title>
   <text stroke="#7f0000" transform="matrix(1.73839 0 0 1.55447 -176.823 -232.222)" font-weight="bold" xml:space="preserve" text-anchor="middle" font-family="MYFONT" font-size="24" id="svg_40" y="192.68606" x="152.0512" stroke-linecap="null" stroke-linejoin="null" stroke-dasharray="null" stroke-width="0" fill="#000000">Hello There</text>
  </g>
 </g>
</svg>

有什么想法吗?

【问题讨论】:

    标签: google-chrome svg fonts


    【解决方案1】:

    您的 SVG 是无效的 XML。最后你有一个太多的&lt;/g&gt;,并且你有无效的属性值(null)。 Validate your markup,修正您的错误,然后重试。

    【讨论】:

    • @tomcat 用实际的 SVG 更新你的问题
    • 这里是实际svg的链接link
    • 如果你能指出我在之前评论的链接中做错了什么
    • @tomcat 点击我评论的链接查看验证错误。
    猜你喜欢
    • 1970-01-01
    • 2014-01-28
    • 1970-01-01
    • 2011-08-02
    • 1970-01-01
    • 1970-01-01
    • 2013-05-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多