private void readBbox() throws DocumentException, IOException {
int tableLocation[];
tableLocation = (int[])tables.get("head");
if (tableLocation == null)
throw new DocumentException("Table 'head' does not exist in " + fileName + style);
rf.seek(tableLocation[0] + TrueTypeFontSubSet.HEAD_LOCA_FORMAT_OFFSET);
boolean locaShortTable = (rf.readUnsignedShort() == 0);
tableLocation = (int[])tables.get("loca");
if (tableLocation == null)
return;
rf.seek(tableLocation[0]);
int locaTable[];
if (locaShortTable) {
int entries = tableLocation[1] / 2;
locaTable = new int[entries];
for (int k = 0; k < entries; ++k)
locaTable[k] = rf.readUnsignedShort() * 2;
}
else {
int entries = tableLocation[1] / 4;
locaTable = new int[entries];
for (int k = 0; k < entries; ++k)
locaTable[k] = rf.readInt();
}
tableLocation = (int[])tables.get("glyf");
if (tableLocation == null)
throw new DocumentException("Table 'glyf' does not exist in " + fileName + style);
int tableGlyphOffset = tableLocation[0];
bboxes = new int[locaTable.length - 1][];
for (int glyph = 0; glyph < locaTable.length - 1; ++glyph) {
int start = locaTable[glyph];
if (start != locaTable[glyph + 1]) {