{
TTFParser ttfParser = new TTFParser(false,true);
TrueTypeFont ttfFont = ttfParser.parseTTF(ttfFilename);
if (ttfFont != null)
{
NamingTable namingTable = ttfFont.getNaming();
if (namingTable != null && namingTable.getPSName() != null)
{
String normalizedName = normalizeFontname(namingTable.getPSName());
if (!ttfFontfiles.containsKey(normalizedName))
{
LOG.debug("Added font mapping "+normalizedName + " -=> "+ttfFilename);
ttfFontfiles.put(normalizedName, ttfFilename);
}
}
// take the font family name into account
if (namingTable != null && namingTable.getFontFamily() != null)
{
String normalizedName = normalizeFontFamily(namingTable.getFontFamily(), namingTable.getPSName());
if (!ttfFontfiles.containsKey(normalizedName))
{
LOG.debug("Added font mapping "+normalizedName + " -=> "+ttfFilename);
ttfFontfiles.put(normalizedName, ttfFilename);
}