### Install Svg.Skia.Converter Global Tool Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/getting-started/installation.md Install the Svg.Skia.Converter as a global .NET tool for converting SVGs. ```bash dotnet tool install -g Svg.Skia.Converter ``` -------------------------------- ### Install .NET MAUI Workload Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/getting-started/installation.md Install the .NET MAUI workload required for the .NET MAUI lane development. ```bash dotnet workload install maui ``` -------------------------------- ### Add Svg.Editor.Skia Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/packages/svg-editor-skia.md Install the Svg.Editor.Skia NuGet package using the .NET CLI. ```bash dotnet add package Svg.Editor.Skia ``` -------------------------------- ### Install PlantUML Class Diagram Generator Tool Source: https://github.com/wieslawsoltes/svg.skia/wiki/Puml Installs the PlantUML Class Diagram Generator as a global .NET tool. Ensure you have the .NET SDK installed. ```bash dotnet tool install --global PlantUmlClassDiagramGenerator --version 1.2.0 ``` -------------------------------- ### Check Uno Platform Prerequisites Source: https://github.com/wieslawsoltes/svg.skia/blob/master/samples/UnoSvgSkiaSample/README.md Ensures the necessary Uno Platform targets are installed for desktop, web, android, and iOS development. ```bash uno-check --target desktop --target web --target android --target ios ``` -------------------------------- ### Install Svg.Skia NuGet Package (Pre-release) Source: https://github.com/wieslawsoltes/svg.skia/blob/master/README.md Installs a pre-release version of the Svg.Skia NuGet package. Use this if you need to test the latest features or bug fixes from the nightly build feed. ```powershell Install-Package Svg.Skia -Pre ``` -------------------------------- ### Install Skia.Controls.Avalonia Package (Package Manager Console) Source: https://github.com/wieslawsoltes/svg.skia/blob/master/README.md Command to add the Skia.Controls.Avalonia NuGet package using the Package Manager Console. ```powershell Install-Package Skia.Controls.Avalonia ``` -------------------------------- ### Complete Avalonia App Builder with Previewer Fix Source: https://github.com/wieslawsoltes/svg.skia/blob/master/README.md An example of the BuildAvaloniaApp() method including the necessary lines for Avalonia Previewer compatibility. ```csharp public static AppBuilder BuildAvaloniaApp() { GC.KeepAlive(typeof(SvgImageExtension).Assembly); GC.KeepAlive(typeof(Svg.Controls.Skia.Avalonia.Svg).Assembly); return AppBuilder.Configure() .UsePlatformDetect() .LogToTrace(); } ``` -------------------------------- ### Add ShimSkiaSharp Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/packages/shim-skiasharp.md Installs the ShimSkiaSharp NuGet package using the .NET CLI. ```bash dotnet add package ShimSkiaSharp ``` -------------------------------- ### Install Svg.Controls.Skia.Maui Package (Package Manager Console) Source: https://github.com/wieslawsoltes/svg.skia/blob/master/README.md Command to add the Svg.Controls.Skia.Maui NuGet package using the Package Manager Console. ```powershell Install-Package Svg.Controls.Skia.Maui ``` -------------------------------- ### Add Svg.CodeGen.Skia Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/packages/svg-codegen-skia.md Install the Svg.CodeGen.Skia package using the .NET CLI. ```bash dotnet add package Svg.CodeGen.Skia ``` -------------------------------- ### Add Svg.Editor.Core Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/packages/svg-editor-core.md Installs the Svg.Editor.Core NuGet package using the .NET CLI. ```bash dotnet add package Svg.Editor.Core ``` -------------------------------- ### Add Core Svg.Skia NuGet Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/getting-started/installation.md Install the core Svg.Skia renderer package using the .NET CLI. ```bash dotnet add package Svg.Skia ``` -------------------------------- ### Minimal Svg.Editor.Skia Setup Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/packages/svg-editor-skia.md Initialize the SvgEditorInteractionController and SvgEditorOverlayRenderer for basic SVG editing functionality. Configure interaction properties like snap-to-grid. ```csharp using Svg.Editor.Skia; var interaction = new SvgEditorInteractionController { SnapToGrid = true, GridSize = 10 }; var overlays = new SvgEditorOverlayRenderer(); ``` -------------------------------- ### Install Svg.Controls.Skia.Avalonia Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/getting-started/quickstart-avalonia.md Use this command to add the Skia-backed SVG controls package to your Avalonia project. ```bash dotnet add package Svg.Controls.Skia.Avalonia ``` -------------------------------- ### Avalonia Window Namespace Setup Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/xaml/svgml-avalonia-inline-svg.md Sets up the necessary namespaces for an Avalonia Window, including the default Avalonia namespace and the XAML namespace. ```xml ``` -------------------------------- ### Load SVG from Files, Streams, and XML Readers Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/guides/loading-svg-and-vectordrawable.md Demonstrates loading SVG content from a file path, an input stream, and an XML reader. The stream loading example shows how to provide a base URI for resolving external assets. ```csharp using System; using System.IO; using System.Xml; using Svg.Skia; using var svgFromFile = new SKSvg(); svgFromFile.Load("image.svg"); using var stream = File.OpenRead("image.svg"); using var svgFromStream = new SKSvg(); svgFromStream.Load(stream, parameters: null, baseUri: new Uri("file:///Users/me/Assets/")); using var reader = XmlReader.Create(new StringReader("")); using var svgFromReader = new SKSvg(); svgFromReader.Load(reader); ``` -------------------------------- ### Record and Inspect SkiaSharp Commands Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/packages/shim-skiasharp.md Demonstrates recording drawing commands using SKPictureRecorder and then iterating through the recorded commands for inspection. This example shows how to create a path, set paint style, draw the path, and access the commands from the resulting SKPicture. ```csharp using System; using ShimSkiaSharp; var recorder = new SKPictureRecorder(); var canvas = recorder.BeginRecording(SKRect.Create(64, 64)); var path = new SKPath(); path.AddRect(SKRect.Create(8, 8, 48, 48)); var paint = new SKPaint { Style = SKPaintStyle.Fill }; canvas.DrawPath(path, paint); var picture = recorder.EndRecording(); foreach (var command in picture.Commands ?? Array.Empty()) { Console.WriteLine(command.GetType().Name); } ``` -------------------------------- ### Compose Editor UI with Avalonia XAML Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/editor/composing-panels-and-dialogs.md Example XAML demonstrating the composition of reusable editor controls like DocumentOutlineView, SvgEditorSurface, and PropertyInspectorView within a Grid layout. This setup requires binding to SvgEditorSession and other services. ```xml ``` -------------------------------- ### Serve Documentation Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/getting-started/installation.md Execute the script to serve the project's documentation locally. ```bash ./serve-docs.sh ``` -------------------------------- ### Build Documentation Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/getting-started/installation.md Execute the script to build the project's documentation. ```bash ./build-docs.sh ``` -------------------------------- ### Build UnoSvgSkiaSample for Desktop Source: https://github.com/wieslawsoltes/svg.skia/blob/master/samples/UnoSvgSkiaSample/README.md Builds the sample application in Release configuration for the .NET 10.0 desktop target. ```bash dotnet build -c Release -f net10.0-desktop ``` -------------------------------- ### Build Uno Sample for Desktop Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/advanced/uno-sample-publishing.md Builds the Uno sample application for the desktop target using .NET 10.0. ```bash dotnet build samples/UnoSvgSkiaSample/UnoSvgSkiaSample.csproj -c Release -f net10.0-desktop ``` -------------------------------- ### Format and Build Solution Source: https://github.com/wieslawsoltes/svg.skia/blob/master/AGENTS.md Before committing renderer or baseline changes, format the solution, build it, and run all tests. ```bash dotnet format Svg.Skia.slnx --no-restore dotnet build Svg.Skia.slnx -c Release dotnet test Svg.Skia.slnx -c Release ``` -------------------------------- ### Run Basic Validation and Build Source: https://github.com/wieslawsoltes/svg.skia/blob/master/plan/remaining-standards-test-roadmap.md Execute formatting checks, build the solution in Release mode, and run specific unit tests. ```sh dotnet format Svg.Skia.slnx --no-restore --verify-no-changes dotnet build Svg.Skia.slnx -c Release --no-restore dotnet test tests/Svg.Skia.UnitTests/Svg.Skia.UnitTests.csproj -f net10.0 -c Release --no-build --filter "FullyQualifiedName~W3CTestSuiteTests.Tests" dotnet test Svg.Skia.slnx -c Release --no-build ``` -------------------------------- ### Install Svg.Skia NuGet Package (Package Manager Console) Source: https://github.com/wieslawsoltes/svg.skia/blob/master/README.md Installs the Svg.Skia NuGet package using the Package Manager Console in Visual Studio. This command is equivalent to the dotnet CLI command. ```powershell Install-Package Svg.Skia ``` -------------------------------- ### Build the Solution Source: https://github.com/wieslawsoltes/svg.skia/blob/master/AGENTS.md Builds the Svg.Skia solution in Release configuration. ```bash dotnet build Svg.Skia.slnx -c Release ``` -------------------------------- ### Build Uno Sample for Android Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/advanced/uno-sample-publishing.md Builds the Uno sample application for Android using .NET 10.0. ```bash dotnet build samples/UnoSvgSkiaSample/UnoSvgSkiaSample.csproj -c Release -f net10.0-android ``` -------------------------------- ### Add Svg.SourceGenerator.Skia NuGet Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/getting-started/installation.md Install the source generator package for Svg.Skia. ```bash dotnet add package Svg.SourceGenerator.Skia ``` -------------------------------- ### Add Svg.Editor.Svg Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/packages/svg-editor-svg.md Install the Svg.Editor.Svg NuGet package using the .NET CLI. ```bash dotnet add package Svg.Editor.Svg ``` -------------------------------- ### Publish UnoSvgSkiaSample for WebAssembly Source: https://github.com/wieslawsoltes/svg.skia/blob/master/samples/UnoSvgSkiaSample/README.md Publishes the sample application in Release configuration for the .NET 10.0 browser WebAssembly target. ```bash dotnet publish -c Release -f net10.0-browserwasm ``` -------------------------------- ### Publish Uno Sample for WebAssembly Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/advanced/uno-sample-publishing.md Publishes the Uno sample application for WebAssembly using .NET 10.0. ```bash dotnet publish samples/UnoSvgSkiaSample/UnoSvgSkiaSample.csproj -c Release -f net10.0-browserwasm ``` -------------------------------- ### Install Svg.Controls.Avalonia Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/getting-started/quickstart-avalonia.md Use this command to add the drawing-stack SVG controls package to your Avalonia project. ```bash dotnet add package Svg.Controls.Avalonia ``` -------------------------------- ### Add Svg.Editor.Skia.Avalonia Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/editor/embedding-workspace.md Install the necessary NuGet package to use the SvgEditorWorkspace in your Avalonia project. ```bash dotnet add package Svg.Editor.Skia.Avalonia ``` -------------------------------- ### Build Uno Sample for iOS on macOS Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/advanced/uno-sample-publishing.md Builds the Uno sample application for iOS on macOS using .NET 10.0. ```bash dotnet build samples/UnoSvgSkiaSample/UnoSvgSkiaSample.csproj -c Release -f net10.0-ios ``` -------------------------------- ### Run Wrapped Text Length Benchmarks (Direct Placement) Source: https://github.com/wieslawsoltes/svg.skia/blob/master/PR_SUMMARY_resvg_resource_parity_performance.md Execute benchmarks for wrapped text length with direct group placements. Ensure to set the appropriate environment variables and filters. ```bash SVG_SKIA_BENCHMARK_SCENARIOS=text-regression-wrapped-textlength-positioned-descendants SVG_SKIA_BENCHMARK_RUN_LABEL=current-wrapped-textlength-direct-group-placements dotnet run -c Release -f net10.0 --project tests/Svg.Skia.Benchmarks/Svg.Skia.Benchmarks.csproj -- --filter "*SvgTextRegressionValidationBenchmarks*" --warmupCount 3 --minIterationCount 6 --maxIterationCount 12 ``` -------------------------------- ### Install Svg.Skia.JavaScript Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/packages/svg-skia-javascript.md Add the Svg.Skia.JavaScript NuGet package to your .NET project using the dotnet CLI. ```bash dotnet add package Svg.Skia.JavaScript ``` -------------------------------- ### Add General-purpose Skia Controls for Avalonia NuGet Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/getting-started/installation.md Install general-purpose Skia controls for Avalonia applications. ```bash dotnet add package Skia.Controls.Avalonia ``` -------------------------------- ### Serve Docs PowerShell Script Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/reference/lunet-docs-pipeline.md Execute this PowerShell script from the repository root to serve the documentation site locally. ```powershell ./serve-docs.ps1 ``` -------------------------------- ### Add Uno Control Svg.Skia NuGet Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/getting-started/installation.md Install the Svg.Skia control package for Uno Platform applications. ```bash dotnet add package Svg.Controls.Skia.Uno ``` -------------------------------- ### Add Avalonia Inline SVG Authoring NuGet Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/getting-started/installation.md Install the package for inline SVG authoring in Avalonia XAML. ```bash dotnet add package SvgML.Avalonia ``` -------------------------------- ### Run Constructor Benchmark for SceneDocument Creation Source: https://github.com/wieslawsoltes/svg.skia/blob/master/PR_SUMMARY_resvg_resource_parity_performance.md Executes a benchmark specifically for the creation of SceneDocument from a compiled tree, using various generated scenarios. Ensure environment variables are set. ```bash SVG_SKIA_BENCHMARK_SCENARIOS=generated-shapes-1024,generated-filtered-shapes-256,generated-text-192,generated-inline-styles-512 SVG_SKIA_BENCHMARK_RUN_LABEL=on-demand-roots-scenedoc-create dotnet run -c Release -f net10.0 --project tests/Svg.Skia.Benchmarks/Svg.Skia.Benchmarks.csproj -- --filter "*SvgRetainedSceneCompileBenchmarks.CreateSceneDocumentFromCompiledTree*" --warmupCount 1 --minIterationCount 2 --maxIterationCount 3 ``` -------------------------------- ### Add .NET MAUI Control Svg.Skia NuGet Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/getting-started/installation.md Install the Svg.Skia control package for .NET MAUI applications. ```bash dotnet add package Svg.Controls.Skia.Maui ``` -------------------------------- ### Install SvgML.Maui Package (Package Manager Console) Source: https://github.com/wieslawsoltes/svg.skia/blob/master/README.md Command to add the SvgML.Maui NuGet package using the Package Manager Console. ```powershell Install-Package SvgML.Maui ``` -------------------------------- ### Add Svg.Custom Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/packages/svg-custom.md Install the Svg.Custom package using the .NET CLI. This command adds the necessary dependency to your project file. ```bash dotnet add package Svg.Custom ``` -------------------------------- ### Initialize and Use SvgEditorSession Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/packages/svg-editor-core.md Demonstrates creating an SvgEditorSession, setting its title and current tool, selecting elements, and pushing an undo state. This session manages the core mutable state of the SVG editor. ```csharp using Svg.Editor.Core; const string previousXml = ""; var session = new SvgEditorSession { WorkspaceTitle = "My SVG Editor", CurrentTool = SvgEditorToolKind.Select }; session.SetSelectedElementIds(new[] { "logo", "shadow" }); session.PushUndoState(previousXml); ``` -------------------------------- ### Run Wrapped Text Length Benchmarks (Baseline) Source: https://github.com/wieslawsoltes/svg.skia/blob/master/PR_SUMMARY_resvg_resource_parity_performance.md Execute baseline benchmarks for wrapped text length and exact groups. Ensure to set the appropriate environment variables and filters. ```bash SVG_SKIA_BENCHMARK_SCENARIOS=text-regression-wrapped-textlength-positioned-descendants SVG_SKIA_BENCHMARK_RUN_LABEL=current-before-wrapped-textlength-exact-groups dotnet run -c Release -f net10.0 --project tests/Svg.Skia.Benchmarks/Svg.Skia.Benchmarks.csproj -- --filter "*SvgTextRegressionValidationBenchmarks*" --warmupCount 3 --minIterationCount 6 --maxIterationCount 12 ``` -------------------------------- ### Run Benchmark: Current Model Local Metadata Cache Exact Source: https://github.com/wieslawsoltes/svg.skia/blob/master/PR_SUMMARY_resvg_resource_parity_performance.md Benchmark the current model with exact local metadata caching. This command sets up the environment for comparison. ```bash SVG_SKIA_BENCHMARK_RUN_LABEL="current-model-localmetadata-cache-exact" SVG_SKIA_BENCHMARK_SCENARIOS="generated-text-path-curves-96,generated-text-192,generated-aligned-letter-spacing-192" dotnet run -c Release --project tests/Svg.Skia.Benchmarks/Svg.Skia.Benchmarks.csproj -- --filter "*SvgLoadPipelineBenchmarks.CreateShimPictureModel*" ``` -------------------------------- ### Benchmark Text Path Sample Capacity Source: https://github.com/wieslawsoltes/svg.skia/blob/master/PR_SUMMARY_resvg_resource_parity_performance.md Runs benchmarks for text path sample capacity, specifically SvgTextPathPlacementBenchmarks. Uses specific scenarios and a run label. Targets .NET 10.0 in Release mode. ```bash SVG_SKIA_BENCHMARK_SCENARIOS=generated-text-path-curves-96 SVG_SKIA_BENCHMARK_RUN_LABEL=current-text-path-sample-capacity dotnet run -c Release -f net10.0 --project tests/Svg.Skia.Benchmarks/Svg.Skia.Benchmarks.csproj -- --filter "*SvgTextPathPlacementBenchmarks*" --warmupCount 3 --minIterationCount 6 --maxIterationCount 12 ``` -------------------------------- ### Local Build and Test Commands Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/advanced/build-and-package.md Commands for updating submodules, formatting code, building, and testing the Svg.Skia solution locally. ```bash git submodule update --init --recursive dotnet format --no-restore dotnet build Svg.Skia.slnx -c Release dotnet test Svg.Skia.slnx -c Release ``` -------------------------------- ### Check Docs Script Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/reference/lunet-docs-pipeline.md Execute this script from the repository root to check the documentation site. ```bash ./check-docs.sh ``` -------------------------------- ### Add Svg.SceneGraph Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/packages/svg-scenegraph.md Installs the Svg.SceneGraph NuGet package using the .NET CLI. Use this command in your project directory to add the dependency. ```bash dotnet add package Svg.SceneGraph ``` -------------------------------- ### Add Svg.Animation Package Source: https://github.com/wieslawsoltes/svg.skia/blob/master/site/articles/packages/svg-animation.md Install the Svg.Animation NuGet package using the .NET CLI. This command adds the package reference to your project file. ```bash dotnet add package Svg.Animation ```