</patternset>
</fileset>
<patternset id="dist.src.lib.tools">
-- <include name="lib/build/asm*"/>
-- <include name="lib/build/backport-util-concurrent*"/>
-- <include name="lib/build/jaxen*"/>
-- <include name="lib/build/pmd*"/>
-- <include name="lib/build/qdox*"/>
++ <include name="lib/build/asm*"/>
++ <include name="lib/build/backport-util-concurrent*"/>
++ <include name="lib/build/jaxen*"/>
++ <include name="lib/build/pmd*"/>
++ <include name="lib/build/qdox*"/>
<include name="lib/build/xmlunit*"/>
</patternset>
<fileset dir="${basedir}" id="dist.src">
<include name="hyph/hyphenation.dtd"/>
<include name="hyph/readme"/>
<patternset refid="dist.lib"/>
-- <patternset refid="dist.src.lib.tools"/>
++ <patternset refid="dist.src.lib.tools"/>
<include name="lib/servlet*"/>
<include name="test/**"/>
<include name="examples/**"/>
<property environment="env"/>
<property name="forrest.home" value="${env.FORREST_HOME}"/>
<import file="${env.FORREST_HOME}/main/forrest.build.xml" optional="true"/>
- -->
- <!-- =================================================================== -->
+ -->
+
+ <presetdef name="javac">
+ <javac fork="${javac.fork}"
+ debug="${javac.debug}"
+ deprecation="${javac.deprecation}"
+ optimize="${javac.optimize}"
+ source="${javac.source}" target="${javac.target}"/>
+ </presetdef>
+
+ <presetdef name="junit">
- <junit haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" maxmemory="256m"/>
++ <junit haltonfailure="${junit.haltonfailure}"
++ fork="${junit.fork}"
++ printsummary="${junit.printsummary}"
++ maxmemory="256m"/>
+ </presetdef>
+
+ <!-- =================================================================== -->
<!-- Initialization target -->
<!-- =================================================================== -->
<target name="init" depends="init-avail">
<!-- (src/java/org/apache/fop/hyphenation/classes.xml). -->
<!-- =================================================================== -->
<target name="codegen-hyphenation-classes">
- <javac destdir="${build.codegen-classes.dir}" fork="${javac.fork}" debug="${javac.debug}" deprecation="${javac.deprecation}" optimize="${javac.optimize}" source="${javac.source}" target="${javac.target}">
+ <javac destdir="${build.codegen-classes.dir}">
<src path="${src.codegen.dir}/unicode/java"/>
</javac>
-- <java classname="org.apache.fop.hyphenation.UnicodeClasses" resultproperty="classes.result" classpath="${build.codegen-classes.dir}">
++ <java classname="org.apache.fop.hyphenation.UnicodeClasses" resultproperty="classes.result" classpath="${build.codegen-classes.dir}">
<arg value="${src.dir}/java/org/apache/fop/hyphenation/classes.xml"/>
-- </java>
-- <condition property="classes.result.message" value="Generation of classes successful">
-- <not>
-- <isfailure code="${classes.result}"/>
-- </not>
-- </condition>
-- <condition property="classes.result.message" value="Generation of classes failed">
-- <isfailure code="${classes.result}"/>
-- </condition>
-- <echo message="${classes.result.message}"/>
++ </java>
++ <condition property="classes.result.message" value="Generation of classes successful">
++ <not>
++ <isfailure code="${classes.result}"/>
++ </not>
++ </condition>
++ <condition property="classes.result.message" value="Generation of classes failed">
++ <isfailure code="${classes.result}"/>
++ </condition>
++ <echo message="${classes.result.message}"/>
</target>
<!-- =================================================================== -->
<!-- compiles hyphenation patterns -->
<pathelement location="${build.classes.dir}"/>
</path>
<mkdir dir="${build.classes.dir}/hyph"/>
-- <java classname="org.apache.fop.hyphenation.SerializeHyphPattern" fork="true" resultproperty="hyph.result" classpathref="hyph-classpath">
-- <arg value="${user.hyph.dir}"/>
-- <arg value="${build.classes.dir}/hyph"/>
-- <jvmarg value="-Xss${hyph.stacksize}"/>
-- </java>
-- <condition property="hyph.result.message" value="Hyphenation successful">
-- <not>
-- <isfailure code="${hyph.result}"/>
-- </not>
-- </condition>
-- <condition property="hyph.result.message" value="Hyphenation failed">
-- <isfailure code="${hyph.result}"/>
-- </condition>
-- <echo message="${hyph.result.message}"/>
++ <java classname="org.apache.fop.hyphenation.SerializeHyphPattern" fork="true" resultproperty="hyph.result" classpathref="hyph-classpath">
++ <arg value="${user.hyph.dir}"/>
++ <arg value="${build.classes.dir}/hyph"/>
++ <jvmarg value="-Xss${hyph.stacksize}"/>
++ </java>
++ <condition property="hyph.result.message" value="Hyphenation successful">
++ <not>
++ <isfailure code="${hyph.result}"/>
++ </not>
++ </condition>
++ <condition property="hyph.result.message" value="Hyphenation failed">
++ <isfailure code="${hyph.result}"/>
++ </condition>
++ <echo message="${hyph.result.message}"/>
</target>
<target name="uptodate-jar-hyphenation" depends="compile-hyphenation">
<uptodate property="jar.hyphenation.uptodate" targetfile="${build.dir}/fop-hyph.jar">
<target name="junit-compile" depends="junit-compile-java, junit-compile-copy-resources" description="Compiles FOP's JUnit tests" if="junit.present"/>
<target name="junit-transcoder" depends="junit-compile" description="Runs FOP's JUnit transcoder tests" if="junit.present">
<echo message="Running basic functionality tests for fop-transcoder.jar"/>
- <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" printsummary="${junit.printsummary}">
- <jvmarg value="-Xmx1024m"/>
+ <junit dir="${basedir}">
<sysproperty key="basedir" value="${basedir}"/>
<sysproperty key="jawa.awt.headless" value="true"/>
- <formatter type="brief" usefile="false"/>
+ <formatter type="brief" usefile="false" if="junit.formatter.brief.use"/>
<formatter type="plain" usefile="true"/>
<formatter type="xml" usefile="true"/>
<classpath>
previous test block succeeded it indicates that the packaging of the allinone
JAR needs to be updated.
-->
- <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure" printsummary="${junit.printsummary}">
+ <junit dir="${basedir}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
<sysproperty key="basedir" value="${basedir}"/>
<sysproperty key="jawa.awt.headless" value="true"/>
- <formatter type="brief" usefile="false"/>
+ <formatter type="brief" usefile="false" if="junit.formatter.brief.use"/>
<formatter type="plain" usefile="true"/>
<formatter type="xml" usefile="true"/>
<classpath>
</target>
<target name="junit-basic" depends="junit-compile" description="Runs FOP's JUnit basic tests" if="junit.present">
<echo message="Running basic functionality tests for fop.jar"/>
- <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure" printsummary="${junit.printsummary}">
+ <junit dir="${basedir}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
<sysproperty key="basedir" value="${basedir}"/>
<sysproperty key="jawa.awt.headless" value="true"/>
- <formatter type="brief" usefile="false"/>
+ <formatter type="brief" usefile="false" if="junit.formatter.brief.use"/>
<formatter type="plain" usefile="true"/>
<formatter type="xml" usefile="true"/>
<classpath>
</target>
<target name="junit-text-linebreak" depends="junit-compile" description="Runs FOP's JUnit unicode linebreak tests" if="junit.present">
<echo message="Running tests for Unicode UAX#14 support"/>
- <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure" printsummary="${junit.printsummary}">
+ <junit dir="${basedir}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
<sysproperty key="basedir" value="${basedir}"/>
<sysproperty key="jawa.awt.headless" value="true"/>
- <formatter type="brief" usefile="false"/>
+ <formatter type="brief" usefile="false" if="junit.formatter.brief.use"/>
<formatter type="plain" usefile="true"/>
<formatter type="xml" usefile="true"/>
<classpath>
<!-- =================================================================== -->
<property name="checkstyle.noframes.xslt" value="${basedir}/checkstyle-noframes.xsl" />
<condition property="checkstyle.avail">
-- <and>
++ <and>
<available classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
<classpath>
<path refid="libs-tools-build-classpath"/>
<!-- Nightly builds -->
<!-- =================================================================== -->
<target name="junit-nightly-build" depends="junit-userconfig,junit-text-linebreak,junit-fotree">
-- <fail>
-- <condition>
-- <or>
-- <isset property="fop.junit.error"/>
-- <isset property="fop.junit.failure"/>
++ <fail>
++ <condition>
++ <or>
++ <isset property="fop.junit.error"/>
++ <isset property="fop.junit.failure"/>
</or>
</condition>
NOTE:
<!-- be generated by below. This target should never be part of the -->
<!-- normal build process. -->
<!-- =================================================================== -->
- <target name="codegen-unicode" >
+ <target name="codegen-unicode" depends="compile-java">
<mkdir dir="${build.codegen-classes.dir}"/>
- <javac destdir="${build.codegen-classes.dir}" fork="${javac.fork}" debug="${javac.debug}" deprecation="${javac.deprecation}" optimize="${javac.optimize}" source="${javac.source}" target="${javac.target}">
+ <javac destdir="${build.codegen-classes.dir}">
<src path="${src.codegen.dir}/unicode/java"/>
+ <classpath>
+ <path refid="libs-build-classpath"/>
+ <pathelement location="${build.classes.dir}"/>
+ <pathelement location="${build.codegen-classes.dir}"/>
+ </classpath>
</javac>
<java classname="org.apache.fop.text.linebreak.GenerateLineBreakUtils" classpath="${build.codegen-classes.dir}">
<arg line="-o ${src.dir}/java/org/apache/fop/text/linebreak/LineBreakUtils.java"/>
<delete>
<fileset dir="${basedir}" includes="${name}-*.tar.gz"/>
<fileset dir="${basedir}" includes="${name}-*.zip"/>
-- <fileset dir="${basedir}" includes="${name}-bundle.jar"/>
++ <fileset dir="${basedir}" includes="${name}-bundle.jar"/>
</delete>
</target>
<target name="validate-xdocs" description="Validate the xdocs. Point schemas.dir to Forrest's 'schemas' directory.">
* Internal link trait.
* Contains the PageViewport key and the PROD_ID of the target area
*/
- public static final Integer INTERNAL_LINK = new Integer(1);
+ public static final Integer INTERNAL_LINK = 1;
- /**
- * External link. A URL link to an external resource.
- */
- public static final Integer EXTERNAL_LINK = new Integer(2);
+ /** * External link. A URL link to an external resource. */
+ public static final Integer EXTERNAL_LINK = 2;
- /**
- * The font triplet for the current font.
- */
- public static final Integer FONT = new Integer(3);
+ /** The font triplet for the current font. */
+ public static final Integer FONT = 3;
- /**
- * Font size for the current font.
- */
- public static final Integer FONT_SIZE = new Integer(4);
+ /** Font size for the current font. */
+ public static final Integer FONT_SIZE = 4;
- /**
- * The current color.
- */
- public static final Integer COLOR = new Integer(7);
+ /** The current color. */
+ public static final Integer COLOR = 7;
- /**
- * The ID of the FO that produced an area.
- */
- public static final Integer PROD_ID = new Integer(8);
+ /** The ID of the FO that produced an area. */
+ public static final Integer PROD_ID = 8;
- /**
- * Background trait for an area.
- */
- public static final Integer BACKGROUND = new Integer(9);
+ /** Background trait for an area. */
+ public static final Integer BACKGROUND = 9;
- /**
- * Underline trait used when rendering inline parent.
- */
- public static final Integer UNDERLINE = new Integer(10);
+ /** Underline trait used when rendering inline parent. */
+ public static final Integer UNDERLINE = 10;
- /**
- * Overline trait used when rendering inline parent.
- */
- public static final Integer OVERLINE = new Integer(11);
+ /** Overline trait used when rendering inline parent. */
+ public static final Integer OVERLINE = 11;
- /**
- * Linethrough trait used when rendering inline parent.
- */
- public static final Integer LINETHROUGH = new Integer(12);
+ /** Linethrough trait used when rendering inline parent. */
+ public static final Integer LINETHROUGH = 12;
- /**
- * Shadow offset.
- */
+ /** Shadow offset. */
//public static final Integer OFFSET = new Integer(13);
- /**
- * The shadow for text.
- */
+ /** The shadow for text. */
//public static final Integer SHADOW = new Integer(14);
- /**
- * The border start.
- */
- public static final Integer BORDER_START = new Integer(15);
+ /** The border start. */
+ public static final Integer BORDER_START = 15;
- /**
- * The border end.
- */
- public static final Integer BORDER_END = new Integer(16);
+ /** The border end. */
+ public static final Integer BORDER_END = 16;
- /**
- * The border before.
- */
- public static final Integer BORDER_BEFORE = new Integer(17);
+ /** The border before. */
+ public static final Integer BORDER_BEFORE = 17;
- /**
- * The border after.
- */
- public static final Integer BORDER_AFTER = new Integer(18);
+ /** The border after. */
+ public static final Integer BORDER_AFTER = 18;
- /**
- * The padding start.
- */
- public static final Integer PADDING_START = new Integer(19);
+ /** The padding start. */
+ public static final Integer PADDING_START = 19;
- /**
- * The padding end.
- */
- public static final Integer PADDING_END = new Integer(20);
+ /** The padding end. */
+ public static final Integer PADDING_END = 20;
- /**
- * The padding before.
- */
- public static final Integer PADDING_BEFORE = new Integer(21);
+ /** The padding before. */
+ public static final Integer PADDING_BEFORE = 21;
- /**
- * The padding after.
- */
- public static final Integer PADDING_AFTER = new Integer(22);
+ /** The padding after. */
+ public static final Integer PADDING_AFTER = 22;
- /**
- * The space start.
- */
- public static final Integer SPACE_START = new Integer(23);
+ /** The space start. */
+ public static final Integer SPACE_START = 23;
- /**
- * The space end.
- */
- public static final Integer SPACE_END = new Integer(24);
+ /** The space end. */
+ public static final Integer SPACE_END = 24;
- /**
- * break before
- */
+ /** break before */
//public static final Integer BREAK_BEFORE = new Integer(25);
- /**
- * break after
- */
+ /** break after */
//public static final Integer BREAK_AFTER = new Integer(26);
- /**
- * The start-indent trait.
- */
- public static final Integer START_INDENT = new Integer(27);
+ /** The start-indent trait. */
+ public static final Integer START_INDENT = 27;
- /**
- * The end-indent trait.
- */
- public static final Integer END_INDENT = new Integer(28);
+ /** The end-indent trait. */
+ public static final Integer END_INDENT = 28;
/** The space-before trait. */
- public static final Integer SPACE_BEFORE = new Integer(29);
+ public static final Integer SPACE_BEFORE = 29;
/** The space-after trait. */
- public static final Integer SPACE_AFTER = new Integer(30);
+ public static final Integer SPACE_AFTER = 30;
/** The is-reference-area trait. */
- public static final Integer IS_REFERENCE_AREA = new Integer(31);
+ public static final Integer IS_REFERENCE_AREA = 31;
/** The is-viewport-area trait. */
- public static final Integer IS_VIEWPORT_AREA = new Integer(32);
+ public static final Integer IS_VIEWPORT_AREA = 32;
/** Blinking trait used when rendering inline parent. */
- public static final Integer BLINK = new Integer(33);
+ public static final Integer BLINK = 33;
/** Trait for color of underline decorations when rendering inline parent. */
- public static final Integer UNDERLINE_COLOR = new Integer(34);
+ public static final Integer UNDERLINE_COLOR = 34;
/** Trait for color of overline decorations when rendering inline parent. */
- public static final Integer OVERLINE_COLOR = new Integer(35);
+ public static final Integer OVERLINE_COLOR = 35;
/** Trait for color of linethrough decorations when rendering inline parent. */
- public static final Integer LINETHROUGH_COLOR = new Integer(36);
+ public static final Integer LINETHROUGH_COLOR = 36;
/** The ptr trait. Used for accessibility */
- public static final Integer PTR = new Integer(37);
+ public static final Integer PTR = 37;
+ /** writing mode trait */
+ public static final Integer WRITING_MODE = new Integer(38);
+ /** inline progression direction trait */
+ public static final Integer INLINE_PROGRESSION_DIRECTION = new Integer(39);
+ /** block progression direction trait */
+ public static final Integer BLOCK_PROGRESSION_DIRECTION = new Integer(40);
+ /** shift direction trait */
+ public static final Integer SHIFT_DIRECTION = new Integer(41);
+
/** Maximum value used by trait keys */
- public static final int MAX_TRAIT_KEY = 37;
+ public static final int MAX_TRAIT_KEY = 41;
private static final TraitInfo[] TRAIT_INFO = new TraitInfo[MAX_TRAIT_KEY + 1];
static {
// Create a hashmap mapping trait code to name for external representation
//put(ID_LINK, new TraitInfo("id-link", String.class));
- put(PTR, new TraitInfo("ptr", String.class));
- put(INTERNAL_LINK, new TraitInfo("internal-link", InternalLink.class));
- put(EXTERNAL_LINK, new TraitInfo("external-link", ExternalLink.class));
- put(FONT, new TraitInfo("font", FontTriplet.class));
- put(FONT_SIZE, new TraitInfo("font-size", Integer.class));
- put(COLOR, new TraitInfo("color", Color.class));
- put(PROD_ID, new TraitInfo("prod-id", String.class));
- put(BACKGROUND, new TraitInfo("background", Background.class));
- put(UNDERLINE, new TraitInfo("underline-score", Boolean.class));
+ put(PTR, new TraitInfo("ptr", String.class));
+ put(INTERNAL_LINK, new TraitInfo("internal-link", InternalLink.class));
+ put(EXTERNAL_LINK, new TraitInfo("external-link", ExternalLink.class));
+ put(FONT, new TraitInfo("font", FontTriplet.class));
+ put(FONT_SIZE, new TraitInfo("font-size", Integer.class));
+ put(COLOR, new TraitInfo("color", Color.class));
+ put(PROD_ID, new TraitInfo("prod-id", String.class));
+ put(BACKGROUND, new TraitInfo("background", Background.class));
+ put(UNDERLINE, new TraitInfo("underline-score", Boolean.class));
put(UNDERLINE_COLOR, new TraitInfo("underline-score-color", Color.class));
- put(OVERLINE, new TraitInfo("overline-score", Boolean.class));
+ put(OVERLINE, new TraitInfo("overline-score", Boolean.class));
put(OVERLINE_COLOR, new TraitInfo("overline-score-color", Color.class));
- put(LINETHROUGH, new TraitInfo("through-score", Boolean.class));
+ put(LINETHROUGH, new TraitInfo("through-score", Boolean.class));
put(LINETHROUGH_COLOR, new TraitInfo("through-score-color", Color.class));
- put(BLINK, new TraitInfo("blink", Boolean.class));
- //put(OFFSET, new TraitInfo("offset", Integer.class));
- //put(SHADOW, new TraitInfo("shadow", Integer.class));
- put(BORDER_START,
- new TraitInfo("border-start", BorderProps.class));
- put(BORDER_END,
- new TraitInfo("border-end", BorderProps.class));
- put(BORDER_BEFORE,
- new TraitInfo("border-before", BorderProps.class));
- put(BORDER_AFTER,
- new TraitInfo("border-after", BorderProps.class));
- put(PADDING_START,
- new TraitInfo("padding-start", Integer.class));
- put(PADDING_END,
- new TraitInfo("padding-end", Integer.class));
- put(PADDING_BEFORE,
- new TraitInfo("padding-before", Integer.class));
- put(PADDING_AFTER,
- new TraitInfo("padding-after", Integer.class));
- put(SPACE_START,
- new TraitInfo("space-start", Integer.class));
- put(SPACE_END,
- new TraitInfo("space-end", Integer.class));
- //put(BREAK_BEFORE,
- // new TraitInfo("break-before", Integer.class));
- //put(BREAK_AFTER,
- // new TraitInfo("break-after", Integer.class));
- put(START_INDENT,
- new TraitInfo("start-indent", Integer.class));
- put(END_INDENT,
- new TraitInfo("end-indent", Integer.class));
- put(SPACE_BEFORE,
- new TraitInfo("space-before", Integer.class));
- put(SPACE_AFTER,
- new TraitInfo("space-after", Integer.class));
- put(IS_REFERENCE_AREA,
- new TraitInfo("is-reference-area", Boolean.class));
- put(IS_VIEWPORT_AREA,
- new TraitInfo("is-viewport-area", Boolean.class));
+ put(BLINK, new TraitInfo("blink", Boolean.class));
+ //put(OFFSET, new TraitInfo("offset", Integer.class));
+ //put(SHADOW, new TraitInfo("shadow", Integer.class));
+ put(BORDER_START, new TraitInfo("border-start", BorderProps.class));
+ put(BORDER_END, new TraitInfo("border-end", BorderProps.class));
+ put(BORDER_BEFORE, new TraitInfo("border-before", BorderProps.class));
+ put(BORDER_AFTER, new TraitInfo("border-after", BorderProps.class));
+ put(PADDING_START, new TraitInfo("padding-start", Integer.class));
+ put(PADDING_END, new TraitInfo("padding-end", Integer.class));
+ put(PADDING_BEFORE, new TraitInfo("padding-before", Integer.class));
+ put(PADDING_AFTER, new TraitInfo("padding-after", Integer.class));
+ put(SPACE_START, new TraitInfo("space-start", Integer.class));
+ put(SPACE_END, new TraitInfo("space-end", Integer.class));
+ //put(BREAK_BEFORE, new TraitInfo("break-before", Integer.class));
+ //put(BREAK_AFTER, new TraitInfo("break-after", Integer.class));
+ put(START_INDENT, new TraitInfo("start-indent", Integer.class));
+ put(END_INDENT, new TraitInfo("end-indent", Integer.class));
+ put(SPACE_BEFORE, new TraitInfo("space-before", Integer.class));
+ put(SPACE_AFTER, new TraitInfo("space-after", Integer.class));
+ put(IS_REFERENCE_AREA, new TraitInfo("is-reference-area", Boolean.class));
+ put(IS_VIEWPORT_AREA, new TraitInfo("is-viewport-area", Boolean.class));
+ put(WRITING_MODE,
+ new TraitInfo("writing-mode", WritingMode.class));
+ put(INLINE_PROGRESSION_DIRECTION,
+ new TraitInfo("inline-progression-direction", Direction.class));
+ put(BLOCK_PROGRESSION_DIRECTION,
+ new TraitInfo("block-progression-direction", Direction.class));
+ put(SHIFT_DIRECTION,
+ new TraitInfo("shift-direction", Direction.class));
}
}
setIPD(cumulativeIPD);
- return bUnresolvedAreasPresent;
+ return hasUnresolvedAreas;
}
-}
+ /**
+ * Reset bidirectionality level of all children to default (-1),
+ * signalling that they will inherit the level of their parent text area.
+ */
+ public void resetChildrenLevel() {
+ for ( Iterator it = inlines.iterator(); it.hasNext();) {
+ ( (InlineArea) it.next() ) .resetBidiLevel();
+ }
+ }
+ private void updateLevel ( int newLevel ) {
+ if ( newLevel >= 0 ) {
+ int curLevel = getBidiLevel();
+ if ( curLevel >= 0 ) {
+ if ( newLevel < curLevel ) {
+ setBidiLevel ( newLevel );
+ }
+ } else {
+ setBidiLevel ( newLevel );
+ }
+ }
+ }
+
+
+}
/**
* Create a space area
- * @param s the space character
- * @param o the offset for the next area
- * @param a is this space adjustable?
+ * @param space the space character
+ * @param blockProgressionOffset the offset for the next area
+ * @param adjustable is this space adjustable?
+ * @param bidiLevel the bidirectional embedding level (or -1 if not defined)
*/
- public SpaceArea(char s, int o, boolean a) {
- space = s;
- offset = o;
- isAdjustable = a;
+ public SpaceArea(int blockProgressionOffset, int bidiLevel, char space, boolean adjustable) {
+ super ( blockProgressionOffset, bidiLevel );
- this.space = new String ( new char[] {space} );
++ this.space = space;
+ this.isAdjustable = adjustable;
}
/**
private int overflow;
private String regionName;
private Numeric referenceOrientation;
- private int writingMode;
- // End of property values
+ private WritingMode writingMode;
+ // End of FO trait values
- private SimplePageMaster layoutMaster;
+ /** the parent {@link SimplePageMaster} */
+ protected final SimplePageMaster layoutMaster;
/**
* Base constructor
neighbourContext = pageHeightContext;
vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(pageWidthContext)
, getExtent().getValue(pageWidthContext), reldims.ipd);
+ break;
}
if (getPrecedence() == EN_FALSE) {
- adjustIPD(vpRect, spm.getWritingMode(), neighbourContext);
+ adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext);
}
return vpRect;
}
import java.awt.Rectangle;
// FOP
+import org.apache.fop.fo.Constants;
import org.apache.fop.datatypes.FODimension;
import org.apache.fop.datatypes.LengthBase;
- import org.apache.fop.datatypes.SimplePercentBaseContext;
+ import org.apache.fop.datatypes.PercentBaseContext;
import org.apache.fop.fo.FONode;
/**
/* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
*/
- SimplePercentBaseContext pageWidthContext;
- SimplePercentBaseContext pageHeightContext;
- if (spm.getReferenceOrientation() % 180 == 0) {
- pageWidthContext = new SimplePercentBaseContext(null,
- LengthBase.CUSTOM_BASE,
- spm.getPageWidth().getValue());
- pageHeightContext = new SimplePercentBaseContext(null,
- LengthBase.CUSTOM_BASE,
- spm.getPageHeight().getValue());
- } else {
- // invert width and height since top left are rotated by 90 (cl or ccl)
- pageWidthContext = new SimplePercentBaseContext(null,
- LengthBase.CUSTOM_BASE,
- spm.getPageHeight().getValue());
- pageHeightContext = new SimplePercentBaseContext(null,
- LengthBase.CUSTOM_BASE,
- spm.getPageWidth().getValue());
- }
- SimplePercentBaseContext neighbourContext;
+ PercentBaseContext pageWidthContext = getPageWidthContext(LengthBase.CUSTOM_BASE);
+ PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE);
+ PercentBaseContext neighbourContext;
Rectangle vpRect;
- if (layoutMaster.getWritingMode() == EN_LR_TB
- || layoutMaster.getWritingMode() == EN_RL_TB) {
+ // [TBD] WRITING MODE ALERT
+ switch ( getWritingMode().getEnumValue() ) {
+ default:
+ case Constants.EN_LR_TB:
+ case Constants.EN_RL_TB:
neighbourContext = pageWidthContext;
vpRect = new Rectangle(0, 0, reldims.ipd, getExtent().getValue(pageHeightContext));
- } else {
+ break;
+ case Constants.EN_TB_LR:
+ case Constants.EN_TB_RL:
neighbourContext = pageHeightContext;
vpRect = new Rectangle(0, 0, getExtent().getValue(pageWidthContext), reldims.ipd);
+ break;
}
if (getPrecedence() == EN_FALSE) {
- adjustIPD(vpRect, spm.getWritingMode(), neighbourContext);
+ adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext);
}
return vpRect;
}
PercentBaseContext pageHeightContext = getPageHeightContext(LengthBase.CUSTOM_BASE);
PercentBaseContext neighbourContext;
Rectangle vpRect;
- if (layoutMaster.getWritingMode() == EN_LR_TB
- || layoutMaster.getWritingMode() == EN_RL_TB) {
+ // [TBD] WRITING MODE ALERT
+ switch ( getWritingMode().getEnumValue() ) {
+ default:
+ case Constants.EN_LR_TB:
+ case Constants.EN_RL_TB:
neighbourContext = pageHeightContext;
vpRect = new Rectangle(0, 0, getExtent().getValue(pageWidthContext), reldims.bpd);
- } else {
+ break;
+ case Constants.EN_TB_LR:
+ case Constants.EN_TB_RL:
neighbourContext = pageWidthContext;
vpRect = new Rectangle(0, 0, reldims.bpd, getExtent().getValue(pageHeightContext));
+ break;
}
- adjustIPD(vpRect, spm.getWritingMode(), neighbourContext);
+ adjustIPD(vpRect, layoutMaster.getWritingMode(), neighbourContext);
return vpRect;
}
// Process any last elements
if (inWord) {
- processWord(alignment, sequence, prevAreaInfo, ch, false, false);
+ processWord(alignment, sequence, prevAreaInfo, ch, false, false, prevLevel);
} else if (inWhitespace) {
- processWhitespace(alignment, sequence, true);
+ processWhitespace(alignment, sequence, !keepTogether);
} else if (areaInfo != null) {
processLeftoverAreaInfo(alignment, sequence, areaInfo,
ch == CharUtilities.ZERO_WIDTH_SPACE);