public class TrueTypeCollection extends Object
| Modifier and Type | Field and Description |
|---|---|
protected RandomAccessFileOrArray |
raf |
| Constructor and Description |
|---|
TrueTypeCollection(byte[] ttc)
Creates a new
TrueTypeCollection instance by its bytes. |
TrueTypeCollection(String ttcPath)
Creates a new
TrueTypeCollection instance by its file path. |
| Modifier and Type | Method and Description |
|---|---|
FontProgram |
getFontByTccIndex(int ttcIndex)
method return TrueTypeFont by ttc index
|
int |
getTTCSize()
returns the number of fonts in True Type Collection (file or bytes array)
|
boolean |
isCached()
Indicates if fonts created by the call to
getFontByTccIndex(int) will be cached or not. |
void |
setCached(boolean cached)
Sets if fonts created by the call to
getFontByTccIndex(int) will be cached or not. |
protected RandomAccessFileOrArray raf
public TrueTypeCollection(byte[] ttc)
throws IOException
TrueTypeCollection instance by its bytes.ttc - the byte contents of the collectionIOException - in case the input in mal-formattedpublic TrueTypeCollection(String ttcPath) throws IOException
TrueTypeCollection instance by its file path.ttcPath - the path of the collectionIOException - in case the input in mal-formattedpublic FontProgram getFontByTccIndex(int ttcIndex) throws IOException
ttcIndex - the index for the TTC fontIOException - in case TTC index does not exist in this TTC filepublic int getTTCSize()
public boolean isCached()
getFontByTccIndex(int) will be cached or not.true if the created fonts will be cached, false otherwisepublic void setCached(boolean cached)
getFontByTccIndex(int) will be cached or not.cached - true if the created fonts will be cached, false otherwiseCopyright © 1998–2022 iText Group NV. All rights reserved.