private static void parseDirectories(ByteBuffer data,int numTables,TrueTypeFont ttf){
  for (int i=0; i < numTables; i++) {
    int tag=data.getInt();
    String tagString=TrueTypeTable.tagToString(tag);
    int checksum=data.getInt();
    int offset=data.getInt();
    int length=data.getInt();
    data.mark();
    data.position(offset);
    ByteBuffer tableData=data.slice();
    tableData.limit(length);
    int calcChecksum=calculateChecksum(tagString,tableData);
    if (calcChecksum == checksum) {
      ttf.addTable(tagString,tableData);
    }
 else {
      ttf.addTable(tagString,tableData);
    }
    data.reset();
  }
}

private static void parseDirectories ( ByteBuffer data , int numTables , TrueTypeFont ttf ) { for ( int i = 0 ; i < numTables ; i ++ ) { int tag = data . getInt ( ) ; String tagString = TrueTypeTable . tagToString ( tag ) ; int checksum = data . getInt ( ) ; int offset = data . getInt ( ) ; int length = data . getInt ( ) ; data . mark ( ) ; data . position ( offset ) ; ByteBuffer tableData = data . slice ( ) ; tableData . limit ( length ) ; int calcChecksum = calculateChecksum ( tagString , tableData ) ; if ( calcChecksum == checksum ) { ttf . addTable ( tagString , tableData ) ; } else { ttf . addTable ( tagString , tableData ) ; } data . reset ( ) ; } }
get directory entries from a font
