XFont font = new XFont("MS Pゴシック", 20, XFontStyle.BoldItalic);
This is the MS Gothic font, and I would expect this code to execute to produce text using this font.
Actual Behavior
An error is thrown:
PdfSharp.PdfSharpException
HResult=0x80131500
Message=Error while parsing an OpenType font.
Source=PdfSharp
StackTrace:
at PdfSharp.Fonts.OpenType.CMapTable.Read()
at PdfSharp.Fonts.OpenType.FontData.Read()
at PdfSharp.Fonts.OpenType.FontData..ctor(XFont font, XPdfFontOptions options)
at PdfSharp.Fonts.OpenType.OpenTypeDescriptor..ctor(XFont font, XPdfFontOptions options)
at PdfSharp.Fonts.FontDescriptorStock.CreateDescriptor(XFont font)
at PdfSharp.Drawing.XFont.get_Metrics()
at PdfSharp.Drawing.XFont.Initialize()
at PdfSharp.Drawing.XFont..ctor(String familyName, Double emSize, XFontStyle style)
at PdfSharpIssueSurrogate.Program.Main(String[] args) in C:\Users\Chris\source\repos\PdfSharpIssueSurrogate\PdfSharpIssueSurrogate\Program.cs:line 27
This exception was originally thrown at this call stack:
PdfSharp.Fonts.OpenType.CMapTable.Read()
Inner Exception 1:
InvalidOperationException: Font has no usable platform or encoding ID. It cannot be used with PDFsharp.
Expected Behavior
I've modified slightly the PdfSharpIssueSurrogate with this unique substitution:
XFont font = new XFont("MS Pゴシック", 20, XFontStyle.BoldItalic);
This is the MS Gothic font, and I would expect this code to execute to produce text using this font.
Actual Behavior
An error is thrown:
Steps to Reproduce the Behavior
Modify the PdfSharpIssueSurrogate as indicated.