SVG <glyph> element spec

It seems that no browser supports arbitrary geometry inside a <glyph>
element. Only path data in the "d" attribute of the glyph is supported, and
then only on Opera and WebKit (as far as I can tell). There are no W3C
tests for non-path glyphs that I could find.

I propose we drop the container aspect of glyph and insist on path data
only. The complexity of implementing arbitrary geometry inside <glyph>
makes it unlikely to be supported.

I also discovered that it is essential that a horiz-adv-x and related sizes
be given for the font, otherwise the width is undefined. I think the
spec should be explicit about this somewhere in the <glyph> discussion.
Maybe we could also define it such that the advances, if undefined, come
from the bounding box of the path.

Example below.

Cheers,
Stephen.


<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xlink="
http://www.w3.org/1999/xlink">
  <svg xmlns="http://www.w3.org/2000/svg" x="100" y="100" width="400"
height="400">
    <defs>
      <font>
        <font-face font-family="xyzzy" units-per-em="8" />
        <glyph unicode="1" id="rect1" horiz-adv-x="12" d="M0,0 l10,0 l0,10
l-10,0 z" />
        <glyph unicode="2" id="rect2" horiz-adv-x="12">
          <rect width="10" height="10" x="0" y="0" />
        </glyph>
      </font>
    </defs>
    <text x="25" y="25" font-family="xyzzy" stroke-width="1">
      12<altGlyph xlink:href="#rect1">A</altGlyph><altGlyph
xlink:href="#rect2">B</altGlyph>
    </text>
  </svg>
</html>

Received on Wednesday, 19 December 2012 15:00:12 UTC