java.io.Closeable
, java.lang.AutoCloseable
public class TrueTypeCollection
extends java.lang.Object
implements java.io.Closeable
Modifier and Type | Class | Description |
---|---|---|
static interface |
TrueTypeCollection.TrueTypeFontProcessor |
Implement the callback method to call
processAllFonts(TrueTypeFontProcessor) . |
Constructor | 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 | 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.lang.AutoCloseable
close
in interface java.io.Closeable
java.io.IOException
Copyright © 2008–2018. All rights reserved.