Sets the sources to look for TrueType fonts when rendering documents.
The method accepts any combination of individual IFontSource objects, lists of them, or a mixture of both; all inputs are flattened into a single list before being applied. String paths are passed through as‑is and are not split into characters.
defset_font_sources(cls,font_sources):...
Parameter
Type
Description
font_sources
list[IFontSource]
The font sources.
Raises
Description
ValueError
When font_sources is None.
Example
fromgroupdocs.viewer.fontsimportFontSettings,FolderFontSource,SearchOptionsrc1=FolderFontSource("C:/fonts/primary",SearchOption.ALL_FOLDERS)src2=FolderFontSource("C:/fonts/backup",SearchOption.TOP_FOLDER_ONLY)# varargsFontSettings.set_font_sources(src1,src2)# single listFontSettings.set_font_sources([src1,src2])# multiple lists (flattened)FontSettings.set_font_sources([src1],[src2])# mixed — also flattenedFontSettings.set_font_sources([src1,src2],src2)