public class BasicTextShaperCache extends java.lang.Object implements ITextShaperFactory
ITextShaper instances. This class is thread-safe.| Constructor and Description |
|---|
BasicTextShaperCache(ITextShaperFactory factory)
Wraps
factory and caches ITextShaperFactory.getTextShaper(java.lang.String, int) results. |
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Disposes cached
ITextShaper instances. |
ITextShaper |
getTextShaper(java.lang.String fontId,
byte[] fontBlob,
int faceIndex)
Returns new instance of a text shaper for the font represented by
fontBlob and faceIndex. |
ITextShaper |
getTextShaper(java.lang.String fontPath,
int faceIndex)
Returns new instance of a text shaper for the font specified by
fontPath and faceIndex. |
public BasicTextShaperCache(ITextShaperFactory factory)
factory and caches ITextShaperFactory.getTextShaper(java.lang.String, int) results.public ITextShaper getTextShaper(java.lang.String fontPath, int faceIndex)
ITextShaperFactoryfontPath and faceIndex.getTextShaper in interface ITextShaperFactoryfontPath - An absolute path to the font file.faceIndex - An index of the font face in the TrueType font collection, or 0 if specified font file is not TrueType font collection.public ITextShaper getTextShaper(java.lang.String fontId, byte[] fontBlob, int faceIndex)
ITextShaperFactoryfontBlob and faceIndex.getTextShaper in interface ITextShaperFactoryfontId - A unique identifier that can be uniquely associated with the provided font fontBlob.fontBlob - Byte array with the font data.faceIndex - An index of the font face in the TrueType font collection, or 0 if fontBlob is not TrueType font collection.public void dispose()
throws java.lang.Exception
ITextShaper instances.java.lang.Exception