W3C home > Mailing lists > Public > www-svg@w3.org > December 2012

Re: SVG <glyph> element spec

From: Dirk Schulze <dschulze@adobe.com>
Date: Wed, 19 Dec 2012 07:12:19 -0800
To: Stephen Chenney <schenney@chromium.org>
CC: "www-svg@w3.org" <www-svg@w3.org>
Message-ID: <D980634D-B461-462E-B4A4-062A68A1F4A0@adobe.com>
Hi Stephen,

Did you try other SVG viewers like Batik, Inkscape or Illustrator (and a couple more) too?

Greetings,
Dirk

On Dec 19, 2012, at 7:01 AM, "Stephen Chenney" <schenney@chromium.org<mailto:schenney@chromium.org>> wrote:

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:12:54 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:53 GMT