I am using "Stimulsoft.Reports.Web.NetCore" Version="2023.2.1" .I generate PDF report and everything working fine . But when I was asked to change Thai font to "THSarabun.ttf" it shows me this error :
System.Exception: Exception in PdfFonts.GetFontMetrics, font 'TH SarabunPSK' step #10: 'Invalid value for 'classFormat' 0. Should be '1' or '2'.'
at Stimulsoft.Report.Export.PdfFonts.GetFontMetrics(Font font, PdfFontInfo currentFontInfo, UInt16[] glyphMap, Boolean isWpf)
at Stimulsoft.Report.Export.PdfFonts.InitFontsData(Boolean isWpf)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf1(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.Export.StiPdfExportService.ExportPdf(StiReport report, Stream stream, StiPdfExportSettings settings)
at Stimulsoft.Report.Mvc.StiNetCoreReportResponse.ResponseAsPdf(StiReport report, StiPdfExportSettings settings, Boolean saveFileDialog)
at Stimulsoft.Report.Mvc.StiNetCoreReportResponse.ResponseAsPdf(StiReport report, StiPagesRange pageRange, Single imageQuality, Single imageResolution, Boolean embeddedFonts, Boolean standardPdfFonts, Boolean exportRtfTextAsImage, String passwordUser, String passwordOwner, StiUserAccessPrivileges userAccessPrivileges, StiPdfEncryptionKeyLength keyLength, Boolean useUnicode, Boolean saveFileDialog)
at Stimulsoft.Report.Mvc.StiNetCoreReportResponse.ResponseAsPdf(StiReport report, StiPagesRange pageRange, Single imageQuality, Single imageResolution, Boolean embeddedFonts, Boolean standardPdfFonts, Boolean saveFileDialog)
For test you can find this font in this url :
https://www.mbu.ac.th/uncategorized/post-3573/
Also my simple form which I am using this font is attached .
Exception in PdfFonts.GetFontMetrics, font 'TH SarabunPSK'
-
- Posts: 2
- Joined: Tue Apr 11, 2023 4:00 am
Exception in PdfFonts.GetFontMetrics, font 'TH SarabunPSK'
- Attachments
-
- Coding.txt
- Coding Part
- (1.28 KiB) Downloaded 97 times
-
- Report.mrt
- Report File
- (4.07 KiB) Downloaded 95 times
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: Exception in PdfFonts.GetFontMetrics, font 'TH SarabunPSK'
Hello,
We apologize for the delay, but we need some extra time to investigate the issue thoroughly. We will keep you informed about the result as soon as possible.
Thank you for your patience.
#11025
We apologize for the delay, but we need some extra time to investigate the issue thoroughly. We will keep you informed about the result as soon as possible.
Thank you for your patience.
#11025
-
- Posts: 2
- Joined: Tue Apr 11, 2023 4:00 am
Re: Exception in PdfFonts.GetFontMetrics, font 'TH SarabunPSK'
Hello.
I tried to use another Thai font like "chulanarak" which you can find it in the link below .Report shows no error but the text with this font now showing too .
https://thaifonts.net/fonts/chulanarak-regular
I tried to use another Thai font like "chulanarak" which you can find it in the link below .Report shows no error but the text with this font now showing too .
https://thaifonts.net/fonts/chulanarak-regular
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: Exception in PdfFonts.GetFontMetrics, font 'TH SarabunPSK'
Hello,
In NetCore we use the SixLabors.Fonts graphics library. There are problems with some of the fonts, something inside is crashing.
Unfortunately, there's nothing we can do with it, since the SixLabors.Fonts library is still in beta.
font "THSarabun.ttf" doesn't like this library, but the font "chulanarak" does, use it.
Thank you.
In NetCore we use the SixLabors.Fonts graphics library. There are problems with some of the fonts, something inside is crashing.
Unfortunately, there's nothing we can do with it, since the SixLabors.Fonts library is still in beta.
font "THSarabun.ttf" doesn't like this library, but the font "chulanarak" does, use it.
Thank you.