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:
PSPDFKIT_PREFERRED_FONTS=NotoSansArabic-Regular,NotoSansJP-RegularEach 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.