Code Monkey home page Code Monkey logo

svg.skia's Introduction

Svg.Skia

Gitter

Build Status CI

NuGet NuGet MyGet

GitHub release Github All Releases Github Releases

Svg.Skia is an SVG rendering library.

About

Svg.Skia can be used as a .NET library or as a CLI application to render SVG files based on a static SVG Full 1.1 subset to raster images or to a backend's canvas.

The Svg.Skia is using SVG library to load Svg object model.

The Svg.Skia library is implemented using the SkiaSharp rendering backend that aims to be on par or more complete than the original System.Drawing implementation and more performant and cross-platform.

The Svg.Skia can be used in same way as the SkiaSharp.Extended.Svg (load svg files as SKPicture).

The Svg library has a more complete implementation of the Svg document model than SkiaSharp.Extended.Svg and the Svg.Skia renderer will provide more complete rendering subsystem implementation.

NuGet

Svg.Skia is delivered as a NuGet package.

You can find the packages here NuGet and install the package like this:

Install-Package Svg.Skia

or by using nightly build feed:

  • Add https://www.myget.org/F/svgskia-nightly/api/v2 to your package sources
  • Alternative nightly build feed https://pkgs.dev.azure.com/wieslawsoltes/GitHub/_packaging/Nightly/nuget/v3/index.json
  • Update your package using Svg.Skia feed

and install the package like this:

Install-Package Svg.Skia -Pre

Usage

Library

Install Package

dotnet add package Svg.Skia
Install-Package Svg.Skia

Draw on Canvas

using SkiaSharp;
using Svg.Skia;

var svg = new SKSvg();

svg.Load("image.svg");

SKCanvas canvas = ...
canvas.DrawPicture(svg.Picture);

Save as Png

using SkiaSharp;
using Svg.Skia;

using (var svg = new SKSvg())
{
    if (svg.Load("image.svg") is { })
    {
        svg.Save("image.png", SKEncodedImageFormat.Png, 100, 1f, 1f);
    }
}
using System.IO;
using SkiaSharp;
using Svg.Skia;

using (var svg = new SKSvg())
{
    if (svg.Load("image.svg") is { })
    {
        using (var stream = File.OpenWrite("image.png"))
        {
            svg.Picture.ToImage(stream, SKColors.Empty, SKEncodedImageFormat.Png, 100, 1f, 1f);
        }
    }
}
using SkiaSharp;
using Svg.Skia;

using (var svg = new SKSvg())
{
    if (svg.Load("image.svgz") is { })
    {
        svg.Save("image.png", SKEncodedImageFormat.Png, 100, 1f, 1f);
    }
}
using System.IO;
using SkiaSharp;
using Svg.Skia;

using (var svg = new SKSvg())
{
    if (svg.Load("image.svgz") is { })
    {
        using (var stream = File.OpenWrite("image.png"))
        {
            svg.Picture.ToImage(stream, SKColors.Empty, SKEncodedImageFormat.Png, 100, 1f, 1f);
        }
    }
}

Save as Pdf

using SkiaSharp;
using Svg.Skia;

using (var svg = new SKSvg())
{
    if (svg.Load("image.svg") is { })
    {
        svg.Picture.ToPdf("image.pdf", SKColors.Empty, 1f, 1f);
    }
}

Save as Xps

using SkiaSharp;
using Svg.Skia;

using (var svg = new SKSvg())
{
    if (svg.Load("image.svg") is { })
    {
        svg.Picture.ToXps("image.xps", SKColors.Empty, 1f, 1f);
    }
}

AvaloniaUI

Install Package

dotnet add package Avalonia.Svg.Skia
Install-Package Avalonia.Svg.Skia

Svg control

<Svg Path="/Assets/__AJ_Digital_Camera.svg"/>

Image control

<Image Source="{SvgImage /Assets/__AJ_Digital_Camera.svg}"/>

CSS styling

<Svg Path="/Assets/__tiger.svg" 
     Css=".Black { fill: #FF0000; }"  />
<Style Selector="Svg">
  <Setter Property="(Svg.Css)" Value=".Black { fill: #FF0000; }" />
</Style>
<SvgSource x:Key="TigerIcon"
           Path="/Assets/__tiger.svg"
           Css=".Black { fill: #FF0000; }" />
<Image>
  <Image.Source>
    <SvgImage Source="{DynamicResource TigerIcon}" />
  </Image.Source>
</Image>
<Image>
  <Image.Source>
    <SvgImage Source="/Assets/__tiger.svg" Css=".Black { fill: #FF0000; }" />
  </Image.Source>
</Image>

Avalonia Previewer

To make controls work with Avalonia Previewer please add the following lines to BuildAvaloniaApp() method:

GC.KeepAlive(typeof(SvgImageExtension).Assembly);
GC.KeepAlive(typeof(Avalonia.Svg.Skia.Svg).Assembly);

The BuildAvaloniaApp() should look similar to this:

public static AppBuilder BuildAvaloniaApp()
{
    GC.KeepAlive(typeof(SvgImageExtension).Assembly);
    GC.KeepAlive(typeof(Avalonia.Svg.Skia.Svg).Assembly);
    return AppBuilder.Configure<App>()
        .UsePlatformDetect()
        .LogToTrace();
}

This is know issue as previewer not always loads all dependencies, especially custom controls in Avalonia xmlns, other solution would be to add xmlns prefix to control with provided assembly path.

AvaloniaUI SkiaSharp Controls

Install Package

dotnet add package Avalonia.Controls.Skia
Install-Package Avalonia.Controls.Skia

Canvas

Usage:

<SKCanvasControl Name="CanvasControl" />
CanvasControl.Draw += (_, e) =>
{
    e.Canvas.DrawRect(SKRect.Create(0f, 0f, 100f, 100f), new SKPaint { Color = SKColors.Aqua });
};

Command-line tool

dotnet tool install -g Svg.Skia.Converter
Svg.Skia.Converter:
  Converts a svg file to an encoded bitmap image.

Usage:
  Svg.Skia.Converter [options]

Options:
  -f, --inputFiles <inputfiles>              The relative or absolute path to the input files
  -d, --inputDirectory <inputdirectory>      The relative or absolute path to the input directory
  -o, --outputDirectory <outputdirectory>    The relative or absolute path to the output directory
  --outputFiles <outputfiles>                The relative or absolute path to the output files
  -p, --pattern <pattern>                    The search string to match against the names of files in the input directory
  --format <format>                          The output image format
  -q, --quality <quality>                    The output image quality
  -b, --background <background>              The output image background
  -s, --scale <scale>                        The output image horizontal and vertical scaling factor
  --scaleX, -sx <scalex>                     The output image horizontal scaling factor
  --scaleY, -sy <scaley>                     The output image vertical scaling factor
  --systemLanguage <systemlanguage>          The system language name as defined in BCP 47
  --quiet                                    Set verbosity level to quiet
  -c, --load-config <load-config>            The relative or absolute path to the config file
  --save-config <save-config>                The relative or absolute path to the config file
  --version                                  Show version information
  -?, -h, --help                             Show help and usage information

Supported formats: png, jpg, jpeg, webp, pdf, xps

SVG to C# Compiler

About

SVGC compiles SVG drawing markup to C# using SkiaSharp as rendering engine. SVGC can be also used as codegen for upcoming C# 9 Source Generator feature.

Demo

Source Generator Usage

Add NuGet package reference to your csproj.

<PropertyGroup>
  <OutputType>Exe</OutputType>
  <TargetFramework>net6.0</TargetFramework>
  <LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
  <PackageReference Include="Svg.SourceGenerator.Skia" Version="0.5.0" />
</ItemGroup>

Include svg assets file in your csproj.

<ItemGroup>
  <AdditionalFiles Include="Assets/Sample.svg" NamespaceName="Assets" ClassName="Sample" />
</ItemGroup>

Use generated SKPicture using static Picture property from Sample class.

using SkiaSharp;
using Assets;

public void Draw(SKCanvas canvas)
{
    canvas.DrawPicture(Sample.Picture);
}

