From 4189170667e5712e3bf1caf2c7560bccd876d5f2 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Mon, 18 Feb 2008 16:45:18 +0000 Subject: Reducing noise. Better messages. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@628804 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/fonts/truetype/TTFFile.java | 13 ++++++++----- src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/java/org/apache/fop/fonts/truetype/TTFFile.java b/src/java/org/apache/fop/fonts/truetype/TTFFile.java index fe40c4b33..86a1d75e2 100644 --- a/src/java/org/apache/fop/fonts/truetype/TTFFile.java +++ b/src/java/org/apache/fop/fonts/truetype/TTFFile.java @@ -222,7 +222,9 @@ public class TTFFile { int cmapEID = in.readTTFUShort(); long cmapOffset = in.readTTFULong(); - log.debug("Platform ID: " + cmapPID + " Encoding: " + cmapEID); + if (log.isDebugEnabled()) { + log.debug("Platform ID: " + cmapPID + " Encoding: " + cmapEID); + } if (cmapPID == 3 && cmapEID == 1) { cmapUniOffset = cmapOffset; @@ -230,8 +232,7 @@ public class TTFFile { } if (cmapUniOffset <= 0) { - log.fatal("Unicode cmap table not present"); - log.fatal("Unsupported format: Aborting"); + log.fatal("Unsupported TrueType font: Unicode cmap table not present. Aborting"); return false; } @@ -1333,9 +1334,11 @@ public class TTFFile { if (iObj == null) { // happens for many fonts (Ubuntu font set), // stray entries in the kerning table?? - log.warn("Unicode index (1) not found for glyph " + i); + log.debug("Ignoring kerning pair because no Unicode index was" + + " found for the first glyph " + i); } else if (u2 == null) { - log.warn("Unicode index (2) not found for glyph " + i); + log.debug("Ignoring kerning pair because Unicode index was" + + " found for the second glyph " + i); } else { Map adjTab = (Map)kerningTab.get(iObj); if (adjTab == null) { diff --git a/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java b/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java index 5c9e51c81..b29aff808 100644 --- a/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java +++ b/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java @@ -57,7 +57,7 @@ public class TTFFontLoader extends FontLoader { FontFileReader reader = new FontFileReader(in); boolean supported = ttf.readFont(reader, null); if (!supported) { - throw new IOException("Could not load TrueType font: " + fontFileURI); + throw new IOException("TrueType font is not supported: " + fontFileURI); } buildFont(ttf); loaded = true; -- cgit v1.2.3