FileFontSource class
FileFontSource class
Represents the single TrueType font file stored in the file system. To learn more, visit the Working with Fonts documentation article.
Inheritance: FileFontSource → FontSourceBase
Constructors
Name | Description |
---|---|
FileFontSource(file_path) | Ctor. |
FileFontSource(file_path, priority) | Ctor. |
FileFontSource(file_path, priority, cache_key) | Ctor. |
Properties
Name | Description |
---|---|
cache_key | The key of this source in the cache. |
file_path | Path to the font file. |
priority | Returns the font source priority. (Inherited from FontSourceBase) |
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 font file in the local file system as a font source.
file_font_source = aw.fonts.FileFontSource(file_path=MY_DIR + 'Alte DIN 1451 Mittelschrift.ttf', priority=0)
doc = aw.Document()
doc.font_settings = aw.fonts.FontSettings()
doc.font_settings.set_fonts_sources(sources=[file_font_source])
self.assertEqual(MY_DIR + 'Alte DIN 1451 Mittelschrift.ttf', file_font_source.file_path)
self.assertEqual(aw.fonts.FontSourceType.FONT_FILE, file_font_source.type)
self.assertEqual(0, file_font_source.priority)
See Also
- module aspose.words.fonts
- class FontSourceBase