public abstract class StreamFontSource extends FontSourceBase
In order to use the stream font source you should create a derived class from the StreamFontSource and provide implementation of the openFontDataStream() method.
openFontDataStream() 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.
| Modifier | Constructor and Description |
|---|---|
protected |
StreamFontSource()
Initializes a new instance of this class.
|
protected |
StreamFontSource(int priority)
Initializes a new instance of this class.
|
protected |
StreamFontSource(int priority,
java.lang.String cacheKey)
Initializes a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCacheKey()
The key of this source in the cache.
|
java.lang.String |
getCacheKeyInternal() |
java.lang.String |
getFilePath() |
java.lang.Iterable |
getFontDataInternal() |
int |
getSize() |
int |
getType()
Returns the type of the font source.
|
abstract java.io.InputStream |
openFontDataStream()
This method should open the stream with font data on demand.
|
getAvailableFonts, getPriority, getPriorityInternal, getWarningCallback, setWarningCallbackprotected StreamFontSource()
protected StreamFontSource(int priority)
protected StreamFontSource(int priority,
java.lang.String cacheKey)
public java.lang.String getCacheKey()
String value.public final int getType()
getType in class FontSourceBaseFontSourceType constants.public abstract java.io.InputStream openFontDataStream()
throws java.lang.Exception
java.lang.Exceptionpublic int getSize()
public java.lang.String getFilePath()
public java.lang.String getCacheKeyInternal()
public java.lang.Iterable getFontDataInternal()
getFontDataInternal in class FontSourceBase