aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/afp/modca
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2011-04-21 14:59:09 +0000
committerJeremias Maerki <jeremias@apache.org>2011-04-21 14:59:09 +0000
commita5eb05ea8d940ccaa4f9d30b094b673b1e6246b9 (patch)
tree19c87436f665b9ebc59f642e715439cdabd71329 /src/java/org/apache/fop/afp/modca
parentf6fa22263eb843527a1525d960565934c1f01130 (diff)
downloadxmlgraphics-fop-a5eb05ea8d940ccaa4f9d30b094b673b1e6246b9.tar.gz
xmlgraphics-fop-a5eb05ea8d940ccaa4f9d30b094b673b1e6246b9.zip
AFP GOCA: Work-around for InfoPrint's AFP implementation (AFP Viewer 3.5.4.1, AFP Workbench 2.5.4.1) which seems to lose the character set state over Graphics Data (GAD) boundaries. Setting the SegFlag on the SFI header did not help. Instead, the character set is re-set before each Character String order.
As part of the fix, some additional flags were implemented, but now not used. They might be useful in the future. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1095739 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/afp/modca')
-rw-r--r--src/java/org/apache/fop/afp/modca/GraphicsObject.java20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/java/org/apache/fop/afp/modca/GraphicsObject.java b/src/java/org/apache/fop/afp/modca/GraphicsObject.java
index c94ad5ffc..cf732c77a 100644
--- a/src/java/org/apache/fop/afp/modca/GraphicsObject.java
+++ b/src/java/org/apache/fop/afp/modca/GraphicsObject.java
@@ -39,6 +39,7 @@ import org.apache.fop.afp.goca.GraphicsBox;
import org.apache.fop.afp.goca.GraphicsChainedSegment;
import org.apache.fop.afp.goca.GraphicsCharacterString;
import org.apache.fop.afp.goca.GraphicsData;
+import org.apache.fop.afp.goca.GraphicsEndProlog;
import org.apache.fop.afp.goca.GraphicsFillet;
import org.apache.fop.afp.goca.GraphicsFullArc;
import org.apache.fop.afp.goca.GraphicsImage;
@@ -62,8 +63,8 @@ public class GraphicsObject extends AbstractDataObject {
private GraphicsData currentData = null;
/** list of objects contained within this container */
- protected List/*<GraphicsData>*/ objects
- = new java.util.ArrayList/*<GraphicsData>*/();
+ protected List<GraphicsData> objects
+ = new java.util.ArrayList<GraphicsData>();
/** the graphics state */
private final GraphicsState graphicsState = new GraphicsState();
@@ -325,6 +326,10 @@ public class GraphicsObject extends AbstractDataObject {
* @param y the y coordinate
*/
public void addString(String str, int x, int y) {
+ //Work-around for InfoPrint's AFP which loses character set state over Graphics Data
+ //boundaries.
+ addObject(new GraphicsSetCharacterSet(graphicsState.characterSet));
+
addObject(new GraphicsCharacterString(str, x, y));
}
@@ -342,6 +347,13 @@ public class GraphicsObject extends AbstractDataObject {
addObject(new GraphicsAreaEnd());
}
+ /**
+ * Ends the prolog.
+ */
+ public void endProlog() {
+ addObject(new GraphicsEndProlog());
+ }
+
/** {@inheritDoc} */
@Override
public String toString() {
@@ -359,9 +371,9 @@ public class GraphicsObject extends AbstractDataObject {
/** {@inheritDoc} */
@Override
public void setComplete(boolean complete) {
- Iterator it = objects.iterator();
+ Iterator<GraphicsData> it = objects.iterator();
while (it.hasNext()) {
- Completable completedObject = (Completable)it.next();
+ Completable completedObject = it.next();
completedObject.setComplete(true);
}
super.setComplete(complete);