("The font '" + font.getFilename() + "' does not have a 'hhea' table. It is not valid.");
}
final String familyName = table.getPrimaryName(NameTable.NAME_FAMILY);
final DefaultFontFamily fontFamily = createFamily(familyName);
try
{
final TrueTypeFontRecord record = new TrueTypeFontRecord(font, fontFamily);
fontFamily.addFontRecord(record);
}
catch (FontException e)
{
logger.info("The font '" + font.getFilename() + "' is invalid.", e);
return;
}
registerPrimaryName(familyName, fontFamily);
registerAlternativeName(familyName, fontFamily);
final String[] allNames = table.getAllNames(NameTable.NAME_FAMILY);
final int nameCount = allNames.length;
for (int i = 0; i < nameCount; i++)
{
final String name = allNames[i];
fontFamily.addName(name);
registerAlternativeName(name, fontFamily);
}
final String[] allFullNames = table.getAllNames(NameTable.NAME_FULLNAME);
final int allNameCount = allFullNames.length;