Re: SVG Fonts inside of OpenType fonts? [Cross-post from www-font@w3.org]

On Monday, June 27, 2011, 9:40:01 AM, Bram wrote:

BP> I know your method is designed to add to the current specs rather than
BP> substitute it. But since there is a probability that some font vendors
BP> might implement a full-on SVG solution if it’s made available—being
BP> pretty attractive in terms of security—would it be helpful to do some
BP> testing if the file sizes of SVGZ and WOFF-wrapped fonts would differ
BP> and will impact performance (and how much)? Particularly under
BP> different subsets.

SVG compresses well using gzip (this was one of the design criteria for the path syntax). Typically 2x-3x compression,depending on the content.

SVGZ is SVG compressed using gzip. So putting SVGZ in an sfnt table gives a table with pre-compressed contents.

WOFF is a header, individual SFNT tables compressed using gzip, and optionally some (compressed) metadata and/or private data. WOFF specifies that if a table gets larger when compressed, the uncompressed table gets put into the WOFF. So using WOFF would not produce a size increase due to double compression.

The bulk of the WOFF data size is the actual sfnt tables, in practical fonts.

Thus, I would expect two sfnt fonts, one containing SVG in a table and one containing SVGZ in a table, to be approximately the same size when converted to WOFF. I would also expect the WOFF to be somewhat larger than the raw SVGZ, mostly due to the other sfnt tables and other glyph fallback; the extra contribution from WOFF header and metadata would not be significant there.

A non-usable test font which contained only the minimal sfnt tables, and no other source of glyph data besides the SVG glyphs would (apart from not conforming to the intent of the proposal) be slightly larger than a raw SVGZ and smaller than the raw SVG.



-- 
 Chris Lilley   Technical Director, Interaction Domain                 
 W3C Graphics Activity Lead, Fonts Activity Lead
 Co-Chair, W3C Hypertext CG
 Member, CSS, WebFonts, SVG Working Groups

Received on Monday, 27 June 2011 15:01:32 UTC