]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Bugzilla #49302: Eliminate duplicate code.
authorGlenn Adams <gadams@apache.org>
Sat, 7 Apr 2012 04:22:52 +0000 (04:22 +0000)
committerGlenn Adams <gadams@apache.org>
Sat, 7 Apr 2012 04:22:52 +0000 (04:22 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1310672 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/ps/NativeTextHandler.java
status.xml

index e1171b3e18a5387c2d3644977a483f37ff97c94a..a31d828b1b307014a19cbebcd8ac7ce42153da8a 100644 (file)
@@ -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 {
index 28fef4011e3601d0b83b47d430d5c46be7b05772..27a82c2a0a6a99cd759ffd000e4ed1e0641211f0 100644 (file)
@@ -62,6 +62,9 @@
       documents. Example: the fix of marks layering will be such a case when it's done.
     -->
     <release version="FOP Trunk" date="TBD">
+      <action context="Code" dev="GA" type="fix" fixes-bug="49302" due-to="Julien Aymé">
+        Eliminate duplicate code.
+      </action>
       <action context="Code" dev="GA" type="fix" fixes-bug="49350" due-to="Julien Aymé">
         Correct coding error in AFPResourceLevel#equals.
       </action>