private void readGDEF() throws IOException {
TTFTableName tableTag = TTFTableName.GDEF;
// Initialize temporary state
initATState();
// Read glyph definition (GDEF) table
TTFDirTabEntry dirTab = ttf.getDirectoryEntry( tableTag );
if ( gdef != null ) {
if (log.isDebugEnabled()) {
log.debug(tableTag + ": ignoring duplicate table");
}
} else if (dirTab != null) {
ttf.seekTab(in, tableTag, 0);
long version = in.readTTFULong();
if (log.isDebugEnabled()) {
log.debug(tableTag + " version: " + ( version / 65536 ) + "." + ( version % 65536 ));
}
// glyph class definition table offset (may be null)
int cdo = in.readTTFUShort();
// attach point list offset (may be null)
int apo = in.readTTFUShort();
// ligature caret list offset (may be null)
int lco = in.readTTFUShort();
// mark attach class definition table offset (may be null)
int mao = in.readTTFUShort();
// mark glyph sets definition table offset (may be null)
int mgo;
if ( version >= 0x00010002 ) {
mgo = in.readTTFUShort();
} else {
mgo = 0;
}
if (log.isDebugEnabled()) {
log.debug(tableTag + " glyph class definition table offset: " + cdo );
log.debug(tableTag + " attachment point list offset: " + apo );
log.debug(tableTag + " ligature caret list offset: " + lco );
log.debug(tableTag + " mark attachment class definition table offset: " + mao );
log.debug(tableTag + " mark glyph set definitions table offset: " + mgo );
}
// initialize subtable sequence number
int seqno = 0;
// obtain offset to start of gdef table
long to = dirTab.getOffset();
// (optionally) read glyph class definition subtable
if ( cdo != 0 ) {
readGDEFClassDefTable ( tableTag, seqno++, to + cdo );
}
// (optionally) read glyph attachment point subtable