aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/apache/fop/fo
diff options
context:
space:
mode:
authorKaren Lease <klease@apache.org>2001-02-01 21:38:11 +0000
committerKaren Lease <klease@apache.org>2001-02-01 21:38:11 +0000
commit6e8ca8d59734101b63cf933f2d12f482f5ae371b (patch)
tree6354d5a37b21d8786031df4825abbb709a8386e0 /src/org/apache/fop/fo
parente6e8945040db1c9bcff0aea35775190c3944b718 (diff)
downloadxmlgraphics-fop-6e8ca8d59734101b63cf933f2d12f482f5ae371b.tar.gz
xmlgraphics-fop-6e8ca8d59734101b63cf933f2d12f482f5ae371b.zip
Commit more text decoration support from Christain Geisert (finally)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194007 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fo')
-rw-r--r--src/org/apache/fop/fo/FOText.java20
-rw-r--r--src/org/apache/fop/fo/flow/Inline.java10
-rw-r--r--src/org/apache/fop/fo/flow/PageNumber.java5
-rw-r--r--src/org/apache/fop/fo/flow/PageNumberCitation.java4
4 files changed, 34 insertions, 5 deletions
diff --git a/src/org/apache/fop/fo/FOText.java b/src/org/apache/fop/fo/FOText.java
index debc06e14..6fc253fa5 100644
--- a/src/org/apache/fop/fo/FOText.java
+++ b/src/org/apache/fop/fo/FOText.java
@@ -56,6 +56,7 @@ import org.apache.fop.layout.Area;
import org.apache.fop.messaging.MessageHandler;
import org.apache.fop.layout.BlockArea;
import org.apache.fop.layout.FontState;
+import org.apache.fop.layout.TextState;
import org.apache.fop.datatypes.*;
import org.apache.fop.fo.properties.*;
import org.apache.fop.apps.FOPException;
@@ -81,6 +82,8 @@ public class FOText extends FONode {
protected boolean overlined = false;
protected boolean lineThrough = false;
+ TextState ts;
+
public FOText(char[] chars, int s, int e, FObj parent) {
super(parent);
@@ -95,6 +98,15 @@ public class FOText extends FONode {
this.underlined = ul;
}
+ public void setOverlined(boolean ol) {
+ this.overlined = ol;
+ }
+
+ public void setLineThrough(boolean lt) {
+ this.lineThrough = lt;
+ }
+
+
public boolean willCreateArea()
{
this.whiteSpaceCollapse = this.parent.properties.get(
@@ -143,14 +155,18 @@ public class FOText extends FONode {
this.wrapOption =
this.parent.properties.get("wrap-option").getEnum();
this.whiteSpaceCollapse = this.parent.properties.get(
- "white-space-collapse").getEnum();
+ "white-space-collapse").getEnum();
+ this.ts = new TextState();
+ ts.setUnderlined(underlined);
+ ts.setOverlined(overlined);
+ ts.setLineThrough(lineThrough);
this.marker = this.start;
}
int orig_start = this.marker;
this.marker = ((BlockArea) area).addText(fs, red, green, blue,
wrapOption, this.getLinkSet(), whiteSpaceCollapse, ca,
- this.marker, length, underlined);
+ this.marker, length, ts);
if (this.marker == -1) {
diff --git a/src/org/apache/fop/fo/flow/Inline.java b/src/org/apache/fop/fo/flow/Inline.java
index efc831028..598d4dbe4 100644
--- a/src/org/apache/fop/fo/flow/Inline.java
+++ b/src/org/apache/fop/fo/flow/Inline.java
@@ -91,6 +91,14 @@ public class Inline extends FObjMixed {
this.underlined = true;
}
+ if (textDecoration == TextDecoration.OVERLINE) {
+ this.overlined = true;
+ }
+
+ if (textDecoration == TextDecoration.LINE_THROUGH) {
+ this.lineThrough = true;
+ }
+
if (parent.getName().equals("fo:flow")) {
throw new FOPException("fo:inline can't be directly"
+ " under flow");
@@ -101,6 +109,8 @@ public class Inline extends FObjMixed {
protected void addCharacters(char data[], int start, int length) {
FOText ft = new FOText(data,start,length, this);
ft.setUnderlined(underlined);
+ ft.setOverlined(overlined);
+ ft.setLineThrough(lineThrough);
children.addElement(ft);
}
diff --git a/src/org/apache/fop/fo/flow/PageNumber.java b/src/org/apache/fop/fo/flow/PageNumber.java
index 8eb8741ef..4dbe320fc 100644
--- a/src/org/apache/fop/fo/flow/PageNumber.java
+++ b/src/org/apache/fop/fo/flow/PageNumber.java
@@ -81,6 +81,7 @@ public class PageNumber extends FObj {
float blue;
int wrapOption;
int whiteSpaceCollapse;
+ TextState ts;
public PageNumber(FObj parent, PropertyList propertyList) {
super(parent, propertyList);
@@ -117,7 +118,7 @@ public class PageNumber extends FObj {
this.wrapOption = this.properties.get("wrap-option").getEnum();
this.whiteSpaceCollapse =
this.properties.get("white-space-collapse").getEnum();
-
+ ts = new TextState();
this.marker = 0;
// initialize id
@@ -128,7 +129,7 @@ public class PageNumber extends FObj {
String p = Integer.toString(area.getPage().getNumber());
this.marker = ((BlockArea) area).addText(fs, red, green, blue,
wrapOption, null, whiteSpaceCollapse, p.toCharArray(),
- 0, p.length(), false);
+ 0, p.length(), ts);
return new Status(Status.OK);
}
}
diff --git a/src/org/apache/fop/fo/flow/PageNumberCitation.java b/src/org/apache/fop/fo/flow/PageNumberCitation.java
index 16e979526..817a647e1 100644
--- a/src/org/apache/fop/fo/flow/PageNumberCitation.java
+++ b/src/org/apache/fop/fo/flow/PageNumberCitation.java
@@ -138,6 +138,7 @@ public class PageNumberCitation extends FObj {
String pageNumber;
String refId;
String id;
+ TextState ts;
public PageNumberCitation(FObj parent, PropertyList propertyList) {
@@ -189,6 +190,7 @@ public class PageNumberCitation extends FObj {
// create id
this.id = this.properties.get("id").getString();
idReferences.createID(id);
+ ts = new TextState();
this.marker = 0;
}
@@ -204,7 +206,7 @@ public class PageNumberCitation extends FObj {
this.marker = ((BlockArea) area).addText(fs, red, green, blue,
wrapOption, null, whiteSpaceCollapse,
pageNumber.toCharArray(), 0, pageNumber.length(),
- false);
+ ts);
} else { // add pageNumberCitation to area to be resolved during rendering
BlockArea blockArea = (BlockArea)area;
LineArea la = blockArea.getCurrentLineArea();