Order of the Butterfly
Posts: 301 from 2003/2/24
From: Genesi
Technically an SVG with MorphOS icon information may not exactly "conform" to the SVG specs anymore. Also, the information would be arbitrarily stripped out every time you edited it (no SVG editors will "preserve" the tags.. most parsing will remove them anyway).
PNG has special provisions for this which is why the icon chunk is something like "icOn" (the letters have different "flags" hidden in them, see
http://www.libpng.org/pub/png/spec/iso/index-object.html#5Chunk-naming-conventions - basically the MorphOS icon chunk is ancillary to the data stream (not necessary for decoding), privately defined (not PNG spec), the O is capital because the flag is reserved, and the last letter means "safe to copy", which implies "please store this data and put it back in when you re-save a PNG").
How do I know that? Well I designed the initial format :)
IFF chunks can be handled in a similar way by iffparse.library but it's much, much more crude.
Personally I am intrigued by the idea of using vector images for skins - for icons you tend to want lots of detail which sometimes isn't acheivable with vector graphics without embedding bitmaps. Most vector icons end up looking rather plasticcy as a result (and nobody implements the parts of thr SVG spec required to "texture" their SVG data properly). For window gadgets and border imagery though, the style is usually meant to scale with the fonts used (which bitmaps do not without creating 100s of seperate sizes) and things like scrollbars would be better rendered with vector imagery (see MUI xenbar.. that's a vector image).
That's far off though. We'd want to use an SVG parser that wasn't under the GPL, and tie it in closely with the graphics system. Cairo is promising (www.cairographics.org I think..) with replacable backends and MIT licensed. It currently doesn't support enough of the SVG spec in terms of the backends to render anything wonderful though. MorphOS has an XML parser already (expat based, with a tag API to make it simpler) that we can hook in. It's renderers and conforming to the specs I'm worried about.
Neko
Matt Sealey, Genesi USA, Inc.
Developer Relations
Product Development Analyst