Avalonia Usage

csproj

<ItemGroup>
  <AdditionalFiles Include="Assets/__tiger.svg" NamespaceName="AvaloniaSample" ClassName="Tiger" />
</ItemGroup>
<ItemGroup>
  <PackageReference Include="Svg.SourceGenerator.Skia" Version="0.5.0" />
  <PackageReference Include="Avalonia.Controls.Skia" Version="0.5.0" />
</ItemGroup>

xaml

<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:AvaloniaSample;assembly=AvaloniaSample"
        xmlns:skp="clr-namespace:Avalonia.Controls.Skia;assembly=Avalonia.Controls.Skia"
        mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
        Width="900" Height="650" WindowStartupLocation="CenterScreen"
        x:Class="AvaloniaSample.MainWindow"
        Title="AvaloniaSample">
    <Window.Resources>
        <skp:SKPictureImage x:Key="TigeImage" Source="{x:Static local:Tiger.Picture}" />
    </Window.Resources>
    <Grid>
        <Image Source="{StaticResource TigeImage}" />
    </Grid>
</Window>

svgc Usage

svgc:
  Converts a svg file to a C# code.

Usage:
  svgc [options]

Options:
  -i, --inputFile <inputfile>      The relative or absolute path to the input file [default: ]
  -o, --outputFile <outputfile>    The relative or absolute path to the output file [default: ]
  -j, --jsonFile <jsonfile>        The relative or absolute path to the json file [default: ]
  -n, --namespace <namespace>      The generated C# namespace name [default: Svg]
  -c, --class <class>              The generated C# class name [default: Generated]
  --version                        Show version information
  -?, -h, --help                   Show help and usage information

Json File Format

[
    { "InputFile":"file1.svg", "OutputFile":"file1.svg.cs", "Class":"ClassName1", "Namespace":"NamespaceName" },
    { "InputFile":"file2.svg", "OutputFile":"file2.svg.cs", "Class":"ClassName2", "Namespace":"NamespaceName" }
]

Links

Build

To build the projects you need to install .NET 5.0 version SDK 5.0.100.

git clone [email protected]:wieslawsoltes/Svg.Skia.git
cd Svg.Skia
git submodule update --init --recursive
dotnet build -c Release

Publish Managed

cd ./src/Svg.Skia.Converter
dotnet publish -c Release -f net6.0 -r win7-x64 /p:PublishTrimmed=True /p:PublishReadyToRun=True -o Svg.Skia.Converter_net6.0_win7-x64
cd ./src/Svg.Skia.Converter
dotnet publish -c Release -f net6.0 -r ubuntu.14.04-x64 /p:PublishTrimmed=True /p:PublishReadyToRun=True -o Svg.Skia.Converter_net6.0_ubuntu.14.04-x64
cd ./src/Svg.Skia.Converter
dotnet publish -c Release -f net6.0 -r osx.10.12-x64 /p:PublishTrimmed=True /p:PublishReadyToRun=True -o Svg.Skia.Converter_net6.0_osx.10.12-x64
cd ./src/Svg.Skia.Converter
dotnet publish -c Release -f net6.0 -r debian.8-x64 /p:PublishTrimmed=True /p:PublishReadyToRun=True -o Svg.Skia.Converter_net6.0_debian.8-x64
cd ./src/SvgToPng
dotnet publish -c Release -f net6.0 -r win7-x64 -o SvgToPng_net6.0_win7-x64
cd ./src/SvgXml.Diagnostics
dotnet publish -c Release -f net6.0 -r win7-x64 -o SvgXml.Diagnostics_net6.0_win7-x64

Publish Native

cd ./src/Svg.Skia.Converter
dotnet publish -c Release -f net6.0 -r win-x64 -o Svg.Skia.Converter_net6.0_win-x64
cd ./src/Svg.Skia.Converter
dotnet publish -c Release -f net6.0 -r linux-x64 -o Svg.Skia.Converter_net6.0_linux-x64
cd ./src/Svg.Skia.Converter
dotnet publish -c Release -f net6.0 -r osx-x64 -o Svg.Skia.Converter_net6.0_osx-x64

Externals

The Svg.Skia library is using code from the https://github.com/vvvv/SVG

License

Parts of Svg.Skia source code are adapted from the https://github.com/vvvv/SVG

Svg.Skia is licensed under the MIT license.

svg.skia's People

Contributors

atjn avatar batboa avatar danipen avatar fornever avatar happypig375 avatar iamcarbon avatar kim-ssi avatar mattleibow avatar punker76 avatar romankalachik avatar wieslawsoltes avatar youssef1313 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

svg.skia's Issues

Svg.Skia does not work with UWP, in release builds

Not sure why you've closed the issue 'XamarinFormsDemo.UWP does not work in Release (Solution Configuration)' without a resolution. It's blocking for me.

It means that your library works fine with Debug builds, but when you build a UWP project for Release (which means the Native .Net toolchain is used), you get code that always throws a Type Initialization Exception, from this code:

using (SKSvg svg = new SKSvg())
{
  SKPicture pic = svg.FromSvg(svgText);
}

It's happening because some code in the SVG library is calling an interop that is illegal in UWP. The interop is called from GetSystemDpi() in SvgDocument.cs. A potential work-around would be to edit your implementation code in svg.custom, so as to avoid calling the illegal interop.

[ UWP ] System.NullReferenceException: "Object reference not set to an instance of an object."

Happens only in Release mode. It looks like a bug in the .net native at first glance.

MCVE

<skia:SKCanvasView
    HorizontalOptions="FillAndExpand"
    PaintSurface="OnPaintSurface"
    VerticalOptions="FillAndExpand" />
public partial class MainPage : ContentPage
{
    private readonly SKPicture picture;
    private readonly string svg = "<svg xmlns=\"http://www.w3.org/2000/svg\"><g id = \"moti\" fill=\"white\" stroke=\"green\" stroke-width=\"5\"><circle cx = \"40\" cy=\"40\" r=\"25\" /><circle cx = \"60\" cy=\"60\" r=\"25\" /></g></svg>";
    public MainPage()
    {
        InitializeComponent();
        var ba = Encoding.UTF8.GetBytes(svg);
        var sr = new MemoryStream(ba);
        var sksvg = new SKSvg();
        picture = sksvg.Load(sr);
    }

    private void OnPaintSurface(object sender, SKPaintSurfaceEventArgs e)
    {
        var canvas = e.Surface.Canvas;
        var scale = (float)(e.Info.Width / skiaView.Width);
        canvas.Scale(scale);
        canvas.Clear(SKColors.White);

        canvas.DrawPicture(picture);
    }
}

caused by

descriptor.Converter.ConvertFrom(document, CultureInfo.InvariantCulture, attributeValue)

here

It doesn't like id = \"moti\" for some reason.

Problem installing this

I get this error when I try to install this package in VS 2017 nuget. Any suggestions?

Attempting to gather dependency information for package 'Svg.Skia.0.4.1' with respect to project 'SVG-Draw', targeting '.NETFramework,Version=v4.0'
Gathering dependency information took 16.02 ms
Attempting to resolve dependencies for package 'Svg.Skia.0.4.1' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'Svg.Skia.0.4.1'
Resolved actions to install package 'Svg.Skia.0.4.1'
Retrieving package 'Svg.Skia 0.4.1' from 'nuget.org'.
Install failed. Rolling back...
Package 'Svg.Skia.0.4.1' does not exist in project 'SVG-Draw'
Package 'Svg.Skia.0.4.1' does not exist in folder 'C:\Work\SVG-Stuff\packages'
Executing nuget actions took 191.58 ms
install-package : Could not install package 'Svg.Skia 0.4.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', but the package 
does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
At line:1 char:1
+ install-package Svg.Skia
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Add support writing-mode: vertical-rl and special CJK vertical glyphs

var svg = new SKSvg(); svg.FromSvg("<svg width=\"400\" height=\"400\"> <text x=\"100\" y=\"120\" style=\"writing-mode: vertical-rl\">Hallo wereld ๆ—ฅใŒ€ใŒƒ</text> </svg>");

