Every time when designing a new report or dashboard, our users have some questions about the lists of fonts, how to work with them, their display on various devices, etc.
Well, let's consider this topic in more detail and sort all the things out. What does the list of fonts, which we can see in the report designer, depend on? Mostly, the list of fonts depends on the operating system and a used product.
A certain set of fonts is installed in the operating system by default. However, after the operating system update and depending on its version, the list of available fonts may differ. Most often, a set of fonts is installed in the system by default, and each system version has its own list. You may install fonts with some apps or manually. They can be of various types - raster (bitmap) or vector (TrueType, OpenType, and PostScript).
Our products are intended for various technologies and, accordingly, they use different methods of information display. That is why fonts may be displayed differently. Besides, technologies may work differently on various versions of the operating system. For example, when working on Windows 8/10, Reports.Net, Reports.Wpf products, based on .NET Framework, support TrueType and OpenType fonts. Earlier versions of Windows support TrueType fonts only.All of the above applies to Reports.Net, Reports.Wpf, Dashboards.WIN. In the case of using Web products (client-server technologies) fonts list is taken from the operating system of the server-side of the product. Fonts list is pre-installed by our developers for the products where the JS engine is used.
Now let's talk in more detail about fonts themselves.
What is a font? A font is the set of symbols of a particular mark. Usually, each font represents a separate file. The files of fonts can be of different versions, and they can contain different amounts of symbols. As a rule, system fonts have only a few thousands of the most commonly used characters. There is a range of «universal fonts» containing a large amount of Unicode symbols, such as Arial Unicode and Lucida Sans Unicode. These fonts are usually very large and are not part of the system.
If a font does not contain necessary symbols, the system uses the «font fallback» algorithm, which inserts characters from similar fonts or fonts of a similar style. As a result, the appearance of the text may differ from the one intended. For example, a part of the text in another language can be displayed in a different font, and it will be very noticeable.
In some cases, missing symbols either don't display or are replaced with rectangles.In the picture above, you can see an example of displaying the same text with different fonts in Stimulsoft Reports.Net. The top row of the table displays text with the Text Quality=Standard (the standard way of showing text in .NET Framework is based on the GDI+ library). The bottom row of the table displays text in the Text Quality=Wysiwyg (our method to output text is based on the GDI library). This method uses a different font replacement algorithm so that the appearance may differ, and some characters are not found, and therefore are replaced with rectangles.
This is why to get a correct display of a text, you should think about fonts to be used before the report is designed. Also, when creating and displaying reports, you should ensure the accessibility of all necessary fonts.
You can use Custom fonts if the installed fonts in the system are not enough for your report design. These can be commercial fonts, created manually in editors, freely distributed, or downloaded from the Internet.
To make fonts available in our products, you should install them directly into the operating system. This option is suitable for desktop versions of Stimulsoft reporting tools. Fonts can also be installed with an application or manually by users.
Besides, there are two more ways for other versions.
The first way is font downloading from an app code with the help of the StiFontCollection class. This variant is intended for software developers and used at the stage of application creation. Most often, this is the way to add «Brand» fonts used in most reports. The second way is a font addition to the report resources. This way is suitable for report developers.The font selection tool in the Web version of our product is shown in the screenshot. All custom fonts are allocated in a separate category, "Custom Fonts".
Most of our products accept the use of fonts TrueType and OpenType as custom fonts (files with “ttf” and “otf” extensions accordingly). Pay your attention to OpenType fonts on Windows 7, and earlier OS versions may not work in our product.
Also, it's worth mentioning exports in PDF and XPS formats. It's important to note that only when exporting a report to these formats fonts can be embedded in the document file. In this case, when watching this document on any OS, it will look the same.
Therefore, several conditions must be fulfilled for a correct formation:
We can see the example of the text display in an exported PDF file in this screenshot. When exporting to PDF, the system «font fallback» is used. So it's important to choose the correct fonts.
- All the necessary fonts must be available. You can get a font file from the system only in Net products on Windows. In other cases, all the required fonts should be loaded by one of the above methods (StiFontCollection or report resources);
- Fonts must be TrueType or OpenType types;
- Fonts must contain all the necessary symbols. If a font file is embedded, the «font fallback algorithm is not used to display it, and all missing characters are replaced with rectangles.
We hope that this article will help you to understand fonts in the Stimulsoft report designer. And now, you will be able to create an exclusive design for your reports and dashboards easily. If you have any questions, please contact us – we are happy to help you!