<fop fofile="${foDir}/readme.fo" pdffile="${testDir}/readme.pdf"/>
<fop fofile="${foDir}/fonts.fo" pdffile="${testDir}/fonts.pdf"/>
<fop fofile="${foDir}/leader.fo" pdffile="${testDir}/leader.pdf"/>
+ <fop fofile="${foDir}/textdeko.fo" pdffile="${testDir}/textdeko.pdf"/>
</target>
<fop fofile="${foDir}/images.fo" pdffile="${referenceDir}/images.pdf"/>
<fop fofile="${foDir}/readme.fo" pdffile="${referenceDir}/readme.pdf"/>
<fop fofile="${foDir}/fonts.fo" pdffile="${referenceDir}/fonts.pdf"/>
+ <fop fofile="${foDir}/leader.fo" pdffile="${referenceDir}/leader.pdf"/>
+ <fop fofile="${foDir}/textdeko.fo" pdffile="${referenceDir}/textdeko.pdf"/>
</target>
<fo:block id="sec2" font-size="18pt" font-family="serif" line-height="20pt" space-before.optimum="20pt" space-after.optimum="14pt" >B)
Downloading FOP</fo:block>
- <fo:block space-after.optimum="3pt" font-family="serif">The latest release version is <fo:inline font-style="italic" font-family="serif">FOP 12.0</fo:inline>
-<fo:inline font-family="serif">
+ <fo:block space-after.optimum="3pt" font-family="serif">The latest release version is <fo:inline font-style="italic" font-family="serif">FOP
+0.14</fo:inline> <fo:inline font-family="serif">
()
</fo:inline>. </fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">NOTE: you do not have to unjar or unzip this jar file.</fo:block>
<fo:block space-after.optimum="3pt" font-family="serif">To run FOP from the command line, see Running FOP. If you are interested in
embedding FOP in a Java application of your own, see Embedding FOP.
</fo:block>
- <fo:block space-after.optimum="3pt" font-family="serif">You can also download the <fo:inline font-style="italic" font-family="serif">source code v. 12.0</fo:inline>
+ <fo:block space-after.optimum="3pt" font-family="serif">You can also download the <fo:inline font-style="italic" font-family="serif">source code v. 0.14</fo:inline>
<fo:inline font-family="serif">
()
</fo:inline> as jar file</fo:block>
<default>auto</default>
</property>
+ <property>
+ <name>text-decoration</name>
+ <class-name>TextDecoration</class-name>
+ <inherited>false</inherited>
+ <datatype>
+ <enumeration>
+ <value const="NONE">none</value>
+ <value const="UNDERLINE">underline</value>
+ <value const="OVERLINE">overline</value>
+ <value const="LINE_THROUGH">line-through</value>
+ </enumeration>
+ </datatype>
+ <default>none</default>
+ </property>
+
<!-- svg properties, or should these be in another file -->
<property>
<name>requiredFeatures</name>
int wrapOption;
int whiteSpaceTreatment;
- protected FOText(char[] chars, int s, int e, FObj parent) {
+ // Textdecoration
+ protected boolean underlined = false;
+ protected boolean overlined = false;
+ protected boolean lineThrough = false;
+
+
+ public FOText(char[] chars, int s, int e, FObj parent) {
super(parent);
this.start = 0;
this.ca = new char[e - s];
this.length = e - s;
}
+ public void setUnderlined(boolean ul) {
+ this.underlined = ul;
+ }
+
public Status layout(Area area) throws FOPException {
if (!(area instanceof BlockArea)) {
MessageHandler.errorln("WARNING: text outside block area" + new String(ca, start, length));
wrapOption,
this.getLinkSet(),
whiteSpaceTreatment,
- ca, this.marker, length);
+ ca, this.marker, length,
+ underlined);
if (this.marker == -1) {
this.marker = 0;
return new Status(Status.OK);
propertyTable.put("scaling",Scaling.maker());
propertyTable.put("vertical-align",VerticalAlign.maker());
propertyTable.put("overflow",Overflow.maker());
+ propertyTable.put("text-decoration",TextDecoration.maker());
builder.addPropertyList(uri, propertyTable);
}
}
import org.apache.fop.fo.*;
import org.apache.fop.layout.Area;
import org.apache.fop.apps.FOPException;
+import org.apache.fop.fo.properties.*;
// Java
import java.util.Enumeration;
public static FObj.Maker maker() {
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.name = "fo:inline";
-
+
+ int textDecoration =
+ this.properties.get("text-decoration").getEnum();
+
+ if (textDecoration == TextDecoration.UNDERLINE) {
+ this.underlined = true;
+ }
+
if (parent.getName().equals("fo:flow")) {
throw new FOPException("fo:inline can't be directly"
+ " under flow");
}
+
}
+
+ protected void addCharacters(char data[], int start, int length) {
+ FOText ft = new FOText(data,start,length, this);
+ ft.setUnderlined(underlined);
+ children.addElement(ft);
+ }
+
}
null,
whiteSpaceTreatment,
p.toCharArray(), 0,
- p.length());
+ p.length(),
+ false);
return new Status(Status.OK);
}
}
pageNumber=idReferences.getPageNumber(refId);
if ( pageNumber!=null ) { // if we already know the page number
- this.marker = ((BlockArea) area).addText(fs, red, green, blue, wrapOption, null, whiteSpaceTreatment, pageNumber.toCharArray(), 0, pageNumber.length());
+ this.marker = ((BlockArea) area).addText(fs, red, green, blue, wrapOption, null, whiteSpaceTreatment, pageNumber.toCharArray(), 0, pageNumber.length(), false);
}
else { // add pageNumberCitation to area to be resolved during rendering
this.marker = ((BlockArea) area).addPageNumberCitation(fs, red, green, blue, wrapOption, null, whiteSpaceTreatment, refId);
public int addText(FontState fontState, float red, float green,
float blue, int wrapOption, LinkSet ls,
int whiteSpaceTreatment, char data[],
- int start, int end) {
+ int start, int end, boolean ul) {
int ts, te;
char[] ca;
ls.setYOffset(currentHeight);
}
- ts = this.currentLineArea.addText(ca, ts, te, ls);
+ ts = this.currentLineArea.addText(ca, ts, te, ls, ul);
this.hasLines = true;
while (ts != -1) {
ls.setYOffset(currentHeight);
}
- ts = this.currentLineArea.addText(ca, ts, te, ls);
+ ts = this.currentLineArea.addText(ca, ts, te, ls, ul);
}
return -1;
}
protected String pageNumberId=null;
private float red, green, blue;
+ // Textdecoration
+ protected boolean underlined = false;
+ protected boolean overlined = false;
+ protected boolean lineThrough = false;
+
+
public InlineArea(FontState fontState, float red, float green, float blue, String text, int width) {
super(fontState);
this.red = red;
public String getPageNumberID() {
return pageNumberId;
}
+
+ public void setUnderlined(boolean ul) {
+ this.underlined = ul;
+ }
+
+ public boolean getUnderlined() {
+ return this.underlined;
+ }
+
}
}
- public int addText(char odata[], int start, int end, LinkSet ls) {
+ public int addText(char odata[], int start, int end, LinkSet ls, boolean ul) {
boolean overrun = false;
wordStart = start;
String(data, wordStart,
wordLength),
wordWidth);
+ ia.setUnderlined(ul);
addChild(ia);
if (ls != null) {
Rectangle lr =
this.green, this.blue, new
String(data, wordStart,
wordLength), wordWidth);
+
+ pia.setUnderlined(ul);
if (ls != null) {
Rectangle lr =
}
pdf = pdf.append(") Tj\n");
+ if (area.getUnderlined()) {
+ addLine(rx, bl - size/10, rx + area.getContentWidth(),
+ bl - size/10, size/14, theAreaColor);
+ }
+
currentStream.add(pdf.toString());
this.currentXPosition += area.getContentWidth();