Custom fonts not applied in exported PDF

Stimulsoft Reports.NET discussion
Post Reply
AlharbiN
Posts: 32
Joined: Wed Jan 02, 2013 1:07 pm

Custom fonts not applied in exported PDF

Post by AlharbiN »

Hi,
In the designer, the font is perfectly displayed.
The font is a ttf file.

Here is my code

Code: Select all


                            StiPdfExportSettings pdfSettings = new StiPdfExportSettings();
                            pdfSettings.EmbeddedFonts = true;

                            report = StiReport.GetReportFromAssembly(assemplyfile);
                            StiOptions.Export.Pdf.AllowImportSystemLibraries = true;

                            report.RegData("CertificateData", certificateData);
                            await report.RenderAsync();
                            StiOptions.Export.Pdf.AllowImportSystemLibraries = true;
                            var service = new StiPdfExportService();
                            var stream = new MemoryStream();
                            service.ExportTo(report, stream, pdfSettings);
                            var streamArray = stream.ToArray();

                            System.IO.File.WriteAllBytes(certificateFile, streamArray);

the output file looks like the attached file

How can we solve this issue, please?
2020-12-19_18-48-35.jpg
2020-12-19_18-48-35.jpg (31.46 KiB) Viewed 1215 times
Andrew
Posts: 4104
Joined: Fri Jun 09, 2006 3:58 am

Re: Custom fonts not applied in exported PDF

Post by Andrew »

Hello.

Most of the standard fonts does not contain national characters. In this case Windows uses the "font fallback". This algorithm is very complicated and, therefore, is not realized in the exports. To output national characters, please, use the font which contain all necessary characters. For example, the "Arial Unicode MS" font contains many national characters.

Please see the video how to ass cutoms fonts https://www.youtube.com/watch?v=JtqJ9ZzY7_I

Thank you.
Post Reply