From df6829db5b32697996fd41673384a696de4c9c13 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Fri, 29 Feb 2008 14:03:01 +0000 Subject: [PATCH] Bugfix: Disabled setting widths from AFM since we're using WinAnsiEncoding internally but the AFM delivers the character widths using the font's native encoding which causes problems with some characters. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@632321 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/fop/fonts/type1/Type1FontLoader.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java b/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java index 910ee82cc..473ee9a08 100644 --- a/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java +++ b/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java @@ -108,6 +108,11 @@ public class Type1FontLoader extends FontLoader { throw new java.io.FileNotFoundException( "Neither an AFM nor a PFM file was found for " + this.fontFileURI); } + if (pfm == null) { + //Cannot do without the PFM for now + throw new java.io.FileNotFoundException( + "No PFM file was found for " + this.fontFileURI); + } buildFont(afm, pfm); this.loaded = true; } @@ -266,8 +271,11 @@ public class Type1FontLoader extends FontLoader { returnFont.setCapHeight(returnFont.getAscender()); } + /* DISABLED because of mismatch with our using WinAnsiEncoding and the AFM + delivering the font's default encoding. if (afm != null) { //TODO returnFont.setFlags(flags); + returnFont.setFirstChar(afm.getFirstChar()); returnFont.setLastChar(afm.getLastChar()); Iterator iter = afm.getCharMetrics().iterator(); @@ -278,7 +286,7 @@ public class Type1FontLoader extends FontLoader { } } returnFont.replaceKerningMap(afm.createXKerningMapEncoded()); - } else { + } else {*/ returnFont.setFlags(pfm.getFlags()); returnFont.setFirstChar(pfm.getFirstChar()); returnFont.setLastChar(pfm.getLastChar()); @@ -286,7 +294,7 @@ public class Type1FontLoader extends FontLoader { singleFont.setWidth(i, pfm.getCharWidth(i)); } returnFont.replaceKerningMap(pfm.getKerning()); - } + //} } private CodePointMapping buildCustomEncoding(String encodingName, AFMFile afm) { -- 2.39.5