W3C home > Mailing lists > Public > public-svgopentype@w3.org > October 2011

For the record: Adobe's Draft 1 of the OT 'SVG ' table

From: Sairus Patel <sppatel@adobe.com>
Date: Fri, 28 Oct 2011 07:42:36 -0700
To: "public-svgopentype@w3.org" <public-svgopentype@w3.org>
Message-ID: <4EA40BFB156EC241906E2CCC0710A87778D7EEB781@NAMBX01.corp.adobe.com>
Here is Adobe's Draft 1 that I sent to opentype-migration-list@indx.co.uk on June 27, 2011 4:40 PM after Adam Twardoch broached the topic of including SVG Fonts within OpenType.
It was intended to spur discussion and start making things more concrete. Our thinking has evolved quite a bit since this was sent out and some of the TODOs have started to be resolved.


--- Draft 1 of Adobe's 'SVG ' table proposal (view with a monospaced font) ---

[
NOTE: Tables with glyph descriptions in other media types, for example
a 'SWF ' table, may be proposed in the future and may have the identical
container structure of the 'SVG ' table, with the only difference being
the format of the actual glyph descriptions.

TODO: this data structure doesn't allow glyph definitions to be shared.
If sharing is a requirement, we'll need to add explicit length fields.

TODO: describe how to restrict the complexity of allowable SVG in these
glyph definitions.
]

SVG - The Scalable Vector Graphics Table

This table associates some or all glyphs in the font with glyph
definitions in the Scalable Vector Graphics (SVG) format. Color,
animation, sound, or other multimedia facilities not available in CFF or
TrueType glyph technologies may be incorporated in these glyph
definitions.

'SVG ' is an optional table in the font. When it is present, it must be
in addition to the usual CFF or TrueType glyph definitions, which could
describe simple or preview versions of the SVG glyphs.

SVG Table Format:

Type    Name              Description
------- ----------------- -----------------------------------------------
USHORT  majorVersion      Major version (starting at 1). Set to 1.
USHORT  minorVersion      Minor version (starting at 0). Set to 0.
ULONG   glyphCoverage     Offset (relative to the start of the 'SVG '
                          table) to the glyph coverage table, which
                          specifies all glyph IDs that have SVG glyph
                          description data (static and/or animated) for
                          this media type. See chapter "OpenType Layout
                          Common Table Formats" for the definition of
                          the Coverage table.
ULONG   indexOffset       Offset (relative to the start of the 'SVG '
                          table) to the Media Index, which defines
                          glyph data for this media type.
------- ----------------- -----------------------------------------------

The Media Index is a collection of glyph definitions, one static and one
animated, for each glyph in the glyph coverage. Each glyph definition is
a self-contained SVG (TODO: specify more precisely).

These glyph definitions are accessed by an array of offsets into a data
section. The offsets are relative to the start of the Media Index. A
pair of offsets is specified for each glyph in the glyph coverage, the
first indicating a glyph definition that is static (no animation is
allowed), and the second a glyph definition that is animated.

The offsets must be in ascending order with offset[n] <= offset[n+1].
The length of a glyph definition can be determined by subtracting its
offset from the next offset in the offset array. An additional offset is
added at the end of the offset array so that the length of the last
glyph definition may be determined.

Thus, there are glyphCount*2 + 1 entries in the offsets array. The first
two entries are offsets for the first glyph in the coverage (static and
animated), the next two entries are offsets for the second glyph in the
coverage, and so on.

A particular glyph definition, static or animated, may be omitted by
having its computed length be zero: offset[n] == offset[n+1]. If
neither glyph definition is provided, it is recommended that the glyph
be omitted from the glyph coverage entirely.

Media Index Format:

Type     Name              Description
-------- ----------------- -----------------------------------------------
USHORT   glyphCount        Number of glyph descriptions. Same as number
                           of glyps in the glyphCoverage.
USHORT   offsetSize        Size of offset array elements. Set to 2
                           or 4. If 2, offsets are USHORTs; if 4,
                           offsets are ULONGs.
USHORT   offset            Array of offsets with (glyphCount*2 + 1)
or ULONG                   entries, relative to start of Media Index.
                           For offset type, see offsetSize
                           description above.
BYTE     data              Glyph description data section.
-------- ----------------- -----------------------------------------------
                           
Received on Friday, 28 October 2011 14:44:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 28 October 2011 14:44:39 GMT