From: Jeremias Maerki Date: Thu, 23 Jan 2003 08:37:37 +0000 (+0000) Subject: Temporary fix for an encoding mismatch (WinAnsiEncoding vs. ISOLatin1). The hyphen... X-Git-Tag: fop-0_20_5rc2~32 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=b1fbd45931b94b0ab6203e8ef3f6b362f5a7a8fb;p=xmlgraphics-fop.git Temporary fix for an encoding mismatch (WinAnsiEncoding vs. ISOLatin1). The hyphen character is the only character corrected. Submitted by: Arnd Beissner git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/fop-0_20_2-maintain@195877 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/org/apache/fop/render/ps/PSRenderer.java b/src/org/apache/fop/render/ps/PSRenderer.java index 0d9abeaba..63a030900 100644 --- a/src/org/apache/fop/render/ps/PSRenderer.java +++ b/src/org/apache/fop/render/ps/PSRenderer.java @@ -1,6 +1,6 @@ /* * $Id$ - * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved. + * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved. * For details on use and redistribution please refer to the * LICENSE file included with these sources. */ @@ -74,7 +74,8 @@ TODO-List: add a color to grayscale conversion for bitmaps to make output smaller (See PCLRenderer) - enhanced font support and font embedding -- support different character encodings +- fix character encodings (Helvetica uses WinAnsiEncoding internally but is + encoded as ISOLatin1 in PS) - try to implement image transparency - Add PPD support - fix border painting (see table.fo) @@ -706,10 +707,15 @@ public class PSRenderer extends AbstractRenderer { for (int i = 0; i < l; i++) { char ch = s.charAt(i); char mch = fs.mapChar(ch); - if (mch > 127) { + + /**@todo Do this in a clean way */ + // temp fix abe: map ascii '-' to ISO latin 1 hyphen char + if (mch == '-') { + sb = sb.append("\\" + Integer.toOctalString(173)); + } else /* fix ends */ if (mch > 127) { sb = sb.append("\\" + Integer.toOctalString(mch)); } else { - String escape = "\\()[]{}"; + final String escape = "\\()[]{}"; if (escape.indexOf(mch) >= 0) { sb.append("\\"); }