Package com.itextpdf.io.font
Class TrueTypeCollection
java.lang.Object
com.itextpdf.io.font.TrueTypeCollection
Use this class for working with true type collection font (*.ttc)
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTrueTypeCollection
(byte[] ttc) Creates a newTrueTypeCollection
instance by its bytes.TrueTypeCollection
(String ttcPath) Creates a newTrueTypeCollection
instance by its file path. -
Method Summary
Modifier and TypeMethodDescriptiongetFontByTccIndex
(int ttcIndex) method return TrueTypeFont by ttc indexint
returns the number of fonts in True Type Collection (file or bytes array)boolean
isCached()
Indicates if fonts created by the call togetFontByTccIndex(int)
will be cached or not.void
setCached
(boolean cached) Sets if fonts created by the call togetFontByTccIndex(int)
will be cached or not.
-
Field Details
-
raf
-
-
Constructor Details
-
TrueTypeCollection
Creates a newTrueTypeCollection
instance by its bytes.- Parameters:
-
ttc
- the byte contents of the collection - Throws:
-
IOException
- in case the input in mal-formatted
-
TrueTypeCollection
Creates a newTrueTypeCollection
instance by its file path.- Parameters:
-
ttcPath
- the path of the collection - Throws:
-
IOException
- in case the input in mal-formatted
-
-
Method Details
-
getFontByTccIndex
method return TrueTypeFont by ttc index- Parameters:
-
ttcIndex
- the index for the TTC font - Returns:
- TrueTypeFont
- Throws:
-
IOException
- in case TTC index does not exist in this TTC file
-
getTTCSize
public int getTTCSize()returns the number of fonts in True Type Collection (file or bytes array)- Returns:
- returns the number of fonts
-
isCached
public boolean isCached()Indicates if fonts created by the call togetFontByTccIndex(int)
will be cached or not.- Returns:
-
true
if the created fonts will be cached,false
otherwise
-
setCached
public void setCached(boolean cached) Sets if fonts created by the call togetFontByTccIndex(int)
will be cached or not.- Parameters:
-
cached
-true
if the created fonts will be cached,false
otherwise
-