(this is a post mainly to document some new features and fixes I’ve added to SVGKit version 1.2 today – they are already on the main development branch (currently: 1.x), ready for use)
SVGKit overview, November 2013
While a group of us were cleaning up and improving SVGKit about 2 years ago, I did a quick-n-simple re-architect of the in-memory data structures to split it into three wholly independent sets of source code / classes:
- Parsing an SVG file
- Parsing a legal XML file, with a new conforming DOM parser I wrote from scratch (because SVG Spec requires you to use a DOM parser, and Apple won’t let you use/extend their one on iOS/OSX!)
- Parsing the core SVG spec where it differs from XML-DOM
- Adding a system for user-supplied custom-parsers so that you can parse your custom XML in-line with the SVG (this is a major feature of SVG, but difficult to parse!)
- Rendering an SVG file with pixels on-screen
- Converting in-memory SVG data into Apple’s CALayer rendering format (used on all Apple Operating Systems)
- Optionally converting Apple’s CALayer format into highly-optimized hybrid data that lets you render SVG’s *fast*
- Painstakingly implementing every feature of SVG, from radial gradients to rich text (we’re about 90% complete now, still features left to add – please help!)
- Outputting an SVG file back to disk
- …not supported … until now!