From 92ca968f8c1bb90a6b6110c589c0484e08323ca4 Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Sun, 8 Apr 2012 21:29:28 +0000 Subject: Bugzilla #52966: How to use native text with EPSDocumentGraphics2D. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1311103 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fonts/FontInfo.java | 4 ++-- src/java/org/apache/fop/render/ps/NativeTextHandler.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/java') diff --git a/src/java/org/apache/fop/fonts/FontInfo.java b/src/java/org/apache/fop/fonts/FontInfo.java index a38a5b480..cb1827e51 100644 --- a/src/java/org/apache/fop/fonts/FontInfo.java +++ b/src/java/org/apache/fop/fonts/FontInfo.java @@ -474,7 +474,7 @@ public class FontInfo { FontTriplet key = null; String f = null; int newWeight = weight; - if (newWeight <= 400) { + if (newWeight < 400) { while (f == null && newWeight > 100) { newWeight -= 100; key = createFontKey(family, style, newWeight); @@ -486,7 +486,7 @@ public class FontInfo { key = createFontKey(family, style, newWeight); f = getInternalFontKey(key); } - } else if (newWeight == 500) { + } else if (newWeight == 400 || newWeight == 500) { key = createFontKey(family, style, 400); f = getInternalFontKey(key); } else if (newWeight > 500) { diff --git a/src/java/org/apache/fop/render/ps/NativeTextHandler.java b/src/java/org/apache/fop/render/ps/NativeTextHandler.java index 5a39842fb..33adcb8d7 100644 --- a/src/java/org/apache/fop/render/ps/NativeTextHandler.java +++ b/src/java/org/apache/fop/render/ps/NativeTextHandler.java @@ -166,7 +166,7 @@ public class NativeTextHandler implements PSTextHandler { if ((currentFontName != this.font.getFontName()) || (currentFontSize != this.font.getFontSize())) { PSGenerator gen = getPSGenerator(); - gen.writeln(this.font.getFontName() + " " + gen.writeln("/" + this.font.getFontTriplet().getName() + " " + gen.formatDouble(font.getFontSize() / 1000f) + " F"); currentFontName = this.font.getFontName(); currentFontSize = this.font.getFontSize(); -- cgit v1.2.3