From 04843a28c18a9f91e03f0990616b96306ab0c5c1 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Thu, 15 Nov 2007 13:28:58 +0000 Subject: [PATCH] Bugzilla #43143: Had to remove the Expert(Subset) Encoding detection as this caused problems with a barcode font that used dfCharset=2 but was not using ExpertSubset encoding. To detect Expert(Subset)Encoding, the AFM needs to be parsed. And since we don't support that encoding, yet, the fallback to WinAnsiEncoding should work well enough. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@595297 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fonts/type1/PFMFile.java | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/java/org/apache/fop/fonts/type1/PFMFile.java b/src/java/org/apache/fop/fonts/type1/PFMFile.java index c6dd3fb8d..a1e560746 100644 --- a/src/java/org/apache/fop/fonts/type1/PFMFile.java +++ b/src/java/org/apache/fop/fonts/type1/PFMFile.java @@ -28,6 +28,7 @@ import java.util.Map; import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; + import org.apache.fop.fonts.Glyphs; /** @@ -297,22 +298,24 @@ public class PFMFile { * @return The name of the charset. */ public String getCharSetName() { + //TODO Had to remove the detection for Expert(Subset) encoding. The PFM is not suitable + //for detecting these character sets. We have to parse the AFM for that. switch (dfCharSet) { case 0: return "WinAnsi"; // AKA ISOAdobe - case 1: - return "Expert"; case 2: if ("Symbol".equals(getPostscriptName())) { return "Symbol"; - } else { - return "ExpertSubset"; } + break; case 128: return "Shift-JIS (Japanese)"; default: - return "Unknown (" + dfCharSet + ", 0x" + Integer.toHexString(dfCharSet) + ")"; + log.warn("Unknown charset detected (" + dfCharSet + + ", 0x" + Integer.toHexString(dfCharSet) + + "). Trying fallback to WinAnsi."); } + return "WinAnsi"; } /** -- 2.39.5