final int fontFormat = fsf.getAWTFontFormat();
if (fontFormat < 0) {
/* An AWT font cannot be created from this font file. */
return null;
}
final FontFileReader fontFileReader =
this.getRegisteredFont().getFontFileReader();
Font newFont = null;
if (getLogger().isDebugEnabled()) {
getLogger().debug("Create AWT font from: \n "
+ fontFileReader.getDescription());
}
InputStream fontStream = null;
try {
fontStream = fontFileReader.getInputStream();
newFont = Font.createFont(fontFormat, fontStream);
} catch (final IOException e) {
throw new FontException("Error reading input stream for: \n "
+ fontFileReader.getDescription(), e);
} catch (final IllegalArgumentException iae) {
/* Ignore this. This just means that the fontFormat is not one that
* java recognizes, probably because the runtime is lower than
* java 1.5. The proper things to do is just return null.*/
} catch (final FontFormatException ffe) {