Package com.tom_roush.fontbox.ttf
Class TrueTypeCollection
- java.lang.Object
-
- com.tom_roush.fontbox.ttf.TrueTypeCollection
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class TrueTypeCollection extends Object implements Closeable
A TrueType Collection, now more properly known as a "Font Collection" as it may contain either TrueType or OpenType fonts.
-
-
Constructor Summary
Constructors Constructor Description TrueTypeCollection(File file)Creates a new TrueTypeCollection from a .ttc file.TrueTypeCollection(InputStream stream)Creates a new TrueTypeCollection from a .ttc input stream.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()List<TrueTypeFont>getFonts()Returns the fonts in the collection, these may beOpenTypeFontinstances.
-
-
-
Constructor Detail
-
TrueTypeCollection
public TrueTypeCollection(File file) throws IOException
Creates a new TrueTypeCollection from a .ttc file.- Parameters:
file- The TTC file.- Throws:
IOException- If the font could not be parsed.
-
TrueTypeCollection
public TrueTypeCollection(InputStream stream) throws IOException
Creates a new TrueTypeCollection from a .ttc input stream.- Parameters:
stream- A TTC input stream.- Throws:
IOException- If the font could not be parsed.
-
-
Method Detail
-
getFonts
public List<TrueTypeFont> getFonts()
Returns the fonts in the collection, these may beOpenTypeFontinstances.
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
-