svgsvg-font

Do SVG font glyphs prefer absolute over relative coordinates?


I've been playing with SVG fonts (and specifically crafting my own) this weekend, and found (a bit to my surprise) that they all seem to prefer absolute-coordinate paths, like this one from Keyamoon:

[...]
<font id="IcoMoon" horiz-adv-x="512" >
<font-face units-per-em="512" ascent="480" descent="-32" />
<missing-glyph horiz-adv-x="512" />
<glyph unicode="&#xe000;" d="M 512.00,192.00L 416.00,288.00L 416.00,384.00L 352.00,384.00L 352.00,352.00L 256.00,448.00L0.00,192.00L 64.00,192.00L 64.00,0.00L 224.00,0.00L 224.00,128.00L 288.00,128.00L 288.00,0.00L 448.00,0.00L 448.00,192.00 z" data-tags="home, house" />
[...]

Is there some good reason to (say, known bugs with some renderers), or can I go about usual Scour space-saving practices and stick to the all-lower-case drawing commands?


Solution

  • Nothing prevents you from using whatever path commands are defined in svg inside the 'd' attribute of a <glyph> element. That's valid and will work just fine.

    I'd suspect that the absolute commands you see on Keyamoon is just the result of a conversion from another font format to svg.