From c0a106809375dbcbc3f793cd74bdaea22edfafe3 Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Sat, 7 Apr 2012 04:22:52 +0000 Subject: [PATCH] Bugzilla #49302: Eliminate duplicate code. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1310672 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/fop/render/ps/NativeTextHandler.java | 14 +------------- status.xml | 3 +++ 2 files changed, 4 insertions(+), 13 deletions(-) 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. -- 2.39.5