aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2007-05-25 12:52:22 +0000
committerJeremias Maerki <jeremias@apache.org>2007-05-25 12:52:22 +0000
commitc58159b0eb6e0fbeb6f598867256111f4ad73ade (patch)
tree8a909a145cea11693ba5c8fe61c063d86097299a
parent6a01a683b799193818be9db8f26b41a25081d319 (diff)
downloadxmlgraphics-fop-c58159b0eb6e0fbeb6f598867256111f4ad73ade.tar.gz
xmlgraphics-fop-c58159b0eb6e0fbeb6f598867256111f4ad73ade.zip
Checkstyle only.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@541628 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/java/org/apache/fop/fonts/apps/TTFReader.java16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/java/org/apache/fop/fonts/apps/TTFReader.java b/src/java/org/apache/fop/fonts/apps/TTFReader.java
index 95251d060..93388c34f 100644
--- a/src/java/org/apache/fop/fonts/apps/TTFReader.java
+++ b/src/java/org/apache/fop/fonts/apps/TTFReader.java
@@ -44,6 +44,7 @@ public class TTFReader extends AbstractFontReader {
/** Used to detect incompatible versions of the generated XML files */
public static final String METRICS_VERSION_ATTR = "metrics-version";
+ /** Current version number for the metrics file */
public static final int METRICS_VERSION = 2;
/**
@@ -243,7 +244,7 @@ public class TTFReader extends AbstractFontReader {
}
Element root = doc.createElement("font-metrics");
doc.appendChild(root);
- root.setAttribute(METRICS_VERSION_ATTR,String.valueOf(METRICS_VERSION));
+ root.setAttribute(METRICS_VERSION_ATTR, String.valueOf(METRICS_VERSION));
if (isCid) {
root.setAttribute("type", "TYPE0");
} else {
@@ -465,33 +466,34 @@ public class TTFReader extends AbstractFontReader {
return stb.toString();
}
- /** Bugzilla 40739, check that attr has a metrics-version attribute
- * compatible with ours.
+ /**
+ * Bugzilla 40739, check that attr has a metrics-version attribute
+ * compatible with ours.
* @param attr attributes read from the root element of a metrics XML file
* @throws SAXException if incompatible
*/
public static void checkMetricsVersion(Attributes attr) throws SAXException {
String err = null;
final String str = attr.getValue(METRICS_VERSION_ATTR);
- if(str==null) {
+ if (str == null) {
err = "Missing " + METRICS_VERSION_ATTR + " attribute";
} else {
int version = 0;
try {
version = Integer.parseInt(str);
- if(version < METRICS_VERSION) {
+ if (version < METRICS_VERSION) {
err = "Incompatible " + METRICS_VERSION_ATTR
+ " value (" + version + ", should be " + METRICS_VERSION
+ ")"
;
}
- } catch(NumberFormatException e) {
+ } catch (NumberFormatException e) {
err = "Invalid " + METRICS_VERSION_ATTR
+ " attribute value (" + str + ")";
}
}
- if(err!=null) {
+ if (err != null) {
throw new SAXException(
err
+ " - please regenerate the font metrics file with "