}
try
{
// check for 'name' table
NamingTable nameTable = ttf.getNaming();
if (nameTable == null)
{
LOG.warn("Missing 'name' table in font " + otfFile);
}
else
{
// read PostScript name, if any
if (nameTable.getPostScriptName() != null)
{
String psName = nameTable.getPostScriptName();
String format;
if (ttf.getTableMap().get("CFF ") != null)
{
format = "OTF";
cffFontFiles.put(psName, otfFile);
}
else
{
format = "TTF";
ttfFontFiles.put(psName, otfFile);
}
if (LOG.isTraceEnabled())
{
LOG.trace(format +": '" + psName + "' / '" + nameTable.getFontFamily() +
"' / '" + nameTable.getFontSubFamily() + "'");
}
}
else
{
LOG.warn("Missing 'name' entry for PostScript name in font " + otfFile);