Closeable
, AutoCloseable
public class TrueTypeCollection extends Object implements Closeable
Modifier and Type | Class | Description |
---|---|---|
static interface |
TrueTypeCollection.TrueTypeFontProcessor |
Implement the callback method to call
processAllFonts(TrueTypeFontProcessor) . |
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.
|
Modifier and Type | Method | Description |
---|---|---|
void |
close() |
|
TrueTypeFont |
getFontByName(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(File file) throws IOException
file
- The TTC file.IOException
- If the font could not be parsed.public TrueTypeCollection(InputStream stream) throws IOException
stream
- A TTC input stream.IOException
- If the font could not be parsed.public void processAllFonts(TrueTypeCollection.TrueTypeFontProcessor trueTypeFontProcessor) throws IOException
trueTypeFontProcessor
- the object with the callback method.IOException
public TrueTypeFont getFontByName(String name) throws IOException
name
- The postscript name of the font.IOException
public void close() throws IOException
close
in interface AutoCloseable
close
in interface Closeable
IOException
Copyright © 2008–2018. All rights reserved.