]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Merged /xmlgraphics/fop/trunk:r1053043-1061681
authorSimon Pepping <spepping@apache.org>
Fri, 21 Jan 2011 11:36:16 +0000 (11:36 +0000)
committerSimon Pepping <spepping@apache.org>
Fri, 21 Jan 2011 11:36:16 +0000 (11:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ComplexScripts@1061759 13f79535-47bb-0310-9956-ffa450edef68

16 files changed:
1  2 
build.xml
src/java/org/apache/fop/area/Block.java
src/java/org/apache/fop/area/Trait.java
src/java/org/apache/fop/area/inline/InlineParent.java
src/java/org/apache/fop/area/inline/SpaceArea.java
src/java/org/apache/fop/fo/pagination/PageSequence.java
src/java/org/apache/fop/fo/pagination/Region.java
src/java/org/apache/fop/fo/pagination/RegionAfter.java
src/java/org/apache/fop/fo/pagination/RegionBefore.java
src/java/org/apache/fop/fo/pagination/RegionBody.java
src/java/org/apache/fop/fo/pagination/RegionEnd.java
src/java/org/apache/fop/fo/pagination/RegionStart.java
src/java/org/apache/fop/fo/pagination/SimplePageMaster.java
src/java/org/apache/fop/fonts/FontManagerConfigurator.java
src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
src/java/org/apache/fop/render/AbstractRenderer.java

diff --cc build.xml
index 9ac8268f9da01f901b3d01ab5458f2e84aa3b47a,c63de40042b1cdc638774b1b1ddca441bbc08d96..97e9bd41eae0fdc0a766d05319df18a9dea5f1ed
+++ b/build.xml
@@@ -85,11 -85,11 +85,11 @@@ list of possible build targets
      </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">
@@@ -98,7 -98,7 +98,7 @@@
      <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>
@@@ -1104,7 -1108,7 +1118,7 @@@ NOTE
  <!-- =================================================================== -->
    <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.">
index 0adc23cf3a01939fe805c825758038bc43982118,a8e1db186e30ff0a4138cbc12abd641dd5859e40..70827760a9d937dbb6cacc8d61adc974e5c7b875
@@@ -53,169 -48,110 +50,119 @@@ public final class Trait implements Ser
       * 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));
  
      }
  
index 9e69e00a703ab4db4604b619fffd0f1513567c1e,db8f2f056f7a461bf4992c3611bdc9b3657e33bd..f2d218daec6547ba51e25ef523160b6d38138bfc
@@@ -98,30 -96,7 +98,30 @@@ public class InlineParent extends Inlin
          }
          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 );
 +            }
 +        }
 +    }
 +
 +
 +}
index 6b0ba96ce025f0a34243efd051ed87fd84a79a91,9c698b305d5ad490307052de6118b116b830eddc..d62455b86c4492e6c40296178a1be9f12784ecd4
@@@ -38,15 -38,14 +38,15 @@@ public class SpaceArea extends InlineAr
  
      /**
       * 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;
      }
  
      /**
index f3d7dcc66646bd21d010fe2d571a0fcb9d2a451c,a3c259aa7dcb04ad4a39f340cda748743a80b32e..16956b6dde24ed32f3e8023cce1317ece64316af
@@@ -45,10 -44,11 +45,11 @@@ public abstract class Region extends FO
      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
index 3b9be033351414950482824fa43096d9b116926d,bab5d46b818969eefbbde98f7cfeef0da5b56c18..3541c54bef61b74b7e03eb7eb51456d2f3d5c5bb
@@@ -68,10 -61,9 +68,10 @@@ public class RegionAfter extends Region
              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;
      }
index 2b0fb43f401620cceb7f295ecbf4d1f36cda8e42,4aa29ec9071ecb1aef6a11b785cc1968f8d6ab3a..295f6dc1c40e9548ba414037a6ec6f0af68fca9d
@@@ -23,10 -23,9 +23,10 @@@ package org.apache.fop.fo.pagination
  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;
  
  /**
@@@ -54,42 -53,20 +54,26 @@@ public class RegionBefore extends Regio
          /* 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;
      }
index a62744bae3982aaac281d6941317346a512c8fa0,fdb423c51df26e46aa060b2fdbd09728b9617c63..16bcb23ffe0335f30834b385e47b46ce58c151d1
@@@ -53,21 -52,15 +53,21 @@@ public class RegionStart extends Region
          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;
      }
  
index 7fdacb6fa2f47c697f5aadaa2f849fa799d7b159,81240dec00202ff33746ac28abb050f091fad3ef..d174ff0c182900f9ab9374786749004bbc7a7bf7
@@@ -837,9 -703,9 +837,9 @@@ public class TextLayoutManager extends 
  
          // 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);