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 collection
IOException
- in case the input in mal-formatted
public TrueTypeCollection(String ttcPath) throws IOException
TrueTypeCollection
instance by its file path.
ttcPath
- the path of the collection
IOException
- in case the input in mal-formatted
public FontProgram getFontByTccIndex(int ttcIndex) throws IOException
ttcIndex
- the index for the TTC font
IOException
- in case TTC index does not exist in this TTC file
public int getTTCSize()
public boolean isCached()
getFontByTccIndex(int)
will be cached or not.
true
if the created fonts will be cached, false
otherwise
public void setCached(boolean cached)
getFontByTccIndex(int)
will be cached or not.
cached
- true
if the created fonts will be cached, false
otherwise
Copyright © 1998–2022 iText Group NV. All rights reserved.