From: Adrian Cumiskey Date: Wed, 5 Nov 2008 13:44:40 +0000 (+0000) Subject: Deprecated method. X-Git-Tag: fop-1_0~376^2~18 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c4b1cf56cd9fa706a20765ad2078e040eb4c67bc;p=xmlgraphics-fop.git Deprecated method. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@711564 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/svg/PDFGraphics2D.java b/src/java/org/apache/fop/svg/PDFGraphics2D.java index 172fafd0c..cafb5f4d3 100644 --- a/src/java/org/apache/fop/svg/PDFGraphics2D.java +++ b/src/java/org/apache/fop/svg/PDFGraphics2D.java @@ -62,7 +62,6 @@ import org.apache.batik.gvt.PatternPaint; 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; @@ -1454,19 +1453,10 @@ public class PDFGraphics2D extends AbstractGraphics2D { * 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); } /**