SVG icon indicating copy to clipboard operation
SVG copied to clipboard

Text with path not rendering correctly on versions after 3.1.1

Open khkassem opened this issue 2 years ago • 0 comments

Description

When i try to render or transform to bitmap the folowing svg using versions from 3.2 and up (i didn't test the master), the text with path is not rendered correctly - the position of the text is not like chrome. (The arrow is Ok for me, between my viewer and the result image there is no difference)

curved-text

The result with version 3.1.1 is

curved-text

The result with version 3.4.4

curved-text

I am using the folowing code from the svg.net console sample

        static void Save(FileInfo inputPath, string outputPath, float? width, float? height)
        {
            var svgDocument = SvgDocument.Open(inputPath.FullName);

            if (svgDocument == null)
            {
                logger.Fatal($"Error: Failed to load input file: {inputPath.FullName}");
                return;
            }

            if (width.HasValue)
            {
                svgDocument.Width = width.Value;
            }

            if (height.HasValue)
            {
                svgDocument.Height = height.Value;
            }

            using (var bitmap = svgDocument.Draw())
            {
                bitmap?.Save(outputPath);
            }
        }


            string svgFile = @"\data\curved-text.svg";
            string bmpFile = @"\data\curved-text.png";

            Save(new FileInfo(svgFile), bmpFile, 200.0f,400.0f);

Used Versions

Windows 11 (and 10), .NET 4.7.2

Thank you

khkassem avatar Feb 17 '23 11:02 khkassem