The demanding criteria for modern electronic reports are quite high — they must not only display the necessary information, but have a certain design, data format, and graphic content. A modern report is a complex document with design elements. The rapid development of report generators has increased the requirements for documents.
A particular font in a report can be a corporate requirement or a design element. Many report generator users would like to be able to use custom fonts. FastReport.NET allows you to do it! We are talking about TrueTypeFonts.
Now you don’t have to install fonts to use them in the report. You can add them to the report before building. Exporting a report to PDF format allows you to include custom fonts in your document. Let's look at an example of how to add ttf fonts to a report and how to export a report to PDF including these fonts.
What’s about the report template? In order to use non-standard fonts when you create a report in the designer, you still need to install them in the system (double click on the ttf font). If you open a report template in a system where there are no fonts used in this template, you will see that the fonts have been replaced with standard ones. However, if you open the template in a text editor, you will see the actual font settings:
Thus, if you have a report template with fonts that are not installed in the system, you cannot edit it without losing the font settings, but you can build it and export it if these fonts are added to the FastReport.NET configuration.
Let's say we have a report template created on a system with installed fonts. In the code above, we are adding fonts to the configuration:
Let's display the report before exporting it to PDF. Let's add a line “report.Show();”.This is what the fonts look like in the report:
This is what the fonts look like in a PDF document:
Thus, if you do not need to develop reports with non-standard fonts, but only display or export them, then you do not need to install these fonts in the system. This can be convenient if you distribute your reports with custom fonts.