StreamFontSource class

StreamFontSource class

Base class for user-defined stream font source. To learn more, visit the Working with Fonts documentation article.

Remarks

In order to use the stream font source you should create a derived class from the StreamFontSource and provide implementation of the StreamFontSource.open_font_data_stream() method.

StreamFontSource.open_font_data_stream() method could be called several times. For the first time it will be called when Aspose.Words scans the provided font sources to get the list of available fonts. Later it may be called if the font is used in the document to parse the font data and to embed the font data to some output formats.

StreamFontSource may be useful because it allows to load the font data only when it is required and not to store it in the memory for the FontSettings lifetime.

Inheritance: StreamFontSourceFontSourceBase

Properties

NameDescription
cache_keyThe key of this source in the cache.
priorityReturns the font source priority.
(Inherited from FontSourceBase)
typeReturns the type of the font source.
warning_callbackCalled during processing of font source when an issue is detected that might result in formatting fidelity loss.
(Inherited from FontSourceBase)

Methods

NameDescription
get_available_fonts()Returns list of fonts available via this source.
(Inherited from FontSourceBase)
open_font_data_stream()This method should open the stream with font data on demand.

See Also