svg_sample_in_html.zip

Notice how horizontal and vertical Japanese characters are rendered differently.

cjk_vertical_glyph

Also notice additional text-orientation option: upright

<text x="180" y="120" style="writing-mode: vertical-rl; text-orientation: upright">Hello ๆ—ฅใŒ€ใŒƒ</text>

cjk_vertical_glyph2

Defining SVG color

With CSS it is possible to define the color of SVGs via the fill property - would be nice having that here as well.

.NET Standard 1.3?

Since the base SkiaSharp supports .NET Standard 1.3 is there anything here that requires the minimum to be .NET Standard 2.0?

Just curious. I'm currently targeting 1.3 using SkiaSharp as that's what it's min is, and I currently don't have a need to bump it up yet.

Use xml code instead of svg file?

Is there a way to use the xml code instead of a svg file? I'm working on a live editing tool and it will be pretty handy for me to just use the xml text instead of the svg file since my project requires binding between css and xml to edit the svg,

Thanks!

XamarinFormsDemo.UWP does not work in Release (Solution Configuration)

XamarinFormsDemo.UWP does not work in Release (Solution Configuration)

The reason is that The libraries get Native Compiled and in the SVGDocument there are some Interops that are not allowed in UWP apps.

So In Debug (Solution Configuration) it doesn't enforce it but in Release it does. And the App doesn't work.

Code File
https://github.com/vvvv/SVG/blob/master/Source/SvgDocument.cs

Problematic Code

       private static int GetSystemDpi()
        {
            bool isWindows;

#if NETCORE
            isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
#else
            var platform = Environment.OSVersion.Platform;
            isWindows = platform == PlatformID.Win32NT; 
#endif

            if (isWindows)
            {
                // NOTE: starting with Windows 8.1, the DPI is no longer system-wide but screen-specific
                IntPtr hDC = GetDC(IntPtr.Zero);
                const int LOGPIXELSY = 90;
                int result = GetDeviceCaps(hDC, LOGPIXELSY);
                ReleaseDC(IntPtr.Zero, hDC);
                return result;
            }
            else
            {
                // hack for macOS and Linux
                return 96;
            }
        }

        [DllImport("gdi32.dll")]
        private static extern int GetDeviceCaps(IntPtr hdc, int nIndex);

        // isn't allowed in UWP Store Apps
        [DllImport("user32.dll")]
        private static extern IntPtr GetDC(IntPtr hWnd);

        // isn't allowed in UWP Store Apps
        [DllImport("user32.dll")]
        private static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);

I would Suggest to Implement a Class called PlatformSupport, With an Instance Property where You could Implement Functions like GetSystemDpi the default Implementation would be the current one
But it would be possible to Implement different Implementations for UWP Xamarin.Forms Linux Mac .....

Something like this.

using System;
using System.Runtime.InteropServices;

public static class PlatformSupport
{
    public static IPlatformSupport Instance { get; set; } = new DefaultPlatformSupport();
}

public interface IPlatformSupport
{
    int GetSystemDpi();
}

public class DefaultPlatformSupport: IPlatformSupport
{
    public int GetSystemDpi()
    {
        bool isWindows;

#if NETCORE
            isWindows = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
#else
        var platform = Environment.OSVersion.Platform;
        isWindows = platform == PlatformID.Win32NT; 
#endif

        if (isWindows)
        {
            // NOTE: starting with Windows 8.1, the DPI is no longer system-wide but screen-specific
            IntPtr hDC = GetDC(IntPtr.Zero);
            const int LOGPIXELSY = 90;
            int result = GetDeviceCaps(hDC, LOGPIXELSY);
            ReleaseDC(IntPtr.Zero, hDC);
            return result;
        }
        else
        {
            // hack for macOS and Linux
            return 96;
        }
    }

    [DllImport("gdi32.dll")]
    private static extern int GetDeviceCaps(IntPtr hdc, int nIndex);

    // isn't allowed in UWP Store Apps
    [DllImport("user32.dll")]
    private static extern IntPtr GetDC(IntPtr hWnd);

    // isn't allowed in UWP Store Apps
    [DllImport("user32.dll")]
    private static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);
}

Later Other Methods could be implemented like EnsureSystemIsGdiPlusCapable

Move to svg-net organization?

This has been discussed while discussing the creation of svg-net. It would help to co-ordinate efforts, make the projects more visible, and use some of the additional features of organizations.

Technically, this would mean transferring ownership to one of the admins of the organization, who in turn would make the current owner admin of the repo and the organization.
After the transfer, any URLs in the documentation pointing to the repository have to be adapted.
A redirect in GitHub will automatically be created.

cc @tebjan

(I have just done the same with a small repo of my own, so that reminded me...)

Avalonia.Svg control gradient not working

Hello,
I want to use the Avalonia control to show some svg images with gradients for example this search bar
<Svg Path="resm:NoodleManagerX.Assets.icons.searchbar.svg" Height="2" Width="200" Stretch="Fill"/>
Instead of the gradient only the first color is used for the whole thing.
Is there a trick to get it to work?

Also another question, since installing the package the designer doesn't load anymore. Is there a way to make it work again?

Fonts on Android

Wondering how to display SVGs with fonts on Android.

We tried using font-family="Arial, sans-serif", and font-family="Roboto", but none of these are getting picked up on Xamarin.Android.

Font specifications and fallbacks seem to work fine on UWP.

cc: @kevcrooks

Invalid cast when applying blur filter to `DeepCopy`ed document

Hello! First of all, thank you very much for this project, it is being super helpful so far!

I'm using version 0.2.0 built for .NET 4.5.2 in Unity 2019.3.12f1 on a Windows 10 64-bit computer.

I have hit a bit of a snag however, when trying to run some filters, from the following file:

<svg version="1.1">
  <defs>
    <filter id="shadow">
      <feFlood result="flood" flood-color="#000"/>
      <feComposite in="flood" in2="SourceGraphic" operator="in" result="mask"/>
      <feGaussianBlur stdDeviation="1" result="blur"/>
      <feComposite in="SourceGraphic" in2="blur" operator="over"/>
    </filter>
  </defs>
  <g fill="white" filter="shadow">
    <rect width="100%" rx="30"/>
  </g>
</svg>

