diff options
author | Jeremias Maerki <jeremias@apache.org> | 2010-05-17 11:41:33 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2010-05-17 11:41:33 +0000 |
commit | 4479bd983006197215e8ca8264f7b7fa9d507535 (patch) | |
tree | 3b50cb011f650b0f8805c2abf8ab6d0baa637a4d /src/java | |
parent | 5b75bee76bcd92c0a9af32ca24b4f42db55686cf (diff) | |
download | xmlgraphics-fop-4479bd983006197215e8ca8264f7b7fa9d507535.tar.gz xmlgraphics-fop-4479bd983006197215e8ca8264f7b7fa9d507535.zip |
Don't fail on AFM just because it has a Start/EndTrackKern section. Log a warning instead of throwing an exception when an unimplemented feature is found.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@945098 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r-- | src/java/org/apache/fop/fonts/type1/AFMParser.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/fonts/type1/AFMParser.java b/src/java/org/apache/fop/fonts/type1/AFMParser.java index 0479c57a7..0a035238a 100644 --- a/src/java/org/apache/fop/fonts/type1/AFMParser.java +++ b/src/java/org/apache/fop/fonts/type1/AFMParser.java @@ -30,6 +30,8 @@ import java.util.Map; import java.util.Stack; import org.apache.commons.io.IOUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.fop.fonts.NamedCharacter; @@ -38,6 +40,8 @@ import org.apache.fop.fonts.NamedCharacter; */ public class AFMParser { + private static Log log = LogFactory.getLog(AFMParser.class); + private static final String START_FONT_METRICS = "StartFontMetrics"; //private static final String END_FONT_METRICS = "EndFontMetrics"; private static final String FONT_NAME = "FontName"; @@ -82,6 +86,9 @@ public class AFMParser { //private static final String START_KERN_PAIRS0 = "StartKernPairs0"; private static final String START_KERN_PAIRS1 = "StartKernPairs1"; //private static final String END_KERN_PAIRS = "EndKernPairs"; + private static final String START_COMPOSITES = "StartComposites"; + private static final String START_COMP_FONT_METRICS = "StartCompFontMetrics"; + private static final String KP = "KP"; private static final String KPH = "KPH"; private static final String KPX = "KPX"; @@ -131,8 +138,9 @@ public class AFMParser { VALUE_PARSERS.put(N, new NamedCharacterSetter("Character")); VALUE_PARSERS.put(B, new CharBBox()); VALUE_PARSERS.put(START_TRACK_KERN, new NotImplementedYet(START_TRACK_KERN)); - VALUE_PARSERS.put(END_TRACK_KERN, new NotImplementedYet(END_TRACK_KERN)); VALUE_PARSERS.put(START_KERN_PAIRS1, new NotImplementedYet(START_KERN_PAIRS1)); + VALUE_PARSERS.put(START_COMPOSITES, new NotImplementedYet(START_COMPOSITES)); + VALUE_PARSERS.put(START_COMP_FONT_METRICS, new NotImplementedYet(START_COMP_FONT_METRICS)); VALUE_PARSERS.put(KP, new NotImplementedYet(KP)); VALUE_PARSERS.put(KPH, new NotImplementedYet(KPH)); VALUE_PARSERS.put(KPX, new KPXHandler()); @@ -578,8 +586,8 @@ public class AFMParser { } public void parse(String line, int startpos, Stack stack) throws IOException { - throw new IOException("Support for '" + key - + "' has not been implemented, yet! Font is not supported."); + log.warn("Support for '" + key + "' has not been implemented, yet!" + + " Some font data in the AFM file will be ignored."); } } |