C# SVG rendering engine - doesn't convert PostScript font but TrueType font does convert?

572 views Asked by At

I have problem with NuGet package SVG rendering engine for C#.

I created 2 my own fonts. First font name is PostScript (have PostScrypt lines) and font name of second is TrueType (have TrupeType lines). IMG Font informations

I do program which convert my SVG code to bitmap image and show him. When i convert it, then i get this: IMG Result of conversion

TrueType font convert successfully but PostScript font doesn't. I dont know what i can do with this. Please help.

There is my C# code:

using System;
using System.Windows;
using System.Diagnostics;
using System.Timers;
using System.IO;
using System.Drawing;
using System.Runtime.InteropServices;
using System.Xml;
using System.Windows.Media.Imaging;

namespace Test_Wpf
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
        }

        private void button_Click(object sender, RoutedEventArgs e)
        {
            richTextBox.SelectAll();
            string svg = richTextBox.Selection.Text;

            try
            {
                XmlDocument xmldoc = new XmlDocument();
                xmldoc.LoadXml(svg);

                Svg.SvgDocument svgdoc = Svg.SvgDocument.Open(xmldoc);

                Bitmap bmp = svgdoc.Draw();

                MemoryStream ms = new MemoryStream();
                bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);

                BitmapImage bim = new BitmapImage();
                bim.BeginInit();
                bim.StreamSource = ms;
                bim.EndInit();
                bim.Freeze();

                image.Source = bim;

                ShowMsg("Successfully converted. No Errors.");
            }
            catch(Exception ex)
            {
                ShowMsg(ex.Message);
            }
        }

        private void ShowMsg(string msg)
        {
            label.Content = String.Format("[{0}] - {1}", DateTime.Now.ToString(), msg);
        }
    }
}
0

There are 0 answers