aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/afp
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2011-04-22 06:43:22 +0000
committerJeremias Maerki <jeremias@apache.org>2011-04-22 06:43:22 +0000
commit3d00e4091aae4bf0a139fa96fb8c368c3ae3f606 (patch)
tree17860899152cdc702c371e867225b1ca43c4297d /src/java/org/apache/fop/afp
parent5094d3ab7b04fd93b0dcd77a489c9da83db3f14f (diff)
downloadxmlgraphics-fop-3d00e4091aae4bf0a139fa96fb8c368c3ae3f606.tar.gz
xmlgraphics-fop-3d00e4091aae4bf0a139fa96fb8c368c3ae3f606.zip
AFP GOCA: Added option to disable GOCA and to control text painting inside GOCA graphics.
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1095874 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/afp')
-rw-r--r--src/java/org/apache/fop/afp/AFPPaintingState.java46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/java/org/apache/fop/afp/AFPPaintingState.java b/src/java/org/apache/fop/afp/AFPPaintingState.java
index 85d3e914b..2be3a85ac 100644
--- a/src/java/org/apache/fop/afp/AFPPaintingState.java
+++ b/src/java/org/apache/fop/afp/AFPPaintingState.java
@@ -73,6 +73,11 @@ public class AFPPaintingState extends org.apache.fop.util.AbstractPaintingState
/** the output resolution */
private int resolution = 240; // 240 dpi
+ /** determines whether GOCA is enabled or disabled */
+ private boolean gocaEnabled = true;
+ /** determines whether to stroke text in GOCA mode or to use text operators where possible */
+ private boolean strokeGocaText = false;
+
/** the current page */
private transient AFPPagePaintingState pagePaintingState = new AFPPagePaintingState();
@@ -276,12 +281,46 @@ public class AFPPaintingState extends org.apache.fop.util.AbstractPaintingState
return this.resolution;
}
+ /**
+ * Controls whether GOCA is enabled or disabled.
+ * @param enabled true if GOCA is enabled, false if it is disabled
+ */
+ public void setGOCAEnabled(boolean enabled) {
+ this.gocaEnabled = enabled;
+ }
+
+ /**
+ * Indicates whether GOCA is enabled or disabled.
+ * @return true if GOCA is enabled, false if GOCA is disabled
+ */
+ public boolean isGOCAEnabled() {
+ return this.gocaEnabled;
+ }
+
+ /**
+ * Controls whether to stroke text in GOCA mode or to use text operators where possible.
+ * @param stroke true to stroke, false to paint with text operators where possible
+ */
+ public void setStrokeGOCAText(boolean stroke) {
+ this.strokeGocaText = stroke;
+ }
+
+ /**
+ * Indicates whether to stroke text in GOCA mode or to use text operators where possible.
+ * @return true to stroke, false to paint with text operators where possible
+ */
+ public boolean isStrokeGOCAText() {
+ return this.strokeGocaText;
+ }
+
/** {@inheritDoc} */
+ @Override
protected AbstractData instantiateData() {
return new AFPData();
}
/** {@inheritDoc} */
+ @Override
protected AbstractPaintingState instantiate() {
return new AFPPaintingState();
}
@@ -423,6 +462,7 @@ public class AFPPaintingState extends org.apache.fop.util.AbstractPaintingState
}
/** {@inheritDoc} */
+ @Override
public Object clone() {
AFPPaintingState paintingState = (AFPPaintingState) super.clone();
paintingState.pagePaintingState = (AFPPagePaintingState) this.pagePaintingState.clone();
@@ -436,6 +476,7 @@ public class AFPPaintingState extends org.apache.fop.util.AbstractPaintingState
}
/** {@inheritDoc} */
+ @Override
public String toString() {
return "AFPPaintingState{" + "portraitRotation=" + portraitRotation
+ ", landscapeRotation=" + landscapeRotation + ", colorImages=" + colorImages
@@ -548,6 +589,7 @@ public class AFPPaintingState extends org.apache.fop.util.AbstractPaintingState
}
/** {@inheritDoc} */
+ @Override
public Object clone() {
AFPPagePaintingState state = new AFPPagePaintingState();
state.width = this.width;
@@ -559,6 +601,7 @@ public class AFPPaintingState extends org.apache.fop.util.AbstractPaintingState
}
/** {@inheritDoc} */
+ @Override
public String toString() {
return "AFPPagePaintingState{width=" + width + ", height=" + height + ", orientation="
+ orientation + ", fonts=" + fonts + ", fontCount=" + fontCount + "}";
@@ -577,6 +620,7 @@ public class AFPPaintingState extends org.apache.fop.util.AbstractPaintingState
private String imageUri = null;
/** {@inheritDoc} */
+ @Override
public Object clone() {
AFPData obj = (AFPData) super.clone();
obj.filled = this.filled;
@@ -585,12 +629,14 @@ public class AFPPaintingState extends org.apache.fop.util.AbstractPaintingState
}
/** {@inheritDoc} */
+ @Override
public String toString() {
return "AFPData{" + super.toString() + ", filled=" + filled + ", imageUri=" + imageUri
+ "}";
}
/** {@inheritDoc} */
+ @Override
protected AbstractData instantiate() {
return new AFPData();
}