line-height="15pt"
space-after.optimum="10pt"
text-align="start">
- This is simple test of the text-decoration<fo:inline text-decoration="underline">underline</fo:inline>.
+ This is simple test of the text-decoration <fo:inline text-decoration="underline">'underline'</fo:inline>.
</fo:block>
<fo:block font-size="22pt"
font-family="sans-serif"
</fo:block>
<fo:block font-size="12pt" font-family="sans-serif" line-height="15pt" text-align="justify" space-after.optimum="3pt">
- The following text decorations are defined in the CR:
+ The following text decorations are defined in the REC:
</fo:block>
<fo:list-block space-after.optimum="13pt">
</fo:block>
+ <fo:block space-after.optimum="13pt" font-size="14pt" text-decoration="underline">
+ A whole block should work now.
+ And again some more Text to get at least two lines.
+ </fo:block>
+
+
</fo:flow>
</fo:page-sequence>
</fo:root>
package org.apache.fop.fo;
import org.apache.fop.layout.Area;
+import org.apache.fop.layout.TextState;
import org.apache.fop.apps.FOPException;
/**
*/
public class FObjMixed extends FObj {
+ // Textdecoration
+ protected TextState ts;
+
public static class Maker extends FObj.Maker {
public FObj make(FObj parent,
PropertyList propertyList) throws FOPException {
}
protected void addCharacters(char data[], int start, int length) {
- addChild(new FOText(data, start, length, this));
+ // addChild(new FOText(data, start, length, this));
+ FOText ft = new FOText(data, start, length, this);
+ ft.setLogger(log);
+ ft.setUnderlined(ts.getUnderlined());
+ ft.setOverlined(ts.getOverlined());
+ ft.setLineThrough(ts.getLineThrough());
+ addChild(ft);
+
}
public Status layout(Area area) throws FOPException {
import java.text.FieldPosition;
import org.apache.fop.layout.Area;
import org.apache.fop.layout.ColumnArea;
+import org.apache.fop.layout.TextState;
+import org.apache.fop.fo.properties.TextDecoration;
public class PropertyManager {
AbsolutePositionProps props = new AbsolutePositionProps();
return props;
}
+
+ public TextState getTextDecoration() throws FOPException {
+ TextState ts = new TextState();
+
+ int textDecoration = this.properties.get("text-decoration").getEnum();
+
+ switch (textDecoration) {
+ case TextDecoration.UNDERLINE:
+ ts.setUnderlined(true);
+ break;
+ case TextDecoration.OVERLINE:
+ ts.setOverlined(true);
+ break;
+ case TextDecoration.LINE_THROUGH:
+ ts.setLineThrough(true);
+ break;
+ case TextDecoration.NONE:
+ ts.setUnderlined(false);
+ ts.setOverlined(false);
+ ts.setLineThrough(false);
+ }
+
+ return ts;
+ }
+
}
// this may be helpful on other FOs too
boolean anythingLaidOut = false;
- public Block(FObj parent, PropertyList propertyList) {
+ public Block(FObj parent, PropertyList propertyList)
+ throws FOPException {
+
super(parent, propertyList);
this.name = "fo:block";
this.span = this.properties.get("span").getEnum();
+ ts = propMgr.getTextDecoration();
}
public Status layout(Area area) throws FOPException {
return new Inline.Maker();
}
- // Textdecoration
- protected boolean underlined = false;
- protected boolean overlined = false;
- protected boolean lineThrough = false;
-
-
public Inline(FObj parent,
PropertyList propertyList) throws FOPException {
super(parent, propertyList);
// this.properties.get("visibility");
// this.properties.get("z-index");
- int textDecoration = this.properties.get("text-decoration").getEnum();
-
- if (textDecoration == TextDecoration.UNDERLINE) {
- this.underlined = true;
- }
+ // Text Decoration Properties
+ ts = propMgr.getTextDecoration();
- if (textDecoration == TextDecoration.OVERLINE) {
- this.overlined = true;
- }
-
- if (textDecoration == TextDecoration.LINE_THROUGH) {
- this.lineThrough = true;
- }
}
protected void addCharacters(char data[], int start, int length) {
FOText ft = new FOText(data, start, length, this);
ft.setLogger(log);
- ft.setUnderlined(underlined);
- ft.setOverlined(overlined);
- ft.setLineThrough(lineThrough);
+ ft.setUnderlined(ts.getUnderlined());
+ ft.setOverlined(ts.getOverlined());
+ ft.setLineThrough(ts.getLineThrough());
children.addElement(ft);
}