public class FontUtils
extends java.lang.Object
Constructor and Description |
---|
FontUtils() |
Modifier and Type | Method and Description |
---|---|
static CMapTable |
getCMapTable(Font font)
Gets the cmap table for the given font
|
static Font[] |
getFonts(java.io.InputStream is)
Gets a Font object for a font file in the InputStream
|
static Font[] |
getFonts(java.lang.String fontFile)
Gets a Font object for a font file in the given path
|
static java.lang.String |
getFormattedCodePointString(int codePoint)
Gets a string version of the code point formatted as "U+hhhh" or "U+hhhhhh"
|
static GlyphTable |
getGlyphTable(Font font)
Gets the glyph table for the given font
|
static LocaTable |
getLocaTable(Font font)
Gets the loca table for the given font
|
static Table |
getTable(Font font,
int tag)
Gets the table with the specified tag for the given font
|
static CMap |
getUCSCMap(Font font)
Gets either a UCS4 or UCS2 cmap, if available
|
public static Font[] getFonts(java.lang.String fontFile) throws java.io.IOException
fontFile
- the path to the font filejava.io.IOException
- if font file does not exist or is invalidpublic static Font[] getFonts(java.io.InputStream is) throws java.io.IOException
is
- an InputStream containing the font filejava.io.IOException
- if font file or is invalidpublic static Table getTable(Font font, int tag)
font
- the source fonttag
- the tag for the table to returnjava.lang.UnsupportedOperationException
- if the font does not contain the table with the specified tagTag
public static CMapTable getCMapTable(Font font)
font
- the source fontjava.lang.UnsupportedOperationException
- if the font does not contain a valid cmap tablepublic static CMap getUCSCMap(Font font)
font
- the source fontjava.lang.UnsupportedOperationException
- if font does not contain a UCS-4 or UCS-2 cmappublic static LocaTable getLocaTable(Font font)
font
- the source fontjava.lang.UnsupportedOperationException
- if the font does not contain a valid loca tablepublic static GlyphTable getGlyphTable(Font font)
font
- the source fontjava.lang.UnsupportedOperationException
- if the font does not contain a valid glyph tablepublic static java.lang.String getFormattedCodePointString(int codePoint)
codePoint
- the code point to format