Package org.apache.fontbox.ttf
Class GlyphTable
- java.lang.Object
-
- org.apache.fontbox.ttf.TTFTable
-
- org.apache.fontbox.ttf.GlyphTable
-
public class GlyphTable extends TTFTable
A table in a true type font.
-
-
Field Summary
Fields Modifier and Type Field Description private intcachedprivate TTFDataStreamdataprivate GlyphData[]glyphsprivate IndexToLocationTablelocaprivate static intMAX_CACHE_SIZEDon't even bother to cache huge fonts.private static intMAX_CACHED_GLYPHSDon't cache more glyphs than this.private intnumGlyphsstatic java.lang.StringTAGTag to identify this table.-
Fields inherited from class org.apache.fontbox.ttf.TTFTable
font, initialized
-
-
Constructor Summary
Constructors Constructor Description GlyphTable(TrueTypeFont font)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description GlyphDatagetGlyph(int gid)Returns the data for the glyph with the given GID.private GlyphDatagetGlyphData(int gid)GlyphData[]getGlyphs()Deprecated.usegetGlyph(int)instead.(package private) voidread(TrueTypeFont ttf, TTFDataStream data)This will read the required data from the stream.voidsetGlyphs(GlyphData[] glyphsValue)-
Methods inherited from class org.apache.fontbox.ttf.TTFTable
getCheckSum, getInitialized, getLength, getOffset, getTag, setCheckSum, setLength, setOffset, setTag
-
-
-
-
Field Detail
-
TAG
public static final java.lang.String TAG
Tag to identify this table.- See Also:
- Constant Field Values
-
glyphs
private GlyphData[] glyphs
-
data
private TTFDataStream data
-
loca
private IndexToLocationTable loca
-
numGlyphs
private int numGlyphs
-
cached
private int cached
-
MAX_CACHE_SIZE
private static final int MAX_CACHE_SIZE
Don't even bother to cache huge fonts.- See Also:
- Constant Field Values
-
MAX_CACHED_GLYPHS
private static final int MAX_CACHED_GLYPHS
Don't cache more glyphs than this.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GlyphTable
GlyphTable(TrueTypeFont font)
-
-
Method Detail
-
read
void read(TrueTypeFont ttf, TTFDataStream data) throws java.io.IOException
This will read the required data from the stream.
-
getGlyphs
@Deprecated public GlyphData[] getGlyphs() throws java.io.IOException
Deprecated.usegetGlyph(int)instead. This will be removed in 3.0. If you need this method, please create an issue in JIRA.Returns all glyphs. This method can be very slow.- Throws:
java.io.IOException- If there is an error reading the data.
-
setGlyphs
public void setGlyphs(GlyphData[] glyphsValue)
- Parameters:
glyphsValue- The glyphs to set.
-
getGlyph
public GlyphData getGlyph(int gid) throws java.io.IOException
Returns the data for the glyph with the given GID.- Parameters:
gid- GID- Throws:
java.io.IOException- if the font cannot be read
-
getGlyphData
private GlyphData getGlyphData(int gid) throws java.io.IOException
- Throws:
java.io.IOException
-
-