Package org.apache.fontbox.ttf
Class GlyphTable
java.lang.Object
org.apache.fontbox.ttf.TTFTable
org.apache.fontbox.ttf.GlyphTable
A table in a true type font.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
private TTFDataStream
private GlyphData[]
private HorizontalMetricsTable
private IndexToLocationTable
private static final int
Don't even bother to cache huge fonts.private static final int
Don't cache more glyphs than this.private int
static final String
Tag to identify this table.Fields inherited from class org.apache.fontbox.ttf.TTFTable
font, initialized
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetGlyph
(int gid) Returns the data for the glyph with the given GID.private GlyphData
getGlyphData
(int gid) Deprecated.(package private) void
read
(TrueTypeFont ttf, TTFDataStream data) This will read the required data from the stream.void
Methods inherited from class org.apache.fontbox.ttf.TTFTable
getCheckSum, getInitialized, getLength, getOffset, getTag, setCheckSum, setLength, setOffset, setTag
-
Field Details
-
TAG
Tag to identify this table.- See Also:
-
glyphs
-
data
-
loca
-
numGlyphs
private int numGlyphs -
cached
private int cached -
hmt
-
MAX_CACHE_SIZE
private static final int MAX_CACHE_SIZEDon't even bother to cache huge fonts.- See Also:
-
MAX_CACHED_GLYPHS
private static final int MAX_CACHED_GLYPHSDon't cache more glyphs than this.- See Also:
-
-
Constructor Details
-
GlyphTable
GlyphTable(TrueTypeFont font)
-
-
Method Details
-
read
This will read the required data from the stream.- Overrides:
read
in classTTFTable
- Parameters:
ttf
- The font that is being read.data
- The stream to read the data from.- Throws:
IOException
- If there is an error reading the data.
-
getGlyphs
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:
IOException
- If there is an error reading the data.
-
setGlyphs
- Parameters:
glyphsValue
- The glyphs to set.
-
getGlyph
Returns the data for the glyph with the given GID.- Parameters:
gid
- GID- Throws:
IOException
- if the font cannot be read
-
getGlyphData
- Throws:
IOException
-
getGlyph(int)
instead.