jeremias 2003/02/13 09:10:59
Modified: src/org/apache/fop/fonts/truetype TTFSubSetFile.java
Log:
TrueType embedding: FPGM table is optional, so ignore it if it's not there.
Revision Changes Path
1.2 +13 -6 xml-fop/src/org/apache/fop/fonts/truetype/TTFSubSetFile.java
Index: TTFSubSetFile.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fonts/truetype/TTFSubSetFile.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TTFSubSetFile.java 8 Jan 2003 13:54:04 -0000 1.1
+++ TTFSubSetFile.java 13 Feb 2003 17:10:59 -0000 1.2
@@ -88,10 +88,12 @@
currentPos += 12;
realSize += 16;
- writeString("fpgm");
- fpgmDirOffset = currentPos;
- currentPos += 12;
- realSize += 16;
+ if (hasFpgm()) {
+ writeString("fpgm");
+ fpgmDirOffset = currentPos;
+ currentPos += 12;
+ realSize += 16;
+ }
writeString("glyf");
glyfDirOffset = currentPos;
@@ -153,6 +155,10 @@
}
+ private boolean hasFpgm() {
+ return (dirTabs.get("fpgm") != null);
+ }
+
/**
* Copy the fpgm table as is from original font to subset font
@@ -171,7 +177,8 @@
currentPos += (int)entry.getLength();
realSize += (int)entry.getLength();
} else {
- throw new IOException("Can't find fpgm table");
+ //fpgm table is optional
+ //throw new IOException("Can't find fpgm table");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]