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
This 'glyf'-table is a required table in a TrueType font.
-
-
Field Summary
Fields Modifier and Type Field Description private intcachedprivate TTFDataStreamdataprivate GlyphData[]glyphsprivate HorizontalMetricsTablehmtprivate IndexToLocationTablelocaprivate static intMAX_CACHE_SIZEDon't even bother to cache huge fonts.private static intMAX_CACHED_GLYPHSDon't cache more glyphs than this.private MaximumProfileTablemaxpprivate intnumGlyphsstatic java.lang.StringTAGTag to identify this table.-
Fields inherited from class org.apache.fontbox.ttf.TTFTable
initialized
-
-
Constructor Summary
Constructors Constructor Description GlyphTable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GlyphDatagetGlyph(int gid)Returns the data for the glyph with the given GID.(package private) GlyphDatagetGlyph(int gid, int level)private GlyphDatagetGlyphData(int gid, int level)(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, readHeaders, 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
-
hmt
private HorizontalMetricsTable hmt
-
maxp
private MaximumProfileTable maxp
-
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
-
-
Method Detail
-
read
void read(TrueTypeFont ttf, TTFDataStream data) throws java.io.IOException
This will read the required data from the stream.
-
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- Returns:
- data of the glyph with the given GID or null
- Throws:
java.io.IOException- if the font cannot be read
-
getGlyph
GlyphData getGlyph(int gid, int level) throws java.io.IOException
- Throws:
java.io.IOException
-
getGlyphData
private GlyphData getGlyphData(int gid, int level) throws java.io.IOException
- Throws:
java.io.IOException
-
-