}
fontFamily = fam.getFamilyName();
if (fi.hasFont(fontFamily, style, weight)) {
String fname = fontInfo.fontLookup(fontFamily, style,
weight);
FontMetrics metrics = fontInfo.getMetricsFor(fname);
int fsize = (int)(size.floatValue() * 1000);
fontState = new Font(fname, metrics, fsize);
found = true;
break;
}
}
}
if (!found) {
String fname =
fontInfo.fontLookup("any", style, Font.NORMAL);
FontMetrics metrics = fontInfo.getMetricsFor(fname);
int fsize = (int)(size.floatValue() * 1000);
fontState = new Font(fname, metrics, fsize);
} else {
if (g2d instanceof PDFGraphics2D) {
((PDFGraphics2D) g2d).setOverrideFontState(fontState);