(never mind the lack of dimensions, in my actual code I modify the document to add them in, but the error happens even if I don't)

And the minimum snippet that causes the error:

using (var stream = new MemoryStream(SOME_XML_BYTES)) {
    var document = SvgDocument.Open<SvgDocument>(stream);
    // There is a reason I copy the document in the actual code,
    // but when removing any changes I make after copying, the error ocurrs.
    document = (SvgDocument) document.DeepCopy<SvgDocument>();
    var svg = new SKSvg();
    var picture = svg.FromSvgDocument(document);
}

The stack trace itself:

InvalidCastException: Specified cast is not valid.
(wrapper castclass) System.Object.__castclass_with_cache(object,intptr,intptr)
Svg.SvgAttributeCollection.GetInheritedAttribute[TAttributeType] (System.String attributeName, System.Boolean inherited, TAttributeType defaultValue) (at <8a0b87b8dbca46c98e0795fe55724ba8>:0)
Svg.SvgElement.GetAttribute[TAttributeType] (System.String attributeName, System.Boolean inherited, TAttributeType defaultValue) (at <8a0b87b8dbca46c98e0795fe55724ba8>:0)
Svg.FilterEffects.SvgGaussianBlur.get_StdDeviation () (at <8a0b87b8dbca46c98e0795fe55724ba8>:0)
Svg.Skia.SvgFiltersExtensions.CreateBlur (Svg.FilterEffects.SvgGaussianBlur svgGaussianBlur, SkiaSharp.SKRect skBounds, Svg.SvgCoordinateUnits primitiveUnits, SkiaSharp.SKImageFilter input, SkiaSharp.SKImageFilter+CropRect cropRect) (at <09571fc163a24a0490ab54096d3a8906>:0)
Svg.Skia.SvgFiltersExtensions.GetFilterSKPaint (Svg.SvgVisualElement svgVisualElement, SkiaSharp.SKRect skBounds, Svg.Skia.IFilterSource filterSource, Svg.Skia.CompositeDisposable disposable, System.Boolean& isValid) (at <09571fc163a24a0490ab54096d3a8906>:0)
Svg.Skia.Drawable.PostProcess () (at <09571fc163a24a0490ab54096d3a8906>:0)
Svg.Skia.DrawableContainer.PostProcess () (at <09571fc163a24a0490ab54096d3a8906>:0)
Svg.Skia.FragmentDrawable.PostProcess () (at <09571fc163a24a0490ab54096d3a8906>:0)
Svg.Skia.SKSvg.ToPicture (Svg.SvgFragment svgFragment) (at <09571fc163a24a0490ab54096d3a8906>:0)
Svg.Skia.SKSvg.FromSvgDocument (Svg.SvgDocument svgDocument) (at <09571fc163a24a0490ab54096d3a8906>:0)

(I've snipped the bottom of the stack trace to not include my methods for brevity)

Is the library compatible with Xamarin.Forms?

Hi,

is this library compatible with Xamarin.Forms? So far I could not make it work.

<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Miele.Libraries.UiComponents.Sandbox.ImagesPage"
             xmlns:svg="clr-namespace:Svg.Skia.Avalonia;assembly=Svg.Skia.Avalonia">
    <ContentPage.Resources>
        <svg:SvgImage x:Key="__tiger" Source="/Assets/__tiger.svg"/>
    </ContentPage.Resources>
    <ContentPage.Content>
        <Image Name="svgResourceImage" Source="{DynamicResource __tiger}"/>
    </ContentPage.Content>
</ContentPage>

I get the error "Assembly 'Svg.Skia.Avalonia' was not found." for the svg namespace. I am using version 0.10.0-preview1 of AvaloniaUI. Also, the Image.Name property does not exist for Xamarin.Forms.Image.

Regards
Christopher

[Xamarin.Forms] Svg.Skia doesn't want to parse and display properly SVG

I tried to use Svg.Skia exactly in the same way like in sample but no matter which .svg file I used, there is an output message during loading .svg file

monotouch Error: 0 : Exception has been thrown by the target of an invocation.
monotouch Error: 0 : The CreateDocument method can only be used to parse root elements.
monotouch Error: 0 : The CreateDocument method can only be used to parse root elements.
monotouch Error: 0 : The CreateDocument method can only be used to parse root elements.
monotouch Error: 0 : The CreateDocument method can only be used to parse root elements.
monotouch Error: 0 : Stack empty.

Sample solution, below (tested on iOS, Android, macOS).
Embedded resource download.svg is a file taken from (https://github.com/wieslawsoltes/SVG/blob/d7a767942de86a0263941dd3e7cd4f939709f036/Tests/W3CTestSuite/svg/__Telefunken_FuBK_test_pattern.svg) which is used also in your official sample.

SvgTest.zip

UWP app rejected by Certification Testing

Hi - I've built a UWP app using Svg.Skia, but it is failing Windows certification testing with this message:

API __CxxFrameHandler4 in vcruntime140_1_app.dll is not supported for this application type. libSkiaSharp.dll calls this API.
API __CxxFrameHandler4 in vcruntime140_1_app.dll is not supported for this application type. libGLESv2.dll calls this API.
API __CxxFrameHandler4 in vcruntime140_1_app.dll is not supported for this application type. Microsoft.Graphics.Canvas.dll calls this API.
API __CxxFrameHandler4 in vcruntime140_1_app.dll is not supported for this application type. libHarfBuzzSharp.dll calls this API.

Any ideas?

em unit is not relative to the font size.

When converting unit defined in em to a device value the font size is not taken into account. This deviates from the SVG spec on coordinates , specifically 7.10. If the owner has a font size, it should be used to convert.

Specifically here.

This should look something like
if (owner?.FontSize.IsEmpty == false) { _deviceValue = owner.FontSize * value } else {// use current behavior}

Compiler error after upgrading to 0.5.0

This line does not compile:

SvgDocument? svgDocument = SKSvg.Open(stream);

Severity Code Description Project File Line Suppression State
Error CS0117 'SKSvg' does not contain a definition for 'Open'

Release notes of version 0.5.0 (and also 0.5.0-rc2, 0.4.2-rc1, 0.4.2-preview9, 0.4.2-preview8, 0.4.2-preview7, 0.4.2-preview5, 0.4.2-preview3) contain no information about any breaking changes.

To be honest, release notes do not contain any information at all.

Garbage on rendering.

Hi,

When I render
company_176_1994.zip

using this code:

                            outPath = Path.Combine(outPath, $"{multiplier}x");

                            if(!Directory.Exists(outPath))
                                Directory.CreateDirectory(outPath);

                            string rendered = Path.Combine(outPath, $"{guid}.{format}");

                            if(File.Exists(rendered))
                                continue;

                            Console.WriteLine("Rendering {0}", rendered);

                            if(svg == null)
                            {
                                svg = new SKSvg();
                                svg.Load(file);
                            }

                            SKRect svgSize = svg.Picture.CullRect;
                            float  svgMax = Math.Max(svgSize.Width, svgSize.Height);
                            float  canvasMin = minSize * multiplier;
                            float  scale = canvasMin / svgMax;
                            var    matrix = SKMatrix.MakeScale(scale, scale);
                            var    bitmap = new SKBitmap((int)(svgSize.Width * scale), (int)(svgSize.Height * scale));
                            var    canvas = new SKCanvas(bitmap);
                            canvas.DrawPicture(svg.Picture, ref matrix);
                            canvas.Flush();
                            var    image = SKImage.FromBitmap(bitmap);
                            SKData data  = image.Encode(skFormat, 100);
                            var    outFs = new FileStream(rendered, FileMode.CreateNew);
                            data.SaveTo(outFs);
                            outFs.Close();

the resulting render is full of garbage:
a2040fc2-297c-4175-ab17-10337ebef14f

SVG to PNG/PDF text position incorrect

Converting the attached svg to png using Svg.Skia results in the incorrect position of the text.
SvgNet renders the text position correctly in the png, but has other issues.
I have included the png/pdf output of the svg when open from Inkscape and Chrome which match SvgNet.

Reproducer1-Chrome.pdf
Reproducer1-Inkscape.pdf
Reproducer1SVG.zip
SvgReproducer-proj.zip

Numbers position wrong on the left:
Reproducer1-Skia Svg

Correct output:
Reproducer1-Inkscape

Text position correct via SvgNet
Reproducer1-SvgNet

Creating an SvgDocument from code

When I open an svg file and I can render it correctly in an Image component (Avalonia)
But if I try to create an SvgDocument , Add Children (a line) and render it to an Image nothing appears.
If Save the object to xml file, then read it again, it render correctly.

I'm not sure if this is even is supposed to be supported.

Code for reading an svg and rendering it:

var fileName = @"C:\Users\Marius\Desktop\tes.svg";
document = SKSvg.Open(fileName);

var picture = SKSvg.ToModel(document);
var svg = new SvgSource();
svg.Picture = picture;
var img= new Avalonia.Controls.Image();
img.Source = new Svg.Skia.Avalonia.SvgImage()
{
	Source = svg
};

Creating SvgDocument and rendering:

var document = SKSvg.Open(fileName);
var line = new SvgLine();
line.StartX = new SvgUnit(0);
line.StartY = new SvgUnit(0);
line.EndX = new SvgUnit(1000);
line.EndY = new SvgUnit(1000);
var color = System.Drawing.Color.Green;
line.Color = new SvgColourServer(color);
line.StrokeWidth = new SvgUnit(20);
document.Children.Add(line);


var picture = SKSvg.ToModel(document);
var svg = new SvgSource();
svg.Picture = picture;
var img= new Avalonia.Controls.Image();
img.Source = new Svg.Skia.Avalonia.SvgImage()
{
	Source = svg
}; 

[Question] Is there a way to verify that an svg file is correctly formatted?

Currently we are using SKSvg().Load(filepath), which returns a valid svg, however our svg file was slightly mal-formed, so the process of loading gave some exceptions:

System.FormatException
  HResult=0x80131537
  Message=Input string was not in a correct format.
  Source=System.Private.CoreLib
  StackTrace:
   at System.Number.ThrowOverflowOrFormatException(ParsingStatus status, TypeCode type)

and

System.ArgumentException
  HResult=0x80070057
  Message=9c2e3e is not a valid value for Int32.
  Source=System.ComponentModel.TypeConverter
  StackTrace:
   at System.Drawing.ColorConverterCommon.IntFromString(String text, CultureInfo culture)

  This exception was originally thrown at this call stack:
    System.Number.ThrowOverflowOrFormatException(System.Number.ParsingStatus, System.TypeCode)
    int.Parse(string, System.Globalization.NumberStyles, System.IFormatProvider)
    System.Drawing.ColorConverterCommon.IntFromString(string, System.Globalization.CultureInfo)

Inner Exception 1:
FormatException: Input string was not in a correct format.

In the case of the exception above, a color in the file was invalid: "9c2e3e" instead of "#9c2e3e".

Even though these exceptions are thrown, they appear to be handled in the Load() method, so that a valid SVG is returned.

However we would like some unit tests to make sure our SVG files are all correct, so that we can fix any that have these problems. At the moment this exception is only seen when debugging, since it's handled.

Ideally our unit test would check for any errors in the format of an SVG file, so that we can fix them in our own files, instead of needing these to be handled at runtime.

Is there a way to know that a given svg file will have these exceptions when loading (a try catch isn't working since Svg.Load is already handling) - i.e. something like a strict mode on load or verifySvg() method?

SVG line on axis not handling linearGradient with 0 offset correctly

Full example svg file (named txt so I can upload it here)
Chernarus_Winter.txt

Left Google Chrome
Center Mozilla Firefox
Right Svg.Skia rendered onto a canvas

2020-08-25_21-24-56

Minimal example

<svg xmlns="http://www.w3.org/2000/svg" width="500" height="500">
<defs>
<linearGradient id="colorGrid"><stop offset="0" stop-color="#707053" /></linearGradient>
</defs>

<g id="grid" stroke="url(#colorGrid)" fill="url(#colorGrid)">
<line x1="0.00" y1="0" x2="0.00" y2="15360.00"  stroke-width="4"/>
<text x="50.00" y="50.00">000</text>
<line x1="100.00" y1="0" x2="100.01" y2="15358.00"/>
<text x="150.00" y="50.00">001</text>
<line x1="200.00" y1="15360.00" x2="200.00" y2="0.00"/>
<text x="250.00" y="50.00">002</text>
<line x1="300.00" y1="15360.00" x2="300.00" y2="0.00"/>
<text x="350.00" y="50.00">003</text>
<line x1="400.00" y1="15360.00" x2="400.00" y2="0.00"/>
</g>

</svg>

Even setting stroke-width="20" makes them not render, same behavior in Chrome browser.

changing
<line x1="100.00" y1="0" x2="100.00" y2="15358.00"/>
to
<line x1="100.00" y1="0" x2="100.01" y2="15358.00"/>
will make it render in both Chrome and Svg.Skia

stop offset="0" is a "standard" way to hardcode colors as defs, and Firefox also handles it correctly. And I think old SkiaSharp.Svg handled it correctly, my grid lines stopped displaying when I switched over to Svg.Skia.

Atleast as long as https://developer.mozilla.org/en-US/docs/Web/SVG/Element/solidColor is not supported.

LoadPicture(string path, Uri? baseUri) does not work on linux

I use an OpenFileDialog to load an SVG file. Under Linux the file path always starts with "/" and therefore cannot be loaded.

The file "SvgSource.cs" shows why:

public static SKPicture? LoadPicture(string path, Uri? baseUri)
    {
        var uri = path.StartsWith("/") ? new Uri(path, UriKind.Relative) : new Uri(path, UriKind.RelativeOrAbsolute);
        if (uri.IsAbsoluteUri && uri.IsFile)
        {
            var document = SM.SvgExtensions.Open(uri.LocalPath);
            if (document is { })
            {
                return SM.SvgExtensions.ToModel(document, s_assetLoader, out _, out _);
            }
            return default;
        }
        else
        {
            var loader = AvaloniaLocator.Current.GetService<IAssetLoader>();
            var stream = loader.Open(uri, baseUri);
            var document = SM.SvgExtensions.Open(stream);
            if (document is { })
            {
                return SM.SvgExtensions.ToModel(document, s_assetLoader, out _, out _);
            }
            return default;
        }
    }

paint-order not supported on path

Path does not seem to respect the paint-order attribute. Documentation here. I've not tested for other supported classes.

Here's an example SVG with the issue: data:image/svg+xml;charset=utf-8;base64,PHN2ZyBjbGFzcz0ibmNvbG9yZWQtc3ZnLWltYWdlIiB2aWV3Qm94PSI1MDAgMzkwIDIwMCAyMDAiIGhlaWdodD0iMzUwcHgiIHdpZHRoPSI0MDBweCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4NCg0KPHBhdGggaWQ9InBhaW50T3JkZXIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZmlsbD0icmdiKDMsMCwwKSIgb3BhY2l0eT0iMSIgc3Ryb2tlLXdpZHRoPSIzMiIgZD0iTSA1NDUuMyA1MDMuMyBDIDU0OC43NTcgNTAzLjMgNTUxLjg3MiA1MDIuODQzIDU1NS4zIDUwMy43IEMgNTU4LjA1OCA1MTAuMTM2IDU1OC4zNjYgNTE4LjAyNyA1NjQuMiA1MjIuOCBDIDU2OS43MzEgNTI3LjMyNSA1ODIuNDY3IDUyNy44ODggNTgzLjggNTE5IEMgNTg0LjUxOSA1MTQuMjA2IDU4Mi43MjIgNTEwLjU4MSA1ODAuNCA1MDYuNiBDIDU3My42ODYgNDk1LjA5IDU1OS43ODcgNDkzLjQwNyA1NTEuNiA0ODMuNCBDIDU0NS4yNjEgNDc1LjY1MiA1NDQuMSA0NjQuNTk0IDU0NC4xIDQ1NSBDIDU0NC4xIDQ0OS4yOCA1NDMuNzk5IDQ0My42MDUgNTQ1LjIgNDM4IEMgNTQ5LjExNyA0MjIuMzMgNTYyLjc0NSA0MTAuMzAzIDU3OS41IDQxMS41IEMgNTg1LjkzOCA0MTEuOTYgNTkyLjMxMiA0MTUuOTg0IDU5Ny43IDQxOS4zIEMgNjAxLjI3NyA0MjEuNTAxIDYwMy40MzIgNDI0LjI1NCA2MDcuOCA0MjQuOCBDIDYwOS42OTUgNDIxLjk1NyA2MTAuNzg1IDQxOC41NzMgNjEyLjcgNDE1LjcgQyA2MTQuODkxIDQxNS4xNTIgNjE3LjEwOSA0MTUuMTUyIDYxOS4zIDQxNS43IEMgNjIwLjkzMSA0MjIuMjI2IDYyMC4zMjkgNDI4LjQyIDYyMCA0MzUgQyA2MTkuNjA2IDQ0Mi44NzUgNjIwLjc3OSA0NTAuOTcgNjE5LjggNDU4LjggQyA2MTYuNDc5IDQ2MS4wMTQgNjExLjk0OCA0NjEuMzc0IDYwOC40IDQ1OS42IEMgNjA1LjM1NSA0NTMuNTEgNjA2LjA1NSA0NDYuNDA5IDYwMC4zIDQ0MS43IEMgNTkzLjQ2OCA0MzYuMTEgNTgxLjYzNyA0NDAuNzQzIDU4Mi4xIDQ1MCBDIDU4Mi40NjIgNDU3LjIzMSA1ODkuMzE5IDQ2Mi43OTMgNTk1LjQgNDY1LjYgQyA2MDMuNDMzIDQ2OS4zMDcgNjEzLjAwMyA0NzQuNTE5IDYxNy42IDQ4Mi40IEMgNjIyLjYwNSA0OTAuOTgxIDYyNCA1MDAuMjEyIDYyNCA1MTAgQyA2MjQgNTE0LjIxOCA2MjQuNTI2IDUxOC44MjkgNjIzLjkgNTIzIEMgNjIyLjE1NCA1MzQuNjM4IDYxMy45NjkgNTQzLjUzMiA2MDQgNTQ4LjkgQyA2MDAuMDg4IDU1MS4wMDcgNTk1LjQ5NyA1NTIuNzc1IDU5MSA1NTMgQyA1ODIuMDE2IDU1My40NDkgNTczLjQ0NCA1NTAuNjI0IDU2NS42IDU0Ni40IEMgNTYyLjIxMyA1NDQuNTc2IDU2MC4wNTYgNTQxLjE2NCA1NTYuMiA1NDAuMiBDIDU1My4zNzcgNTQ0LjQzNCA1NTEuNDI2IDU1Mi4xMTMgNTQ0LjQgNTQ4LjYgQyA1NDIuNzIxIDUzOC41MjggNTQzLjEgNTI4LjE4OCA1NDMuMSA1MTggQyA1NDMuMSA1MTMuMDAyIDU0Mi4zNzkgNTA3LjY4MiA1NDUuMyA1MDMuMyIgc3Ryb2tlPSJyZ2IoMjU0LDIyMSwwKSIgc3Ryb2tlLWRhc2hhcnJheT0ibm9uZSIgcGFpbnQtb3JkZXI9InN0cm9rZSIvPg0KPC9zdmc+

Opacity only works for 0 and 1 for Image with SvgImage Source and Svg control

I noticed you can't fade away an Image with SvgImage Source.

Not sure if this is a limitation of Svg.Skia or Svg itself.

<Style Selector="ContentPresenter">
  <Setter Property="Transitions">
    <Transitions>
      <DoubleTransition Property="Opacity" Duration="0:0:0.5" Easing="LinearEasing"/>
    </Transitions>
  </Setter>
</Style>

ContentPresenter includes a TextBlock and an Image. Only the TextBlock gets slowly invisible.
The Image only disapears as soon as Opacity becomes 0.0

2.80 previews?

Are there plans to have NuGets that target the upcoming 2.80 previews of SkiaSharp that will be released soon? Thanks!

Memory Leak on DrawPath

I am experiencing an issue which looks like a memory lean when I scale a SVG using a matrix. The sample application starts at about 70MB and then nearly doubles as you resize the app. The resize event triggers the redraw.

Steps to reproduce:

run the project
Resize the app and drag so the app is always resizing
I have attached a screenshot of the memory usage.

This project is a cut down version of a larger project which draws more objects and it grows by hundreds of megabytes by only resizing.

Taking snapshots was not that helpful as it said the app grew by a few bytes but it clearly grew by lots more.

Here is a copy of the sample app.
Leak.zip

I was previously using the SkiaSharp.Svg Version="1.60.0" library and was experiencing the same issue.

I would be interested in some guidance if this is my issue or something going on in the Svg.Skia Library.

SVG file that is not correctly handled

I found a file that when I simply load and then save to a PNG, all the PNG contains is a transparent PNG. No rendering of the image has occurred. The text of the SVG is below and is a circular cutoff the Puerto Rico flag. So very straightforward.

<?xml version="1.0" encoding="UTF-8" standalone="no"?> <svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" height="620" width="620" id="svg10" version="1.1" fill="#ffffff" sodipodi:docname="PuertoRicoFlag.svg" inkscape:version="1.0 (4035a4fb49, 2020-05-01)"> <metadata id="metadata16"> <rdf:RDF> <cc:Work rdf:about=""> <dc:format>image/svg+xml</dc:format> <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> <dc:title></dc:title> </cc:Work> </rdf:RDF> </metadata> <defs id="defs14"> <clipPath clipPathUnits="userSpaceOnUse" id="clipPath21"> <g id="g25" transform="matrix(0.99337116,0,0,0.99337116,-0.15530322,2.3329428)"> <circle style="fill:#143d75;stroke-width:6.61279;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.4" id="circle23" cx="382.69211" cy="299.65341" r="302.00192" /> </g> </clipPath> <clipPath clipPathUnits="userSpaceOnUse" id="clipPath27"> <g id="g31" transform="matrix(0.99337116,0,0,0.99337116,-0.15530322,2.3329428)"> <circle style="fill:#143d75;stroke-width:6.61279;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.4" id="circle29" cx="382.69211" cy="299.65341" r="302.00192" /> </g> </clipPath> <clipPath clipPathUnits="userSpaceOnUse" id="clipPath33"> <g id="g37" transform="matrix(0.99337116,0,0,0.99337116,-0.15530322,2.3329428)"> <circle style="fill:#143d75;stroke-width:6.61279;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.4" id="circle35" cx="382.69211" cy="299.65341" r="302.00192" /> </g> </clipPath> <clipPath clipPathUnits="userSpaceOnUse" id="clipPath39"> <g id="g43" transform="matrix(0.99337116,0,0,0.99337116,-0.15530322,2.3329428)"> <circle style="fill:#143d75;stroke-width:6.61279;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:0.4" id="circle41" cx="382.69211" cy="299.65341" r="302.00192" /> </g> </clipPath> </defs> <sodipodi:namedview inkscape:current-layer="svg10" inkscape:window-maximized="1" inkscape:window-y="-8" inkscape:window-x="1912" inkscape:cy="387.52919" inkscape:cx="424.35034" inkscape:zoom="0.71913184" showgrid="false" id="namedview12" inkscape:window-height="1057" inkscape:window-width="1920" inkscape:pageshadow="2" inkscape:pageopacity="0" guidetolerance="10" gridtolerance="10" objecttolerance="10" borderopacity="1" bordercolor="#666666" pagecolor="#ffffff" inkscape:document-rotation="0" showguides="true" inkscape:guide-bbox="true" fit-margin-top="10" lock-margins="true" fit-margin-left="10" fit-margin-right="10" fit-margin-bottom="10" /> <path style="stroke-width:1.05409;fill:#ffffff" id="path2" d="M 0,0 H 1000 V 600 H 0" clip-path="url(#clipPath39)" transform="translate(-70,10)" /> <path id="path4" d="m 0,60 h 1000 m 0,240 H 0 m 0,240 h 1000" stroke-width="126.491" stroke="#ee0000" clip-path="url(#clipPath33)" transform="translate(-70,10)" /> <path style="stroke-width:1.05409" id="path6" d="M 0,0 V 600 L 577.77778,300" fill="#0050f0" clip-path="url(#clipPath27)" transform="translate(-70,10)" /> <path style="stroke-width:1.05409" id="path8" d="M 126.66667,382 192.22222,199 257.77778,382 85.555556,269 H 298.88889" clip-path="url(#clipPath21)" transform="translate(-70,10)" /> </svg>

Image embedding

Avalonia - 0.10 Preview 2

There doesn't seem to be support for embedding an image/bitmap inside the svg.
Example svg that has an image embedded and a circle. Only the circle gets rendered.

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
        "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg height="68px" width="61px" version="1.1"
     xmlns="http://www.w3.org/2000/svg" xmlns:xlink= "http://www.w3.org/1999/xlink">
<circle cx = "50" cy = "50" r = "40" stroke = "black" stroke-width = "3" fill = "red" />
    <image xlink:href="data:image/gif;base64,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" x="0" y="0" height="68px" width="61px"/>
</svg>

Clipping of images when transformations applied

Hi, What's the state of work on drawing images (such as embedded JPEGs) in the library? I'm seeing a problem where, when I try to render a JPEG image with a transform applied, the image is getting wrongly clipped - I think the clip region is not being transformed. In the attached SVG, the rectangle gets shown correctly, but the embedded JPEG is messed up. It looks like it's been transformed correctly, but is then being clipped to the bounds of the original (un-transformed) image:

<svg width="100" height="100">
    <rect x="5" y="5" width="40" height="20"
        stroke="green" stroke-width="4" fill="yellow"
        transform="matrix(3 1 -1 3 2 1)"/>          
    <image width="10" height="10" x="0" y="0"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=="
        transform="matrix(3 1 -1 3 2 1)"/>
</svg>

Have I understood the problem correctly? Is this something you're planning to work on soon? (it is a feature I need, so I'd be OK to work on it independently, but it might be messy as I am not exactly familiar with how you're doing things). Thanks.

UWP support

What is the state of support for UWP in Svg.Skia? I'm finding that it works for simple SVG content, but for more complex SVG, I am getting PlatformNotSupportedException: System.Drawing is not supported on this platform. (inner exception "The type initializer for 'Svg.SvgElement' threw an exception."). This is the stack trace:

   at System.RuntimeFieldHandle.SetValue(RtFieldInfo field, Object obj, Object value, RuntimeType fieldType, FieldAttributes fieldAttr, RuntimeType declaringType, Boolean& domainInitialized)
   at System.Reflection.RtFieldInfo.InternalSetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture, StackCrawlMark& stackMark)
   at System.Reflection.RtFieldInfo.SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture)
   at Svg.Skia.UseDrawable..ctor(SvgUse svgUse, SKRect skOwnerBounds, Boolean ignoreDisplay)
   at Svg.Skia.DrawableFactory.Create(SvgElement svgElement, SKRect skOwnerBounds, Boolean ignoreDisplay)
   at Svg.Skia.FragmentDrawable..ctor(SvgFragment svgFragment, SKRect skOwnerBounds, Boolean ignoreDisplay)
   at Svg.Skia.DrawableFactory.Create(SvgElement svgElement, SKRect skOwnerBounds, Boolean ignoreDisplay)
   at Svg.Skia.SKSvg.ToPicture(SvgFragment svgFragment)
   at Svg.Skia.SKSvg.FromSvg(String svg)

and this is the code that produced this problem:

    svgText = "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"  width=\"100px\" height=\"300x\">" +
     "<defs>" +
     "<path id=\"gl1536\" d=\"M 10 1 C 7 2 7 4 7 7 C 7 8 7 10 7 11 C 11 11 15 13 20 13 C 33 14 34 14 34 17 C 34 18 34 71 34 131 C 34 169 34 205 34 243 C 30 243 26 243 21 243 C 7 245 4 246 5 250 C 5 252 5 253 5 255 C 37 255 69 255 101 255 C 182 256 197 255 198 253 C 200 253 201 243 203 233 C 203 224 204 210 205 201 C 208 188 208 187 205 185 C 198 179 191 185 188 201 C 188 203 187 207 187 208 C 185 210 184 216 181 221 C 179 227 178 234 176 237 C 175 240 175 242 174 245 C 158 245 142 243 126 243 C 72 243 72 243 69 233 C 66 224 68 21 69 17 C 71 14 72 13 82 13 C 95 13 101 11 101 7 C 101 5 100 2 98 2 C 97 1 15 1 10 1 z\" fill=\"red\"/> </defs>" +
     "<use xlink:href=\"#gl1536\" x=\"0\" y=\"0\"/>" +
     "</svg>";
    using(SKSvg svg=new SKSvg())
    {
        SKPicture pic = svg.FromSvg(svgText);
    }

I'm not sure whether I should expect this to fail in UWP because it's not supported. But ideally it would be support(i.e. Svg.Skia would be avoiding calling the System.Drawing library, which is not available in UWP, and would be calling the correct Skia functions). Or if that isn't possible, could we have a less hostile behaviour in the places where Svg.Skia does end up calling System.Drawing - such as not throwing an exception (but instead, simply not drawing the unsupported SVG content).

Thanks for your attention - and if I can help further, please point me at what I need to do.

Text of custom fonts not rendering

I'm making a gui program in avalonia with a custom ui and planned on using dynamically rendered svgs for the ui. I begun with creating the splash screen but I can't seem to render the text using your library. I am using the skiasharp bundled with Avalonia (so it doesn't mess up the natives) and I made the splash screen (and will make all svg files) using Inkscape.

This is what I could get your library to do: https://imgur.com/a/JRimmyn
This is what Inkscape renders: https://imgur.com/a/Vy7SRPq

I have attempted to give Svg.Skia.SKSvgSettings.s_typefa... and also Svg.SvgFontManager (I've tried individually and both at the same time) both all of the ttf at the same time and also just the ttf I used in the svg renamed to the exact name which is referenced in the svg but it never renders the text. For reference, I also have all of the Quantico (the font in question) fonts installed on my system and have tried sans-serif also with no avail.

My entire repo (it's very small rn, I've only just started making it) is here. I'm running pop-os (basically ubuntu) 20.04 LTS on x86 64bit. I have dotnet core 3.1.302 installed and the repo target framework is netcoreapp3.1. I'm using Svg.Skia 0.3.0 and take my skiasharp version (I guess) from avalonia 0.10.0-preview1. Program.cs is currently setup to produce test.png at a vertical resolution of 720px from Assets/Images/Vector Images/SplashBase.svg using fonts in the directory Assets/Fonts/Quantico.

I'm still confused as to weather this is a bug, something to do with how Inkscape compiles svgs or something else entirely. I hope that you can find out what's going on!

Svg.Custom not compatible with linking

Svg.Custom is referenced by Svg.Skia and is not compatible with linking.

Workaround: skip linking manually for Svg.Custom

Is there some reflection that is required in this framework that is giving a linker incompatibility?

Tested on Android.

Other platforms (UWP release mode, iOS) not tested but could have similar issues.

Embedded image in .SVG not rendered

Avalonia.svg 0.5.6.2 or nuget version 10.6.2, the embedded image in SVG file not rendered, just blank. And some single character not displayed.
Pls ref the attached SVG file and the render result in MS Edge of same file.
[Correct result in MS edge]
svg_edge
[in AvaloniaSvgDemo]
svg_avalonia_svg
[the svg file]
report_preview.zip

PNG image result does not match the SVG source.

Hi!
I've come here from Redth/ResizetizerNT#43
I am not sure that the issue is related to this project for 100%, but I tried to run the viewer from the https://github.com/svg-net/SVG repository and it display the image without the difference from the original one.

I have a few icons in the AdobeXD design. I exported them as the SVG files to use them in my project. Usually, everything is OK but not now.
Instead of this result (as it is in the XD)
ApplicationFrameHost_29_01_2021__22_44_07__e0926005-3114-45fe-be9e-ee741f1c7136
images I see only the central icons without any background:

explorer_29_01_2021__22_45_12__32993bbf-03e8-4377-a0d0-6631aa7a9bf2

After a short research I dig to the original svg-net/SVG project and run the Viewer:
SVGViewer_29_01_2021__22_21_26__0679a4a5-acc2-4f1f-b734-39f3f2c3b5ac

Then I tried to install and run the tool from the Windows Console:
Svg.Skia.Converter -f L:\src_github\ResizetizerNT\Resizetizer.NT.Tests\images\issue_43_0.svg -o "L:\" --format png

Here is the result:
issue_43_0 (it's invisible on the light page)
Here is the screenshot of the file:
explorer_29_01_2021__22_50_05__40397e26-7fd7-4694-ae05-335e2afb577a

I've also tried to run the code from .net console project, the result was the same.
svg.Save("image.png", SKColors.Empty, SKEncodedImageFormat.Png, 100, 1f, 1f);
svg.Save("image.png", SKColors.Transparent, SKEncodedImageFormat.Png, 100, 1f, 1f);
Only when I change the background color parameter from any transparent value
svg.Save("image.png", SKColors.Green, SKEncodedImageFormat.Png, 100, 1f, 1f);
I start getting a different result:
image

Could you help me with the issue? Should I go to the svg-net/SVG project and create an issue there?

I pack all the SVG, including the XD file into this zip:
issue_43_0.zip

The result is blurry

I am getting blurry results when rendering an SVG in UWP app. Below is the code I use to draw SVG in SKXamlCanvas.PaintSurface event handler.

		var canvas = e.Surface.Canvas;
		var display = DisplayInformation.GetForCurrentView();
		var scale = display.LogicalDpi / 96.0f;
		var scaledSize = new SKSize(e.Info.Width / scale, e.Info.Height / scale);
		canvas.Scale(scale);
		canvas.Clear(SKColors.Transparent);
		if (svg != null) {
			float scaleX = scaledSize.Width / svg.Picture.CullRect.Width;
			float scaleY = scaledSize.Height / svg.Picture.CullRect.Height;
			var matrix = SKMatrix.MakeScale(scaleX, scaleY);
			canvas.DrawPicture(svg.Picture, ref matrix);
		}

USE_PICTURE

Is this IFDEF still needed? What is the case for maintaining two codepaths?

Fill setting is invalid

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0" y="0" width="165" height="165">
    <g id="dot" x="0" y="0" width="0.5" height="0.5">
        <rect fill="red" width="120" height="120" />
        <circle fill="black" cx="50" cy="50" r="25" />
    </g>
</svg>

When drawing this svg, the color is all black.
fill="red" is invalid.
Can you please confirm. @wieslawsoltes

Version 0.41

How to reference filter from image in code behind

How to reference filter in code behind. Trying to apply the filter to the image. Builing the svg from code. My filter has an id of ID = "a". How to I reference it in the SVGImage -> Filter = new Uri(),

 SvgDocument svgdoc = new SvgDocument
        {
            AspectRatio = new SvgAspectRatio
            {
                Align = SvgPreserveAspectRatio.xMidYMid,
                Slice = true
            },

            Height = SVGHeight,
            Width = SVGWidth,
        };

        var filter = new SvgFilter
        {
            ID = "a",
            ColorInterpolation = SvgColourInterpolation.SRGB
        };

        var colorMatrix = new SvgColourMatrix
        {
            Result = "",
            Values = ".33 .33 .33 0 0 .33 .33 .33 0 0 .33 .33 .33 0 0 0 0 0 1 0",
            Input = "SourceGraphic"
        };

        var feComponentTransfer = new SvgComponentTransfer
        {
            Result = "duotone_canvas"
        };

        SvgFuncR feFuncR = new SvgFuncR
        {
            Type = SvgComponentTransferType.Table,
            TableValues = ConvertStringToTable(RTable)
        };
        SvgFuncG feFuncG = new SvgFuncG
        {
            Type = SvgComponentTransferType.Table,
            TableValues = ConvertStringToTable(GTable)
        };
        SvgFuncB feFuncB = new SvgFuncB
        {
            Type = SvgComponentTransferType.Table,
            TableValues = ConvertStringToTable(BTable)
        };
        SvgFuncA feFuncA = new SvgFuncA
        {
            Type = SvgComponentTransferType.Table,
            TableValues = ConvertStringToTable(ATable)
        };

        feComponentTransfer.Children.Add(feFuncR);
        feComponentTransfer.Children.Add(feFuncG);
        feComponentTransfer.Children.Add(feFuncB);
        feComponentTransfer.Children.Add(feFuncA);

        // var uriBuilder = new UriBuilder("#a");

        var svgImage = new SvgImage
        {
            Height = SVGHeight,
            Width = SVGWidth,
            AspectRatio = new SvgAspectRatio
            {
                Align = SvgPreserveAspectRatio.xMidYMid,
                Slice = true
            },
            Filter = new Uri(),
            Href = DataUrl
        };

        filter.Children.Add(colorMatrix);
        filter.Children.Add(feComponentTransfer);
        svgdoc.Children.Add(filter);
        svgdoc.Children.Add(svgImage);

        var svg = new SKSvg();
        var newDoc = svg.FromSvgDocument(svgdoc);

SVG is not rendered properly

Reproduced in : 0.10.10

Expected result (rendered by rider preview):

image

Result in TestApp:

image

Sample SVG:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
  <g id="main">
    <g id="icon">
      <path d="M2.001,0.009961L1.768,0.05703L1.67,0.07676L1.587,0.1326L1.396,0.2611L1.316,0.3156L1.261,0.3963L1.133,0.5869L1.077,0.6697L1.057,0.7676L1.01,1.001L1,1.05L1,1.1L1,13.9L1,13.95L1.01,14L1.057,14.23L1.077,14.33L1.133,14.41L1.261,14.6L1.316,14.68L1.396,14.74L1.587,14.87L1.67,14.92L1.768,14.94L2.001,14.99L2.05,15L2.1,15L7.272,15L6.98,14.63L6.641,14.07L6.607,14L2.15,14L2.063,13.98L2.036,13.96L2.018,13.94L2,13.85L2,1.15L2.018,1.063L2.036,1.036L2.063,1.018L2.15,1L9.096,1L9.34,1.021L9.468,1.057L9.722,1.229L12.71,4.216L12.86,4.395L12.94,4.531L12.98,4.686L13,4.934L13,6.216L13.48,6.368L14,6.607L14,4.917L14,4.899L14,4.882L13.98,4.567L13.97,4.517L13.96,4.469L13.89,4.207L13.87,4.148L13.84,4.095L13.71,3.861L13.69,3.817L13.65,3.778L13.45,3.547L13.44,3.534L13.43,3.521L10.4,0.4879L10.36,0.4539L10.32,0.427L9.962,0.1844L9.896,0.1402L9.821,0.1184L9.57,0.0459L9.522,0.03223L9.473,0.02813L9.158,0.001758L9.138,0L9.117,0L2.1,0L2.05,0zz" fill="#000000"/>
      <path d="M9,4L9.069,4.337L9.249,4.624L9.505,4.843L9.797,4.972L9.961,5L13.2,5L13.2,4L10.05,4L10,3.965L10,1L9,1zz" fill="#000000"/>
    </g>
    <g id="overlay">
      <path d="M11.5,7c-2.4853,0,-4.5,2.0147,-4.5,4.5c0,2.4853,2.0147,4.5,4.5,4.5s4.5,-2.0147,4.5,-4.5C16,9.0147,13.9853,7,11.5,7zM14,12h-2v2h-1v-2H9v-1h2V9h1v2h2V12z" fill-rule="evenodd" fill="#0000FF"/>
    </g>
  </g>
</svg>

Svg.Skia NuGet with signed assemblies

Is it possible that you can create a NuGet with signed assemblies?

This makes it possible to use your awesome lib also in such application scenarios.

like this

    <!-- Sign assembly -->
    <PropertyGroup>
        <SignAssembly>True</SignAssembly>
        <AssemblyOriginatorKeyFile>$(MSBuildProjectDirectory)\..\svg.skia.public.snk</AssemblyOriginatorKeyFile>
        <DelaySign>false</DelaySign>
        <PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
    </PropertyGroup>

Providing additional fonts for Svg.Skia

I'm trying to use Svg.Skia with SVG content that is packaged (in an EPUB archive in fact) alongside font files - which should be used to supplement the system fonts that SKTypeFace.FromFamilyName knows about. Do you have any thoughts about how this could be handled in Svg.Skia?

I have in mind to create a fork of the code, adding a mechanism that would let me feed in an object (I'd define ITypefaceProvider, with a method GetFontFamily(fontFamilyName, fontWeight, fontWidth, fontStyle) or something) which would let me specify an additional place that the code in SvgTextExtensions.SetTypeface could look for fonts. But before doing any such thing, I thought I might ask (1) is there already some neat mechanism in place for doing this, and I am just too dumb to notice? (2) do you have any guidance to offer as to how I might make the changes, so that they would fit into your design philosophy for the library? - hoping that I might be able to produce a solution that you'd be able pull into the library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.