public class TrueTypeCollection extends Object implements Closeable
Modifier and Type | Class and Description |
---|---|
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.
|
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 Closeable
close
in interface AutoCloseable
IOException
Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.