Namespace Egami.Svg
Classes
- SvgAttribute
An attribute of an SvgElement: its name, namespace, the prefix it was written with, and its value.
- SvgAttributeCollection
An element's attributes, in file order. Setting, adding and removing mark the document's render tree for rebuilding.
- SvgCanvas
A canvas that writes SVG: every drawing call becomes SVG elements, so anything drawn on a Canvas (shapes, strokes, gradients, images, text, clips, layers, recorded pictures) can be saved as a vector file that browsers, Inkscape and Egami.Svg all read. Gradients, patterns, clips, masks, images, glyph outlines and pictures are written once in
defsand shared. What SVG cannot express (sweep gradients, noise and composed paints, meshes, layers with filters) is drawn by Egami into an image at FallbackScale and embedded as PNG.The output is SVG 1.1 with CSS
mix-blend-modeandisolationfor blend modes and layers (and SVG 2'sfrfor a conical gradient whose start circle has a radius). Disposing the canvas finishes the file and writes it to the stream, which is left open. An image or picture drawn several times is stored once, as it was when first drawn.
- SvgClip
A clip path, in the coordinates of the node it clips: the union of its shapes, each with its own clip-rule.
- SvgComment
An XML comment, kept so a save writes it back.
- SvgContent
One item of an SvgElement's content, in file order: an element, text, a comment or a processing instruction.
- SvgContentList
An element's content in file order: child elements, text, comments and processing instructions. Changes mark the document's render tree for rebuilding.
- SvgDecodeOptions
Options for reading SVG through SvgFormat with
Raster.LoadandRaster.Probe.
- SvgDocument
An SVG document: an editable element tree read from an .svg or .svgz file, which saves back to SVG and draws through Egami.Drawing's canvas.
- SvgElement
An element of an SVG document's editable tree: its name and namespace, attributes and content, like XDocument's elements. Unknown elements and foreign namespaces (Inkscape's, Illustrator's metadata) are kept, so a save writes them back.
- SvgException
Thrown when an SVG file is not well-formed XML, breaks a safety limit, or, with Strict, has anything a lenient load would skip.
- SvgFilter
A filter, in the coordinates of the node it filters: the filter elements and CSS filter functions of its filter property, run one after the other.
- SvgFontOptions
Where a document's text finds its fonts (question 13): the caller's Collection first, then the fonts installed on the machine unless UseSystemFonts is off, then per-character fallback through the same fonts. A server that renders untrusted files should pass its own collection and turn system fonts off, so output never depends on the machine.
- SvgFormat
SVG and SVGZ as an Egami format: registered with WithFormat(FormatInfo),
Raster.Loaddraws an SVG file at its own size (times Scale) andRaster.Probegives that size without drawing. The format only reads; nothing outside the file is opened, so images it links are not drawn, and text uses the machine's fonts. For a resolver, your own fonts, a target size or a background, load an SvgDocument and call Rasterize<TPixel>(SvgRenderOptions?).
- SvgGlyphRenderer
Draws the glyphs of an OpenType SVG table (question 20): each glyph's document is read once per font and kept, and the element
glyphid is drawn in the font's units, its origin on the baseline. Set it on ColorGlyphRenderer; Rasterize<TPixel>(SvgRenderOptions?) uses it already.
- SvgGroup
A group of nodes drawn in order: a
g,svg,a,switch, auseinstance or a marker.
- SvgImage
An image: a raster drawn into a rectangle, or another SVG document drawn as a group.
- SvgLoadOptions
How SvgDocument reads a file: what it may fetch, how strict it is, and which limits and diagnostics apply.
- SvgMask
A mask, in the coordinates of the node it masks: content drawn into a region, used by luminance or alpha.
- SvgNamespaces
The XML namespaces SVG files use.
- SvgNode
A node of a document's render tree: the elements resolved for drawing, with styles applied, units in pixels,
useexpanded, references linked and shapes turned into paths, as resvg's usvg tree. It is immutable, so a document that is not being edited can be drawn on many threads at once.
- SvgProcessingInstruction
An XML processing instruction, such as
<?xml-stylesheet ...?>, kept so a save writes it back.
- SvgRenderOptions
How Rasterize<TPixel>(SvgRenderOptions?) and Draw(Canvas, RectF?, SvgRenderOptions?) draw a document.
- SvgResolvers
Ready resolvers for Resolver.
- SvgSaveOptions
How Save(Stream, SvgSaveOptions?) writes a document.
- SvgTextContent
Character data in an element: text or a CDATA section, kept apart so a save writes it back the same way.
- SvgTextRun
Text: one run of positioned glyphs in one font with one fill and stroke, drawn with DrawGlyphRun(GlyphRun, Vector2, Paint) so a PDF or SVG canvas keeps real text. A text element becomes a group of these and of the paths of its decorations.
- SvgWriteOptions
How SvgCanvas writes SVG: text, number precision, layout, image format and fallback resolution.
Enums
- SvgImageFormat
The format SvgCanvas embeds drawn images in.
- SvgPaintOrder
Which of a shape's fill, stroke and markers is painted first (
paint-order).
- SvgTextMode
How SvgCanvas writes text.