This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/document-engine/configuration/preferred-annotation-fonts.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Preferred annotation fonts in Document Engine

Set PSPDFKIT_PREFERRED_FONTS so Document Engine tries preferred fonts before it uses the general annotation font fallback behavior.

Use this setting when users create annotations with custom fonts in Nutrient Web SDK standalone and Document Engine processes those annotations later. For example, if users create free text annotations with Arabic, Japanese, or Chinese text in Nutrient Web SDK standalone, configure the same fonts in Document Engine so exported PDFs use matching annotation fallback fonts.

How it works

Document Engine first tries to resolve the font requested by the annotation. If that font is unavailable or can’t render the annotation text, Document Engine tries the fonts configured in PSPDFKIT_PREFERRED_FONTS in order. If none of the preferred fonts can render the text, Document Engine uses its default fallback behavior.

Configure preferred fonts

Mount the font files in the /custom-fonts directory. Then set PSPDFKIT_PREFERRED_FONTS to a comma-separated list of font names or family names:

Terminal window
PSPDFKIT_PREFERRED_FONTS=NotoSansArabic-Regular,NotoSansJP-Regular

Each value must be a font name or family name that Document Engine can resolve from its configured fonts. Font names and family names are case-sensitive, so use the exact values from the configured font metadata. Don’t pass font file paths in this variable.

To add font files to Document Engine, refer to the custom fonts guide. To configure custom fonts in Nutrient Web SDK standalone, refer to the Web SDK custom fonts guide.