SharpAstro.Svg 3.35.1841

This package has a SemVer 2.0.0 package version: 3.35.1841+3d19e50454875c1b49c45881c5c87485ef60c0dd.
There is a newer version of this package available.
See the version list below for details.
dotnet add package SharpAstro.Svg --version 3.35.1841
                    
NuGet\Install-Package SharpAstro.Svg -Version 3.35.1841
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="SharpAstro.Svg" Version="3.35.1841" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SharpAstro.Svg" Version="3.35.1841" />
                    
Directory.Packages.props
<PackageReference Include="SharpAstro.Svg" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add SharpAstro.Svg --version 3.35.1841
                    
#r "nuget: SharpAstro.Svg, 3.35.1841"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package SharpAstro.Svg@3.35.1841
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=SharpAstro.Svg&version=3.35.1841
                    
Install as a Cake Addin
#tool nuget:?package=SharpAstro.Svg&version=3.35.1841
                    
Install as a Cake Tool

SharpAstro.Svg

Reads an SVG document into a resolved SharpAstro.Vector.VectorScene. It does not draw: there is no rasteriser and no font code in this package, and it is not part of the SharpAstro.Codecs pixel facade. The caller renders the scene with whatever it has.

SvgDocument document = SvgReader.Read(File.ReadAllBytes("drawing.svg"));   // .svg or .svgz
VectorScene scene = document.Scene;          // pixels at 96 to the inch, viewBox already applied
foreach (SvgIssue issue in document.Issues)  // everything the scene leaves out
    Console.WriteLine($"{issue.Kind}: {issue.What} x{issue.Count}");

Written from the W3C SVG 1.1 and SVG 2 specifications.

What is read

  • The root's width, height, viewBox and preserveAspectRatio.
  • g and a; path (every command, arcs included), rect, circle, ellipse, line, polyline, polygon.
  • transform (matrix, translate, scale, rotate, skewX, skewY).
  • Solid fill and stroke: hex, rgb(), hsl(), named colours, currentColor; fill-rule; fill-opacity, stroke-opacity, opacity; stroke-width, -linecap, -linejoin, -miterlimit, -dasharray, -dashoffset.
  • display and visibility; presentation attributes and the style attribute, inherited as CSS says.
  • Lengths in px, pt, pc, mm, cm, in, Q, em, ex (taken as half an em) and %.

In the scene every path is absolute move / line / quad / cubic / close (arcs and circles become cubics), every transform is multiplied out onto its shape, and a group appears only where opacity needs a layer.

What is not read yet

Each of these is left out of the scene and reported in SvgDocument.Issues (SvgReadOptions.ThrowOnUnsupported makes the first one an exception):

  • gradients and patterns (the fallback colour after url(...) is used, or nothing)
  • use, symbol, nested svg, switch, image, text, foreignObject
  • clip-path, mask, filter, markers, mix-blend-mode, paint-order, vector-effect
  • <style> sheets and class selectors, transform written as a CSS property, animation

XML entities are not expanded and nothing outside the document is fetched; a document that relies on an entity it declares itself (some Adobe Illustrator exports do) is refused with InvalidDataException.

Limits

SvgReadOptions bounds the characters of XML (after gzip), the element count, the nesting depth and the total number of path segments. With nothing here that can repeat content (use is not read), a scene's size is proportional to the document's.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on SharpAstro.Svg:

Package Downloads
DIR.Lib

Device-Independent input and Rendering library for .NET: surface-neutral drawing primitives, an immutable layout DSL, a widget toolkit, font rasterization (bitmap + SDF) and font fallback, shared by GPU (SDL3 + Vulkan), terminal and browser (WebGL2 / Blazor WebAssembly) front ends. Pure managed, AOT compatible, no native dependencies.

SharpAstro.Fonts

Pure-managed, MIT-licensed C# OpenType / TrueType font loader and rasterizer.

DIR.Lib.Debug

The Debug build of DIR.Lib, for Debug consumers that need the #if DEBUG types the Release DIR.Lib package does not contain (the inspector core itself is in the Release package since 11.70, off unless DIR_INSPECTOR=1 and DIR_INSPECTOR_TOKEN are set). Same version as DIR.Lib. Reference DIR.Lib when the configuration is not Debug and DIR.Lib.Debug when it is, with a Configuration-conditioned PackageReference; Visual Studio needs a restore after switching configuration.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.40.1991 44 11/18/2026
3.39.1951 239 11/17/2026
3.36.1911 117 11/16/2026
3.36.1891 54 11/16/2026
3.35.1841 34 11/16/2026