Svg.Custom packages the SVG DOM and parser used by the rest of the repository. It is the layer that understands SVG documents as SvgDocument, SvgElement, and related DOM types before the repository-specific model and rendering layers take over.
dotnet add package Svg.Custom
Svg.Model and Svg.Skia,Unlike most packages in this repository, Svg.Custom is packaged under the MS-PL license because it vendors and republishes the upstream SVG implementation it is built from.
If you depend on Svg.Custom directly, review that license decision alongside the rest of your dependency policy.
| Package | Namespace | Role |
|---|---|---|
Svg.Custom |
Svg |
Parsed document model and parser |
Most applications do not need to reference Svg.Custom explicitly because higher layers bring it in transitively. Direct references make sense when you want DOM access in application or tooling code.
using Svg;
using Svg.Skia;
var document = SvgDocument.Open("Assets/icon.svg");
if (document is not null)
{
Console.WriteLine($"{document.Width} x {document.Height}");
using var renderer = new SKSvg();
renderer.FromSvgDocument(document);
}
That pattern is useful when a document should be parsed once, inspected or modified, and only then rendered.
The repository wraps the vendored SVG sources with project-level concerns such as:
The rendering behavior still lives above this package, not inside it.
SvgDocument,Svg DOM and want to pair it with Svg.Skia.Svg.Custom