From: Glenn Adams Date: Sat, 7 Apr 2012 04:22:52 +0000 (+0000) Subject: Bugzilla #49302: Eliminate duplicate code. X-Git-Tag: fop-1_1rc1old~75 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=c0a106809375dbcbc3f793cd74bdaea22edfafe3;p=xmlgraphics-fop.git Bugzilla #49302: Eliminate duplicate code. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1310672 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/render/ps/NativeTextHandler.java b/src/java/org/apache/fop/render/ps/NativeTextHandler.java index e1171b3e1..a31d828b1 100644 --- a/src/java/org/apache/fop/render/ps/NativeTextHandler.java +++ b/src/java/org/apache/fop/render/ps/NativeTextHandler.java @@ -160,19 +160,7 @@ public class NativeTextHandler implements PSTextHandler { } private Font createFont(java.awt.Font f) { - String fontFamily = f.getFamily(); - if (fontFamily.equals("sanserif")) { - fontFamily = "sans-serif"; - } - int fontSize = 1000 * f.getSize(); - String style = f.isItalic() ? "italic" : "normal"; - int weight = f.isBold() ? Font.WEIGHT_BOLD : Font.WEIGHT_NORMAL; - - FontTriplet triplet = fontInfo.findAdjustWeight(fontFamily, style, weight); - if (triplet == null) { - triplet = fontInfo.findAdjustWeight("sans-serif", style, weight); - } - return fontInfo.getFontInstance(triplet, fontSize); + return fontInfo.getFontInstanceForAWTFont(f); } private void establishCurrentFont() throws IOException { diff --git a/status.xml b/status.xml index 28fef4011..27a82c2a0 100644 --- a/status.xml +++ b/status.xml @@ -62,6 +62,9 @@ documents. Example: the fix of marks layering will be such a case when it's done. --> + + Eliminate duplicate code. + Correct coding error in AFPResourceLevel#equals.