This example demonstrates how to use a custom font distributed with the application in XtraReport.
The main idea of this approach is to use the PrivateFontCollection class to store custom font families. Use the Families property to access the FontFamily objects of your private fonts.
In this example, the static "FontCollection" property is used to store the report's private fonts. Then, in the report constructor, the private font families are used to specify fonts of the report controls.
This is a cross-platform approach, so it can be used for all technologies supported by XtraReports. However, there are some notes:
ASP.NET
The private font will be available only on your web server, so it won't be displayed in ASPxDocumentViewer by default if it is not installed on the client machine.
However, you can register this custom font on your webpage, for example by using the @font-face CSS rule. In this case, add this rule to your webpage with the viewer and set your ASPxDocumentViewer.SettingsReportViewer.UseIFrame property to the "false" value to prevent your report from being rendered in an iframe. This approach is demonstrated in this example.
WPF
The font cannot be registered globally by using the PrivateFontCollection in WPF, so the explicit reference to the embedded font is required there. The E5083: How to display a report that uses a private font (distributed with the application) in DocumentPreview code example demonstrates how to work around this limitation.