使用CorelDraw创建的SVG不会在iOS上显示文本

时间:2016-03-04 21:17:31

标签: ios svg

我有一堆用各种软件(Inkscape,CorelDraw X7)创建的SVG图像,我发现我在 CorelDRAW X7 中制作的SVG没有在iOS设备中显示文本。

http://thepotentpixel.com/svg-bug/

我在上面的链接中有一个工作图像和非工作图像的示例。如果您使用Safari或Chrome在iOS设备上打开它,则底部图像的数字会消失,但它们会显示顶部图像。

知道为什么吗?

两者都使用<text>标记。

1 个答案:

答案 0 :(得分:0)

底层SVG使用SVG字体,Chrome不支持(我猜Safari)。

如果我们删除了<font>元素,并在@font-face中对其进行了引用,则SVG在Chrome中显示正常。

&#13;
&#13;
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Creator: CorelDRAW X7 -->

<svg
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns="http://www.w3.org/2000/svg"
   xml:space="preserve"
   width="400px"
   height="100px"
   version="1.1"
   style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd"
   viewBox="0 0 4000 1000"
   id="svg2"
   >

           
           <defs
     id="defs4"><style
       type="text/css"
       id="style383">
    @font-face { font-family:"Arial";}
    .str1 {stroke:#999999;stroke-width:29.9981}
    .str0 {stroke:#CCCCCC;stroke-width:29.9981}
    .str2 {stroke:blue;stroke-width:19.9975}
    .fil0 {fill:none}
    .fil1 {fill:black}
    .fil2 {fill:#009933;fill-rule:nonzero}
    .fnt0 {font-weight:normal;font-size:200.096px;font-family:'Arial'}
   </style></defs><g
     id="Слой_x0020_1"><metadata
       id="CorelCorpID_0Corel-Layer" /><line
       class="fil0 str0"
       x1="60"
       y1="652"
       x2="3950"
       y2="652"
       id="line387" /><line
       class="fil0 str1"
       x1="264"
       y1="583"
       x2="264"
       y2="733"
       id="line389" /><line
       class="fil0 str1"
       x1="3014"
       y1="583"
       x2="3014"
       y2="733"
       id="line391" /><line
       class="fil0 str1"
       x1="3374"
       y1="583"
       x2="3374"
       y2="733"
       id="line393" /><line
       class="fil0 str1"
       x1="3726"
       y1="583"
       x2="3726"
       y2="733"
       id="line395" /><text
       x="149"
       y="953"
       class="fil1 fnt0"
       id="text397">17</text>
<text
       x="2918"
       y="953"
       class="fil1 fnt0"
       id="text399"
       style="font-size:200.09599304px;font-weight:normal;fill:#000000;font-family:Arial">77</text>
<text
       x="3290"
       y="953"
       class="fil1 fnt0"
       id="text401"
       style="font-size:200.09599304px;font-weight:normal;fill:#000000;font-family:Arial">80</text>
<text
       x="3625"
       y="953"
       class="fil1 fnt0"
       id="text403"
       style="font-size:200.09599304px;font-weight:normal;fill:#000000;font-family:Arial">83</text>
<line
       class="fil0 str2"
       x1="264"
       y1="575"
       x2="264"
       y2="15.483364"
       id="line405"
       style="fill:none;stroke:#000000;stroke-width:10;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:30.00000009, 30.00000009;stroke-dashoffset:0" /><text
       x="1515"
       y="236"
       class="fil1 fnt0"
       id="text413">60</text>
<text
       x="3118.1567"
       y="236"
       class="fil1 fnt0"
       id="text415"
       style="font-size:200.09599304px;font-weight:normal;fill:#000000;font-family:Arial">3</text>
<text
       x="3485.3179"
       y="236"
       class="fil1 fnt0"
       id="text417"
       style="font-size:200.09599304px;font-weight:normal;fill:#000000;font-family:Arial">3</text>
<g
       id="g419"><path
         class="fil2"
         d="M1660 313l0 30 0 0 -71 0 -70 2 -69 2 -67 2 -67 4 -66 4 -64 5 -63 6 -61 7 -59 7 -58 7 -56 9 -55 9 -52 9 -50 10 -48 11 -46 11 -44 12 -41 12 -38 13 -36 13 -34 13 -30 14 -28 14 -25 14 -21 14 -19 15 -15 15 -12 14 -8 14 -5 14 -3 14 -30 -2 4 -20 7 -19 11 -18 14 -18 18 -17 20 -16 23 -16 27 -15 29 -15 32 -14 34 -14 37 -13 39 -13 42 -12 45 -12 46 -11 49 -11 50 -10 53 -10 55 -9 57 -8 58 -8 60 -7 61 -7 64 -6 64 -5 66 -4 67 -4 68 -2 70 -2 70 -2 71 0 0 0zm1282 196l-14 27 -21 -11 -22 -10 -24 -10 -25 -10 -27 -10 -29 -9 -29 -9 -32 -9 -32 -9 -34 -8 -35 -8 -36 -8 -37 -7 -39 -8 -39 -7 -41 -6 -42 -6 -42 -6 -44 -6 -44 -5 -46 -5 -46 -4 -47 -4 -48 -4 -49 -3 -49 -3 -50 -2 -50 -3 -52 -1 -51 -1 -53 -1 -53 0 0 -30 53 0 53 1 52 1 52 2 50 2 51 2 49 3 49 3 48 4 48 4 46 4 46 5 45 5 44 6 43 6 42 6 41 7 40 7 39 7 37 8 37 8 35 8 35 8 32 9 32 9 30 9 29 10 28 10 26 10 25 10 23 11 22 11zm61 49l-87 -2 36 -69 51 71z"
         id="path421" /></g><g
       id="g423"><path
         class="fil2"
         d="M3171 313l0 30 0 0 -6 0 -7 1 -6 2 -6 2 -7 3 -6 4 -6 4 -7 6 -6 5 -6 7 -6 7 -6 8 -6 8 -5 9 -6 10 -5 10 -5 11 -5 11 -4 12 -4 12 -4 13 -4 13 -4 13 -3 14 -2 15 -3 15 -2 15 -2 15 -1 16 -1 15 -1 17 0 16 -30 0 0 -17 1 -17 1 -17 1 -16 2 -16 2 -16 3 -16 3 -15 3 -14 4 -15 4 -14 4 -13 5 -13 5 -13 5 -12 5 -12 6 -11 6 -11 6 -10 7 -10 6 -9 8 -8 7 -8 8 -7 7 -7 9 -5 8 -5 9 -4 9 -4 9 -2 10 -2 9 0 0 0zm159 206l-30 6 -2 -10 -2 -10 -3 -10 -3 -10 -3 -9 -3 -9 -3 -9 -4 -9 -3 -8 -4 -8 -4 -8 -4 -8 -4 -7 -4 -6 -4 -7 -4 -6 -5 -6 -4 -5 -5 -5 -4 -5 -5 -5 -4 -3 -5 -4 -5 -3 -5 -3 -4 -2 -5 -3 -5 -1 -4 -1 -5 -1 -5 -1 -5 0 0 -30 7 0 7 1 7 1 7 2 7 3 7 2 6 4 6 3 6 5 6 4 6 5 6 5 5 6 6 6 5 7 5 6 5 7 5 8 4 7 5 8 4 8 4 9 4 9 4 9 4 9 3 10 4 10 3 10 3 10 3 10 2 11 3 11zm1 78l-54 -68 76 -16 -22 84z"
         id="path425" /></g><g
       id="g427"><path
         class="fil2"
         d="M3532 313l0 30 0 0 -7 0 -6 1 -6 2 -7 2 -6 3 -7 4 -6 4 -6 6 -6 5 -6 7 -6 7 -6 8 -6 8 -6 9 -5 10 -5 10 -5 11 -5 11 -5 12 -4 12 -4 13 -4 13 -3 13 -3 14 -3 15 -2 15 -2 15 -2 15 -2 16 -1 15 0 17 -1 16 -30 0 1 -17 0 -17 1 -17 2 -16 2 -16 2 -16 3 -16 3 -15 3 -14 3 -15 4 -14 5 -13 4 -13 5 -13 5 -12 6 -12 5 -11 6 -11 7 -10 6 -10 7 -9 7 -8 8 -8 7 -7 8 -7 8 -5 9 -5 8 -4 10 -4 9 -2 9 -2 10 0 0 0zm158 206l-29 6 -2 -10 -3 -10 -3 -10 -2 -10 -3 -9 -3 -9 -4 -9 -3 -9 -4 -8 -3 -8 -4 -8 -4 -8 -4 -7 -4 -6 -4 -7 -5 -6 -4 -6 -5 -5 -4 -5 -5 -5 -4 -5 -5 -3 -5 -4 -4 -3 -5 -3 -5 -2 -4 -3 -5 -1 -5 -1 -5 -1 -4 -1 -5 0 0 -30 7 0 7 1 7 1 7 2 7 3 6 2 7 4 6 3 6 5 6 4 6 5 5 5 6 6 5 6 6 7 5 6 4 7 5 8 5 7 4 8 5 8 4 9 4 9 4 9 3 9 4 10 3 10 3 10 3 10 3 10 3 11 2 11zm2 78l-55 -68 76 -16 -21 84z"
         id="path429" /></g><line
       class="fil0 str2"
       x1="3011.4385"
       y1="575"
       x2="3011.4385"
       y2="15.483337"
       id="line405-2"
       style="fill:none;stroke:#000000;stroke-width:10;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:30.0000001, 30.0000001;stroke-dashoffset:0" /><line
       class="fil0 str2"
       x1="3371.3938"
       y1="575"
       x2="3371.3938"
       y2="15.483322"
       id="line405-5"
       style="fill:none;stroke:#000000;stroke-width:10;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:30.0000001, 30.0000001;stroke-dashoffset:0" /><line
       class="fil0 str2"
       x1="3725.554"
       y1="575"
       x2="3725.554"
       y2="15.483324"
       id="line405-5-7"
       style="fill:none;stroke:#000000;stroke-width:10;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:30.0000001, 30.0000001;stroke-dashoffset:0" /></g></svg>
&#13;
&#13;
&#13;

我不熟悉Corel Draw,但我猜测,当你保存SVG时,它为你提供了嵌入字体文件的选项。如果是这样,请在保存其他文件时关闭该选项。