public class TrueTypeCollection extends Object implements Closeable
| Modifier and Type | Class and Description |
|---|---|
static interface |
TrueTypeCollection.TrueTypeFontHeadersProcessor
Implement the callback method to call
processAllFontHeaders(File, TrueTypeFontHeadersProcessor). |
static interface |
TrueTypeCollection.TrueTypeFontProcessor
Implement the callback method to call
processAllFonts(TrueTypeFontProcessor). |
| Constructor and 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 and Description |
|---|---|
void |
close() |
TrueTypeFont |
getFontByName(String name)
Get a TT font from a collection.
|
static void |
processAllFontHeaders(File ttcFile,
TrueTypeCollection.TrueTypeFontHeadersProcessor trueTypeFontProcessor)
Run the callback for each TT font in the 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 - if something went wrong when parsing any font or calling the TrueTypeFontProcessorpublic static void processAllFontHeaders(File ttcFile, TrueTypeCollection.TrueTypeFontHeadersProcessor trueTypeFontProcessor) throws IOException
trueTypeFontProcessor - the object with the callback method.IOException - if something went wrong when parsing any fontpublic TrueTypeFont getFontByName(String name) throws IOException
name - The postscript name of the font.IOException - if there is an error reading the font datapublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2008–2025 The Apache Software Foundation. All rights reserved.