diff options
author | Keiron Liddle <keiron@apache.org> | 2002-01-08 09:52:18 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2002-01-08 09:52:18 +0000 |
commit | aca1e4f9afd5d27a9ad6cea9871c4ae4632653e7 (patch) | |
tree | 36f89e946c70432b09f8f26a3f75de9146965f7c /src/org/apache/fop/fo | |
parent | 0f24e0a799e3f4a2540f51d64e21f76639179b72 (diff) | |
download | xmlgraphics-fop-aca1e4f9afd5d27a9ad6cea9871c4ae4632653e7.tar.gz xmlgraphics-fop-aca1e4f9afd5d27a9ad6cea9871c4ae4632653e7.zip |
does some basic text into pdf and svg output just for a start
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194617 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fo')
-rw-r--r-- | src/org/apache/fop/fo/FOText.java | 20 | ||||
-rw-r--r-- | src/org/apache/fop/fo/FOUserAgent.java | 2 | ||||
-rw-r--r-- | src/org/apache/fop/fo/flow/Flow.java | 7 | ||||
-rw-r--r-- | src/org/apache/fop/fo/flow/InstreamForeignObject.java | 47 | ||||
-rw-r--r-- | src/org/apache/fop/fo/flow/Leader.java | 2 | ||||
-rw-r--r-- | src/org/apache/fop/fo/flow/RetrieveMarker.java | 2 |
6 files changed, 58 insertions, 22 deletions
diff --git a/src/org/apache/fop/fo/FOText.java b/src/org/apache/fop/fo/FOText.java index a3a2bb393..369b4f04e 100644 --- a/src/org/apache/fop/fo/FOText.java +++ b/src/org/apache/fop/fo/FOText.java @@ -38,18 +38,18 @@ public class FOText extends FObj { TextInfo textInfo; public static class TextInfo { - FontState fs; - float red; - float green; - float blue; - int wrapOption; - int whiteSpaceCollapse; - int verticalAlign; + public FontState fs; + public float red; + public float green; + public float blue; + public int wrapOption; + public int whiteSpaceCollapse; + public int verticalAlign; // Textdecoration - protected boolean underlined = false; - protected boolean overlined = false; - protected boolean lineThrough = false; + public boolean underlined = false; + public boolean overlined = false; + public boolean lineThrough = false; } TextState ts; diff --git a/src/org/apache/fop/fo/FOUserAgent.java b/src/org/apache/fop/fo/FOUserAgent.java index d89f308e4..39f9b8bcf 100644 --- a/src/org/apache/fop/fo/FOUserAgent.java +++ b/src/org/apache/fop/fo/FOUserAgent.java @@ -73,7 +73,7 @@ public class FOUserAgent { handler.handleXML(ctx, doc, namespace); } catch (Throwable t) { // could not handle document - t.printStackTrace(); + ctx.getLogger().error("Could not render XML", t); } } else { // no handler found for document diff --git a/src/org/apache/fop/fo/flow/Flow.java b/src/org/apache/fop/fo/flow/Flow.java index 9538f81b7..f0828f426 100644 --- a/src/org/apache/fop/fo/flow/Flow.java +++ b/src/org/apache/fop/fo/flow/Flow.java @@ -87,14 +87,11 @@ public class Flow extends FObj { protected void setFlowName(String name) throws FOPException { if (name == null || name.equals("")) { - log.warn("A 'flow-name' is required for " - + getName() - + ". This constraint will be enforced in future versions of FOP"); - _flowName = "xsl-region-body"; + throw new FOPException("A 'flow-name' is required for " + + getName()); } else { _flowName = name; } - } public String getFlowName() { diff --git a/src/org/apache/fop/fo/flow/InstreamForeignObject.java b/src/org/apache/fop/fo/flow/InstreamForeignObject.java index 6c5ee2a30..107ce8081 100644 --- a/src/org/apache/fop/fo/flow/InstreamForeignObject.java +++ b/src/org/apache/fop/fo/flow/InstreamForeignObject.java @@ -10,6 +10,7 @@ package org.apache.fop.fo.flow; // FOP import org.apache.fop.fo.*; import org.apache.fop.fo.properties.*; +import org.apache.fop.area.Area; import org.apache.fop.area.inline.InlineArea; import org.apache.fop.area.inline.Viewport; import org.apache.fop.area.inline.ForeignObject; @@ -21,6 +22,8 @@ import org.apache.fop.layout.BackgroundProps; import org.apache.fop.layout.MarginInlineProps; import org.apache.fop.layout.RelativePositionProps; import org.apache.fop.apps.FOPException; +import org.apache.fop.layoutmgr.LayoutManager; +import org.apache.fop.layoutmgr.SplitContext; import org.w3c.dom.Document; @@ -54,6 +57,31 @@ public class InstreamForeignObject extends FObj { super(parent); } + public LayoutManager getLayoutManager() { + return new LayoutManager() { + LayoutManager lm; + public void generateAreas() { + lm.addChild(getInlineArea()); + } + + public Area getParentArea (Area childArea) { + return null; + } + + public void addChild (Area childArea) { + } + + public boolean splitArea(Area areaToSplit, SplitContext context) { + return false; + } + + public void setParentLM(LayoutManager lm) { + this.lm = lm; + } + + }; + } + /** * Get the inline area created by this element. */ @@ -93,11 +121,22 @@ public class InstreamForeignObject extends FObj { // if replaced then use height then ignore block-progression-dimension //int h = this.properties.get("height").getLength().mvalue(); - // use line-height then ignore dimension in height direction - int lh = this.properties.get("line-height").getLength().mvalue(); + // use specified line-height then ignore dimension in height direction + boolean hasLH = properties.get("line-height").getSpecifiedValue() != null; + int bpd = 0; + boolean bpdauto = false; + if(hasLH) { + bpd = properties.get("line-height").getLength().mvalue(); + } else { + // this property does not apply when the line-height applies + // isn't the block-progression-dimension always in the same + // direction as the line height? + bpdauto = properties.get("block-progression-dimension").getLength().isAuto(); + bpd = properties.get("block-progression-dimension").getLength().mvalue(); + } - int bpd = this.properties.get("block-progression-dimension").getLength().mvalue(); - int ipd = this.properties.get("inline-progression-dimension").getLength().mvalue(); + //boolean ipdauto = properties.get("inline-progression-dimension").getLength().isAuto(); + //int ipd = properties.get("inline-progression-dimension").getLength().mvalue(); // if auto then use the intrinsic size of the content scaled // to the content-height and content-width diff --git a/src/org/apache/fop/fo/flow/Leader.java b/src/org/apache/fop/fo/flow/Leader.java index dc3ca017a..642b20dcd 100644 --- a/src/org/apache/fop/fo/flow/Leader.java +++ b/src/org/apache/fop/fo/flow/Leader.java @@ -200,5 +200,5 @@ public class Leader extends FObjMixed { // this.hasLines = true; return 1; } - } + diff --git a/src/org/apache/fop/fo/flow/RetrieveMarker.java b/src/org/apache/fop/fo/flow/RetrieveMarker.java index eb3d0497f..2baa6419f 100644 --- a/src/org/apache/fop/fo/flow/RetrieveMarker.java +++ b/src/org/apache/fop/fo/flow/RetrieveMarker.java @@ -64,7 +64,7 @@ public class RetrieveMarker extends FObjMixed { } } - Status status = new Status(Status.AREA_FULL_NONE); + Status status = new Status(Status.OK); if (null != bestMarker) { // System.out.println("Laying out marker '" + bestMarker + "' in area '" + area + "'"); // the 'markers' referred to in this method are internal; they have |