<style>
table th:first-of-type {
    width: 14%;
}
table th:nth-of-type(2) {
    width: 86%;
}
</style>

# 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.

> caption `<fontLibrary>` element

| Category        | Description                                                                                                                                                                                                                                                                             |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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`.<br/>Default value: **true**. |
| Child Elements  | **fontLocations** - Optional element. Adds collection with font locations.                                                                                                                                                                                                              |
| Parent Elements | <ul><li>**configuration** - Specifies the root element in every configuration file that is used by the common language runtime and the .NET Framework applications.</li><li>**Telerik.Reporting** - Configures all settings that Telerik Reporting Engine uses.</li></ul>               |

> caption `<fontLocations>` element

| Category       | Description                                                         |
| -------------- | ------------------------------------------------------------------- |
| Attributes     | No attributes are defined for this element.                         |
| Child elements | **add** - Optional element. Adds a font location to the collection. |
| Parent element | **fontLibrary**                                                     |

> caption `<add>` element

| Category       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Attributes     | <table><colgroup><col span="1" style="width: 17%;"><col span="1" style="width: 83%;"></colgroup><thead><tr><th scope="col">Attribute</th><th scope="col">Description</th></tr></thead><tbody><tr><td><strong>path</strong></td><td>Required attribute. Specifies the path to a fonts folder. The path can be absolute or relative to the current application folder.</td></tr><tr><td><strong>searchSubfolders</strong></td><td>Required attribute. Determines if the subfolders of the specified path will be recursively traversed. </td></tr></tbody></table> |
| Child elements | None                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Parent element | **fontLocations**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

## Font Discovery and Application Restarts

For the Linux/macOS GDI-based PDF font resolver, the configured font folders are scanned when the font library is first initialized. This initialization occurs on first use, not necessarily at application startup.

During normal operation, the resolver reuses the in-memory font library and does not automatically rescan the folders when font files are added. Fonts added before the initial scan can be discovered by that scan. Fonts added after initialization are not automatically registered. Restart the hosting application or Reporting REST Service after adding fonts so that the library is rebuilt.

## 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
﻿<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<configSections>
		<section name="Telerik.Reporting"
		         type="Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting"
		         allowLocation="true"
		         allowDefinition="Everywhere"/>
	</configSections>
	<Telerik.Reporting>
		<fontLibrary useDefaultLocations="false">
			<fontLocations>
				<add path="/usr/customFonts/trueType"
				     searchSubfolders="true"/>
			</fontLocations>
		</fontLibrary>
	</Telerik.Reporting>
</configuration>
```

```JSON
"telerikReporting": {
    "fontLibrary": {
        "useDefaultLocations": false,
        "fontLocations": [
            {
                "path": "/usr/customFonts/trueType",
                "searchSubfolders": true
            }
        ]
    }
}
```

## See Also

* [Configure the Report Engine Overview](https://www.telerik.com/products/reporting/documentation/doc-output/configure-the-report-engine/overview)
