SvgImage
An SVG image, painted as vectors into the shared KiteCanvas rather than rasterised, so it stays crisp at any scale. This is what draws the illustrations, cover art and diagrams that ship inside EPUBs and comics; SvgDocument wraps it when the .svg file IS the document.
val svg = SvgImage.parse(bytes) ?: return
svg.render(canvas, KiteMatrix.scaling(2.0, 2.0))Drawn: <svg> (width/height/viewBox), <g>, <use>, <path> (every d command including elliptical arcs), <rect> (+ rx/ry), <circle>, <ellipse>, <line>, <polyline>, <polygon>, <text> and <image>; fill, stroke, stroke-width, opacity, fill-opacity, stroke-opacity, fill-rule, display and visibility with inheritance; transform (translate/scale/rotate/skewX/skewY/matrix); linear and radial gradients and <pattern> tiles as paint; clip-path; and mask, by luminance or by alpha. Embedded <style> rules support type, universal, class and ID selectors, their compounds and comma lists, with specificity, source order and !important (SVG 1.1, section 6). Combinators, attribute/pseudo selectors, CSS escapes, at-rules and external stylesheets are not interpreted.
Text is measured against standard-font metrics and drawn through a host typeface, because SVG ships no font file of its own.
filter draws through KiteCanvas.rasterStep: a <filter> with any of the seventeen primitives of Filter Effects 1, in linearRGB or sRGB, and the filter functions such as blur() and drop-shadow(). A canvas without raster steps draws the element unfiltered.
Not drawn: animation.