fontLibrary Element Overview
The FontLibrary
configuration element specifies the folders that will be used by the rendering engine when searching for a specific font.
This element is respected only when the PDF rendering extension is used in .NET Core applications under Linux / MacOS. The element is not respected in applications that run on Windows machine or when any other rendering extension is used.
Attributes and Elements
The following sections describe attributes, child elements, and parent elements.
Attributes |
useDefaultLocations - determines if the system's default font locations to be included in the search. On Linux machines these folders are /usr/share/fonts/truetype/ and /usr/local/share/fonts . On macOS machines the folder is /Library/Fonts .Default value: true. |
Child Elements | fontLocations - Optional element. Adds collection with font locations. |
Parent Elements |
|
Attributes | No attributes are defined for this element. |
Child elements | add - Optional element. Adds a font location to the collection. |
Parent element | fontLibrary |
Attributes |
|
||||
Child elements | None | ||||
Parent element | fontLocations |
Example
The following example demonstrates how to configure the reporting engine to skip searching the default font folders and declares which folder will be used for font resolving.
XML-based configuration file:
<?xml version="1.0"?>
<configuration>
...
<Telerik.Reporting>
<fontLibrary useDefaultLocations ="false">
<fontLocations>
<add path="/usr/customFonts/trueType" searchSubfolders="true"></add>
</fontLocations>
</fontLibrary>
</Telerik.Reporting>
...
</configuration>
JSON-based configuration file:
"telerikReporting": {
"fontLibrary": {
"useDefaultLocations": "false",
"fontLocations": [
{
"path": "/usr/customFonts/trueType",
"searchSubfolders": "true"
}
]
}
}