{
pdfFont = (PdfFont) fontMap.get(key);
}
else
{
FontInfo fontInfo = JRFontUtil.getFontInfo(jrFont.getFontName(), locale);
if (fontInfo == null)
{
//fontName NOT found in font extensions
pdfFont = new PdfFont(jrFont.getPdfFontName(), jrFont.getPdfEncoding(), jrFont.isPdfEmbedded());
}
else
{
//fontName found in font extensions
FontFamily family = fontInfo.getFontFamily();
FontFace face = fontInfo.getFontFace();
int faceStyle = java.awt.Font.PLAIN;
if (face == null)
{
//fontName matches family name in font extension
if (jrFont.isBold() && jrFont.isItalic())
{
face = family.getBoldItalicFace();
faceStyle = java.awt.Font.BOLD | java.awt.Font.ITALIC;
}
if (face == null && jrFont.isBold())
{
face = family.getBoldFace();
faceStyle = java.awt.Font.BOLD;
}
if (face == null && jrFont.isItalic())
{
face = family.getItalicFace();
faceStyle = java.awt.Font.ITALIC;
}
if (face == null)
{
face = family.getNormalFace();
faceStyle = java.awt.Font.PLAIN;
}
// if (face == null)
// {
// throw new JRRuntimeException("Font family '" + family.getName() + "' does not have the normal font face.");
// }
}
else
{
//fontName matches face name in font extension; not family name
faceStyle = fontInfo.getStyle();
}
String pdfFontName = null;
int pdfFontStyle = java.awt.Font.PLAIN;
if (jrFont.isBold() && jrFont.isItalic())