public class TrueTypeCollection
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Class and Description |
---|---|
static interface |
TrueTypeCollection.TrueTypeFontProcessor
Implement the callback method to call
processAllFonts(TrueTypeFontProcessor) . |
Constructor and Description |
---|
TrueTypeCollection(java.io.File file)
Creates a new TrueTypeCollection from a .ttc file.
|
TrueTypeCollection(java.io.InputStream stream)
Creates a new TrueTypeCollection from a .ttc input stream.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
TrueTypeFont |
getFontByName(java.lang.String name)
Get a TT font from a collection.
|
void |
processAllFonts(TrueTypeCollection.TrueTypeFontProcessor trueTypeFontProcessor)
Run the callback for each TT font in the collection.
|
public TrueTypeCollection(java.io.File file) throws java.io.IOException
file
- The TTC file.java.io.IOException
- If the font could not be parsed.public TrueTypeCollection(java.io.InputStream stream) throws java.io.IOException
stream
- A TTC input stream.java.io.IOException
- If the font could not be parsed.public void processAllFonts(TrueTypeCollection.TrueTypeFontProcessor trueTypeFontProcessor) throws java.io.IOException
trueTypeFontProcessor
- the object with the callback method.java.io.IOException
public TrueTypeFont getFontByName(java.lang.String name) throws java.io.IOException
name
- The postscript name of the font.java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
java.io.IOException