Note that there are some explanatory texts on larger screens.

plurals
  1. POSVG font glyphs: ever seen contained path's?
    primarykey
    data
    text
    <p>I have a source of SVG files created by program potrace, which has created a separate for each component of a multi-segment character. If I simple-mindedly create glyph definitions using these same &lt;path>s the character will not display. If I jam all the path instructions into the "d=" attribute of the &lt;glyph> the character displays. </p> <p>The SVG spec <em>says</em> that &lt;glyph> elements are containers and explicitly says they can contain &lt;path> elements. It just doesn't work (tested in Chrome, Opera, Safari).</p> <p>Here's the smallest example I could cut down to:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta charset="utf-8" /&gt; &lt;title&gt;SVG font test sample04&lt;/title&gt; &lt;style type="text/css"&gt; @font-face { font-family: 'sample04'; src: url('sample04.svg#sample04') format('svg'); } .sample04 { font-family: "sample04", verdana, helvetica; } &lt;/style&gt; &lt;/head&gt; &lt;body class="sample04"&gt; xE014 | &amp;#xE014; | &amp;#xE015; | &lt;/body&gt; &lt;/html&gt; </code></pre> <p>sample04.svg</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt; &lt;svg version="1.1" xmlns = 'http://www.w3.org/2000/svg'&gt; &lt;defs&gt; &lt;font id="sample04" horiz-adv-x="800"&gt; &lt;font-face font-family="sample04" /&gt; &lt;glyph unicode="&amp;#xE014;" horiz-adv-x="800" d="M0,0h200v200h-200z M400,0h200v200h-200z"/&gt; &lt;glyph unicode="&amp;#xE015;" horiz-adv-x="800"&gt; &lt;path d="M0,0h200v200h-200z"/&gt; &lt;path d="M400,0h200v200h-200z"/&gt; &lt;/glyph&gt; &lt;/font&gt; &lt;/defs&gt; &lt;/svg&gt; </code></pre> <p>Note that the two glyphs have the same information, the first contained entirely within the &lt;glyph> d= attribute, the second having the information separated into two &lt;path> elements. I have tried with just a single &lt;path> element with no better results.</p> <p>So is this just another case where specs are sparkly and browsers are not up to it?</p> <p>Note: the reason I care so much is that I have nearly 5000 of these SVG files to embed into a font, and didn't really want to get so heavily into XML transformations to convert the sources...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload