public void initData(TrueTypeFont ttf,
TTFDataStream data) throws IOException {
MaximumProfileTable maxp = ttf.getMaximumProfile();
IndexToLocationTable loc = ttf.getIndexToLocation();
PostScriptTable post = ttf.getPostScript();
long[] offsets = loc.getOffsets();
int numGlyphs = maxp.getNumGlyphs();
glyphs = new GlyphData[numGlyphs];
String[] glyphNames = post.getGlyphNames();
for( int i=0; i< numGlyphs-1; i++ )
{
GlyphData glyph = new GlyphData();
data.seek( getOffset() + offsets[i] );
glyph.initData( ttf, data );
glyphs[i] = glyph;
}
}
This will read the required data from the stream. |