FolderFontSource class
FolderFontSource class
Represents the folder that contains TrueType font files. To learn more, visit the Working with Fonts documentation article.
Inheritance: FolderFontSource → FontSourceBase
Constructors
Name | Description |
---|---|
FolderFontSource(folder_path, scan_subfolders) | Ctor. |
FolderFontSource(folder_path, scan_subfolders, priority) | Ctor. |
Properties
Name | Description |
---|---|
folder_path | Path to the folder. |
priority | Returns the font source priority. (Inherited from FontSourceBase) |
scan_subfolders | Determines whether or not to scan the subfolders. |
type | Returns the type of the font source. |
warning_callback | Called during processing of font source when an issue is detected that might result in formatting fidelity loss. (Inherited from FontSourceBase) |
Methods
Name | Description |
---|---|
get_available_fonts() | Returns list of fonts available via this source. (Inherited from FontSourceBase) |
Examples
Shows how to use a local system folder which contains fonts as a font source.
# Create a font source from a folder that contains font files.
folder_font_source = aw.fonts.FolderFontSource(FONTS_DIR, False, 1)
doc = aw.Document()
doc.font_settings = aw.fonts.FontSettings()
doc.font_settings.set_fonts_sources([folder_font_source])
self.assertEqual(FONTS_DIR, folder_font_source.folder_path)
self.assertEqual(False, folder_font_source.scan_subfolders)
self.assertEqual(aw.fonts.FontSourceType.FONTS_FOLDER, folder_font_source.type)
self.assertEqual(1, folder_font_source.priority)
See Also
- module aspose.words.fonts
- class FontSourceBase