import org.apache.fop.fonts.Font;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.fonts.FontSetup;
-import org.apache.fop.fonts.FontTriplet;
import org.apache.fop.pdf.BitmapImage;
import org.apache.fop.pdf.PDFAnnotList;
import org.apache.fop.pdf.PDFColor;
* Returns a suitable internal font given an AWT Font instance.
* @param awtFont the AWT font
* @return the internal Font
+ * @deprecated use FontInfo.getFontInstanceForAWTFont(java.awt.Font awtFont) instead
*/
protected Font getInternalFontForAWTFont(java.awt.Font awtFont) {
- Font fontState;
- String n = awtFont.getFamily();
- if (n.equals("sanserif")) {
- n = "sans-serif";
- }
- float siz = awtFont.getSize2D();
- String style = awtFont.isItalic() ? "italic" : "normal";
- int weight = awtFont.isBold() ? Font.WEIGHT_BOLD : Font.WEIGHT_NORMAL;
- FontTriplet triplet = fontInfo.fontLookup(n, style, weight);
- fontState = fontInfo.getFontInstance(triplet, (int)(siz * 1000 + 0.5));
- return fontState;
+ return fontInfo.getFontInstanceForAWTFont(awtFont);
}
/**