You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by je...@apache.org on 2007/05/25 14:52:23 UTC
svn commit: r541628 -
/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/TTFReader.java
Author: jeremias
Date: Fri May 25 05:52:22 2007
New Revision: 541628
URL: http://svn.apache.org/viewvc?view=rev&rev=541628
Log:
Checkstyle only.
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/TTFReader.java
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/TTFReader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/TTFReader.java?view=diff&rev=541628&r1=541627&r2=541628
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/TTFReader.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/apps/TTFReader.java Fri May 25 05:52:22 2007
@@ -44,6 +44,7 @@
/** 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 @@
}
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 @@
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 "
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org