You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by sp...@apache.org on 2010/08/19 21:46:45 UTC

svn commit: r987282 [1/9] - in /xmlgraphics/fop/branches/Temp_ComplexScripts: ./ src/codegen/unicode/java/org/apache/fop/hyphenation/ src/codegen/unicode/java/org/apache/fop/text/bidi/ src/java/org/apache/fop/area/ src/java/org/apache/fop/area/inline/ ...

Author: spepping
Date: Thu Aug 19 19:46:41 2010
New Revision: 987282

URL: http://svn.apache.org/viewvc?rev=987282&view=rev
Log:
Bugzilla #49687:
Complex Script Support, patch of 2010-08-19
Submitted by: Glenn Adams <glenn.at.skynav.com>


Added:
    xmlgraphics/fop/branches/Temp_ComplexScripts/findbugs-exclude.xml   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/unicode/java/org/apache/fop/text/bidi/
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/unicode/java/org/apache/fop/text/bidi/GenerateBidiClassUtils.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/ArabicScriptProcessor.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/DefaultScriptProcessor.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/DiscontinuousAssociationException.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/GlyphContextTester.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/GlyphCoverageTable.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/GlyphPositioning.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/GlyphPositioningSubtable.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/GlyphPositioningTable.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/GlyphSequence.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/GlyphSubstitution.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/GlyphSubstitutionSubtable.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/GlyphSubstitutionTable.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/GlyphSubtable.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/GlyphTable.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/GlyphUtils.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/IncompatibleSubtableException.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/Positionable.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/ScriptProcessor.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/Substitutable.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/BidiUtil.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/text/bidi/
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/text/bidi/BidiClassUtils.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/traits/Direction.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/traits/WritingMode.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/traits/WritingModeTraits.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/traits/WritingModeTraitsGetter.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/traits/WritingModeTraitsSetter.java   (with props)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/util/BidiConstants.java   (with props)
Modified:
    xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/unicode/java/org/apache/fop/hyphenation/UnicodeClasses.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Area.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/AreaTreeParser.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Block.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/CTM.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/LineArea.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/RegionViewport.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Trait.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/FilledArea.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/InlineArea.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/InlineParent.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/SpaceArea.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/TextArea.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/Viewport.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/WordArea.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/Constants.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/FOPropertyMapping.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/FOText.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/FObj.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/PropertyList.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/flow/BidiOverride.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/flow/Block.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/flow/BlockContainer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/flow/Character.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/flow/InlineContainer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/flow/InlineLevel.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/flow/Leader.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/flow/table/Table.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/pagination/PageSequence.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/pagination/Region.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/pagination/RegionAfter.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/pagination/RegionBA.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/pagination/RegionBefore.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/pagination/RegionBody.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/pagination/RegionEnd.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/pagination/RegionSE.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/pagination/RegionStart.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/CustomFont.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/EmbedFontInfo.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/Font.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/FontCache.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/FontInfoConfigurator.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/FontLoader.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/FontReader.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/LazyFont.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/MultiByteFont.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/MutableFont.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/Typeface.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/apps/TTFReader.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/autodetect/FontInfoFinder.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/truetype/TTFFile.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/type1/Type1FontLoader.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/LayoutContext.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/AbstractGraphicsLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/AlignmentContext.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/BasicScaledBaselineTable.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/BidiLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/CharacterLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTable.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTableFactory.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFDocument.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFText.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/AbstractRenderer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/afp/AFPRenderer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/intermediate/IFRenderer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pcl/PCLRenderer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pdf/PDFRenderer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/ps/PSRenderer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfFootnote.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/xml/XMLRenderer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/tools/anttasks/FileCompare.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/util/CharUtilities.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/fonts/TrueTypeAnsiTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/layoutengine/disabled-testcases.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/layoutengine/standard-testcases/block_basic_2.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/layoutengine/standard-testcases/kerning_1_off.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/layoutengine/standard-testcases/kerning_1_on.xml

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml?rev=987282&r1=987281&r2=987282&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml Thu Aug 19 19:46:41 2010
@@ -154,6 +154,8 @@ list of possible build targets.
   <property name="javac.fork" value="no"/>
   <property name="junit.fork" value="on"/>
   <property name="junit.haltonfailure" value="off"/>
+  <property name="junit.printsummary" value="off"/>
+  <property name="junit.formatter.brief" value="on"/>
   <property name="javadoc.packages" value="org.apache.fop.*"/>
   <property name="src.dir" value="${basedir}/src"/>
   <property name="src.codegen.dir" value="${src.dir}/codegen"/>
@@ -712,10 +714,15 @@ list of possible build targets.
 <!-- =================================================================== -->
 <!-- Testing                                                             -->
 <!-- =================================================================== -->
-  <target name="junit-with-xmlunit" depends="init-avail" if="xmlunit.present">
+  <target name="junit-init" depends="init-avail" if="xmlunit.present">
+    <condition property="junit.formatter.brief.use">
+      <istrue value="${junit.formatter.brief}"/>
+    </condition>
+  </target>
+  <target name="junit-with-xmlunit" depends="junit-init" if="xmlunit.present">
     <patternset id="test-sources"/>
   </target>
-  <target name="junit-without-xmlunit" depends="init-avail" unless="xmlunit.present">
+  <target name="junit-without-xmlunit" depends="junit-init" unless="xmlunit.present">
     <patternset id="test-sources">
       <exclude name="**/intermediate/*"/>
     </patternset>
@@ -760,10 +767,10 @@ list of possible build targets.
   <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}">
+    <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" printsummary="${junit.printsummary}">
       <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>
@@ -782,10 +789,10 @@ list of possible build targets.
          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">
+    <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure" printsummary="${junit.printsummary}">
       <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>
@@ -805,13 +812,13 @@ list of possible build targets.
   </target>
   <target name="junit-userconfig" depends="junit-compile" if="junit.present" description="Runs FOP's user config JUnit tests">
     <echo message="Running user config tests"/>
-    <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
+    <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure" printsummary="${junit.printsummary}">
       <jvmarg value="-Xmx1024m"/>
       <sysproperty key="basedir" value="${basedir}"/>
       <sysproperty key="jawa.awt.headless" value="true"/>
       <sysproperty key="fop.layoutengine.disabled" value="${layoutengine.disabled}"/>
       <sysproperty key="fop.layoutengine.testset" value="standard"/>
-      <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>
@@ -823,10 +830,10 @@ list of possible build targets.
   </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">
+    <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure" printsummary="${junit.printsummary}">
       <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>
@@ -859,12 +866,12 @@ list of possible build targets.
   </target>
   <target name="junit-layout-standard" depends="junit-compile, junit-fotree" if="junit.present" description="Runs FOP's standard JUnit layout tests">
     <echo message="Running standard layout engine tests"/>
-    <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
+    <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure" printsummary="${junit.printsummary}">
       <sysproperty key="basedir" value="${basedir}"/>
       <sysproperty key="jawa.awt.headless" value="true"/>
       <sysproperty key="fop.layoutengine.disabled" value="${layoutengine.disabled}"/>
       <sysproperty key="fop.layoutengine.testset" value="standard"/>
-      <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>
@@ -876,12 +883,12 @@ list of possible build targets.
   </target>
   <target name="junit-layout-hyphenation" depends="hyphenation-present, junit-compile" if="hyphenation.present" description="Runs FOP's JUnit hyphenation layout tests">
     <echo message="Running hyphenation layout engine tests"/>
-    <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
+    <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure" printsummary="${junit.printsummary}">
       <sysproperty key="basedir" value="${basedir}"/>
       <sysproperty key="jawa.awt.headless" value="true"/>
       <sysproperty key="fop.layoutengine.disabled" value="${layoutengine.disabled}"/>
       <sysproperty key="fop.layoutengine.testset" value="hyphenation"/>
-      <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>
@@ -894,11 +901,11 @@ list of possible build targets.
   <target name="junit-layout" depends="junit-layout-standard, junit-layout-hyphenation" description="Runs all FOP's JUnit layout tests"/>
   <target name="junit-fotree" depends="junit-compile" description="Runs FOP's FO tree JUnit tests" if="junit.present">
     <echo message="Running fo tree tests"/>
-    <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
+    <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure" printsummary="${junit.printsummary}">
       <sysproperty key="basedir" value="${basedir}"/>
       <sysproperty key="jawa.awt.headless" value="true"/>
       <sysproperty key="fop.layoutengine.disabled" value="${fotree.disabled}"/>
-      <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>
@@ -918,12 +925,12 @@ list of possible build targets.
     <attribute name="outfile"/>
     <sequential>
       <echo message="Running @{title} tests..."/>
-      <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure">
+      <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure" printsummary="${junit.printsummary}">
         <sysproperty key="basedir" value="${basedir}/@{basedir}"/>
         <sysproperty key="jawa.awt.headless" value="true"/>
         <sysproperty key="fop.layoutengine.disabled" value="${layoutengine.disabled}"/>
         <sysproperty key="fop.layoutengine.testset" value="standard"/>
-        <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>
@@ -955,10 +962,10 @@ list of possible build targets.
   </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">
+    <junit dir="${basedir}" haltonfailure="${junit.haltonfailure}" fork="${junit.fork}" errorproperty="fop.junit.error" failureproperty="fop.junit.failure" printsummary="${junit.printsummary}">
       <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>
@@ -1190,22 +1197,62 @@ NOTE:
 <!-- =================================================================== -->
 <!-- Findbugs                                                            -->
 <!-- =================================================================== -->
-  <property name="findbugs.lib" value="${findbugs.home.dir}/lib"/>
-  <path id="libs-findbugs">
-    <fileset dir="${findbugs.lib}">
-      <include name="*.jar"/>
-    </fileset>
-  </path>
-  <target name="findbugs-avail" unless="findbugs.home.dir">
-    <echo message="Findbugs Support NOT Present. Please download it from http://findbugs.sf.net/ and set findbugs.home.dir in build-local.properties"/>
-  </target>
-  <target name="findbugs" depends="init, findbugs-avail, compile-java" if="findbugs.home.dir">
-    <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpathref="libs-findbugs"/>
-    <findbugs home="${findbugs.home.dir}" output="html" reportLevel="low" effort="max" outputFile="${build.dir}/report_findbugs.html" jvmargs="-Xmx1024m">
+  <target name="findbugs-maybe-describe-install" unless="findbugs.present">
+    <echo message="Please download FINDBUGS from http://findbugs.sf.net/ and set property findbugs.home.dir"/>
+    <echo message="in build-local.properties to the top-level directory of the binary distribution."/>
+   </target>
+  <target name="findbugs-avail">
+    <condition property="findbugs.present">
+      <and>
+        <isset property="findbugs.home.dir"/>
+        <available file="${findbugs.home.dir}" type="dir"/>
+      </and>
+    </condition>
+    <condition property="findbugs.message" value="FINDBUGS Support PRESENT">
+      <equals arg1="${findbugs.present}" arg2="true"/>
+    </condition>
+    <condition property="findbugs.message" value="FINDBUGS Support NOT Present">
+      <not>
+        <equals arg1="${findbugs.present}" arg2="true"/>
+      </not>
+    </condition>
+    <echo message="${findbugs.message}"/>
+    <antcall target="findbugs-maybe-describe-install"/>
+  </target>
+  <target name="findbugs-exec" depends="compile-java" if="findbugs.present">
+    <taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask">
+      <classpath>
+        <fileset dir="${findbugs.home.dir}/lib">
+          <include name="*.jar"/>
+        </fileset>
+      </classpath>
+    </taskdef>
+    <findbugs home="${findbugs.home.dir}" output="${findbugs.output.format}" reportLevel="low" effort="max"
+              outputFile="${build.dir}/report_findbugs.${findbugs.output.extension}" excludeFilter="findbugs-exclude.xml" jvmargs="-Xmx1024m">
       <sourcePath path="${src.java.dir}"/>
       <class location="${build.classes.dir}"/>
+      <auxClasspath>
+        <path refid="libs-build-classpath"/>
+        <path>
+          <fileset dir="${ant.library.dir}">
+            <include name="ant.jar"/>
+            <include name="ant-launcher.jar"/>
+          </fileset>
+        </path>
+      </auxClasspath>
     </findbugs>
   </target>
+  <target name="findbugs-xml" depends="findbugs-avail" if="findbugs.present" description="Runs findbugs for a code quality report in XML">
+    <property name="findbugs.output.format" value="xml"/>
+    <property name="findbugs.output.extension" value="xml"/>
+    <antcall target="findbugs-exec"/> 
+  </target>
+  <target name="findbugs-html" depends="findbugs-avail" if="findbugs.present" description="Runs findbugs for a code quality report in HTML">
+    <property name="findbugs.output.format" value="html"/>
+    <property name="findbugs.output.extension" value="html"/>
+    <antcall target="findbugs-exec"/> 
+  </target>
+  <target name="findbugs" depends="findbugs-html" description="Runs findbugs for a code quality report in HTML"/>
 <!-- =================================================================== -->
 <!-- Creates the reports                                                 -->
 <!-- =================================================================== -->
@@ -1359,14 +1406,22 @@ 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}">
       <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"/>
     </java>
+    <java classname="org.apache.fop.text.bidi.GenerateBidiClassUtils" classpath="${build.codegen-classes.dir}">
+      <arg line="-o ${src.dir}/java/org/apache/fop/text/bidi/BidiClassUtils.java"/>
+    </java>
   </target>
 <!-- =================================================================== -->
 <!-- Special target for Gump                                             -->

Added: xmlgraphics/fop/branches/Temp_ComplexScripts/findbugs-exclude.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/findbugs-exclude.xml?rev=987282&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/findbugs-exclude.xml (added)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/findbugs-exclude.xml Thu Aug 19 19:46:41 2010
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<FindBugsFilter>
+  <!-- use of null is preferred over zero length array -->
+  <Match>
+    <Class name="org.apache.fop.area.inline.WordArea"/>
+    <Method name="getBidiLevels"/>
+    <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.fo.FOText"/>
+    <Method name="getBidiLevels"/>
+    <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.fonts.ArabicScriptProcessor"/>
+    <Method name="position"/>
+    <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.fonts.DefaultScriptProcessor"/>
+    <Method name="position"/>
+    <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.fonts.GlyphPositioningSubtable"/>
+    <Method name="position"/>
+    <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.fonts.GlyphPositioningTable"/>
+    <Method name="position"/>
+    <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.fonts.LazyFont"/>
+    <Method name="performPositioning"/>
+    <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.fonts.MultiByteFont"/>
+    <Method name="performPositioning"/>
+    <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.layoutmgr.BidiUtil$UnicodeBidiAlgorithm"/>
+    <Method name="resolveLevels"/>
+    <Bug pattern="PZLA_PREFER_ZERO_LENGTH_ARRAYS"/>
+  </Match>
+  <!-- string not exposed to end user -->
+  <Match>
+    <Class name="org.apache.fop.fonts.GlyphPositioningTable"/>
+    <Method name="getLookupTypeFromName"/>
+    <Bug pattern="DM_CONVERT_CASE"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.fonts.GlyphSubstitutionTable"/>
+    <Method name="getLookupTypeFromName"/>
+    <Bug pattern="DM_CONVERT_CASE"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.fonts.GlyphTable"/>
+    <Method name="getTableTypeFromName"/>
+    <Bug pattern="DM_CONVERT_CASE"/>
+  </Match>
+  <!-- performance optimizations -->
+  <Match>
+    <Class name="org.apache.fop.fonts.GlyphSequence"/>
+    <Method name="getAssociations"/>
+    <Bug pattern="EI_EXPOSE_REP"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.fonts.GlyphSubstitutionTable$Ligature"/>
+    <Or>
+        <Method name="getComponents"/>
+        <Method name="getLigatures"/>
+    </Or>
+    <Bug pattern="EI_EXPOSE_REP"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.fonts.GlyphSubstitutionTable$Ligature"/>
+    <Or>
+        <Method name="&lt;init&gt;" params="int, int[]" returns="void"/>
+    </Or>
+    <Bug pattern="EI_EXPOSE_REP2"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.fonts.GlyphSubstitutionTable$LigatureSet"/>
+    <Method name="getLigatures"/>
+    <Bug pattern="EI_EXPOSE_REP"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.fonts.GlyphSubstitutionTable$LigatureSet"/>
+    <Method name="&lt;init&gt;" params="org.apache.fop.fonts.GlyphSubstitutionTable$Ligature[]" returns="void"/>
+    <Bug pattern="EI_EXPOSE_REP2"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.area.inline.WordArea"/>
+    <Method name="getBidiLevels"/>
+    <Bug pattern="EI_EXPOSE_REP"/>
+  </Match>
+  <Match>
+    <Class name="org.apache.fop.fo.FOText"/>
+    <Method name="getBidiLevels"/>
+    <Bug pattern="EI_EXPOSE_REP"/>
+  </Match>
+</FindBugsFilter>

Propchange: xmlgraphics/fop/branches/Temp_ComplexScripts/findbugs-exclude.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_ComplexScripts/findbugs-exclude.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/unicode/java/org/apache/fop/hyphenation/UnicodeClasses.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/unicode/java/org/apache/fop/hyphenation/UnicodeClasses.java?rev=987282&r1=987281&r2=987282&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/unicode/java/org/apache/fop/hyphenation/UnicodeClasses.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/unicode/java/org/apache/fop/hyphenation/UnicodeClasses.java Thu Aug 19 19:46:41 2010
@@ -160,7 +160,7 @@ public final class UnicodeClasses {
      * @param unidataPath path to the directory with UCD files  
      * @param outfilePath output file
      * @throws IOException if the input files are not found
-     * @throws URISyntaxException 
+     * @throws URISyntaxException if {@code unidataPath} cannot be converted to a URI
      */
     public static void fromUCD(boolean hexcode, String unidataPath, String outfilePath)
     throws IOException, URISyntaxException {

Added: xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/unicode/java/org/apache/fop/text/bidi/GenerateBidiClassUtils.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/unicode/java/org/apache/fop/text/bidi/GenerateBidiClassUtils.java?rev=987282&view=auto
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/unicode/java/org/apache/fop/text/bidi/GenerateBidiClassUtils.java (added)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/unicode/java/org/apache/fop/text/bidi/GenerateBidiClassUtils.java Thu Aug 19 19:46:41 2010
@@ -0,0 +1,571 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* $Id$ */
+
+package org.apache.fop.text.bidi;
+
+import java.io.BufferedReader;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.InputStreamReader;
+import java.io.PrintWriter;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import org.apache.fop.util.BidiConstants;
+import org.apache.fop.util.License;
+
+// CSOFF: LineLength
+// CSOFF: NoWhitespaceAfter
+
+/**
+ * <p>Utility for generating a Java class representing bidirectional
+ * class properties from the Unicode property files.</p>
+ *
+ * <p>This code is derived in part from GenerateLineBreakUtils.java.</p>
+ *
+ * @author Glenn Adams
+ */
+public final class GenerateBidiClassUtils {
+
+    private GenerateBidiClassUtils() {
+    }
+
+    private static byte[] bcL1 = new byte[256]; // ascii and basic latin blocks ( 0x0000 - 0x00FF )
+    private static byte[] bcR1 = new byte[368]; // hebrew and arabic blocks     ( 0x0590 - 0x06FF )
+    private static int[]  bcS1;                 // interval start indices
+    private static int[]  bcE1;                 // interval end indices
+    private static byte[] bcC1;                 // interval bid classes
+
+    /**
+     * Generate a class managing bidi class properties for Unicode characters.
+     *
+     * @param bidiFileName name (as URL) of file containing bidi type data
+     * @param outFileName name of the output file
+     * @throws Exception
+     */
+    private static void convertBidiClassProperties(String bidiFileName, String outFileName) throws Exception {
+
+        readBidiClassProperties(bidiFileName);
+
+        // generate class
+        PrintWriter out = new PrintWriter(new FileWriter(outFileName));
+        License.writeJavaLicenseId(out);
+        out.println();
+        out.println("package org.apache.fop.text.bidi;");
+        out.println();
+        out.println("import java.util.Arrays;");
+        out.println("import org.apache.fop.util.BidiConstants;");
+        out.println();
+        out.println("// CSOFF: WhitespaceAfterCheck");
+        out.println("// CSOFF: LineLengthCheck");
+        out.println();
+        out.println("/*");
+        out.println(" * !!! THIS IS A GENERATED FILE !!!");
+        out.println(" * If updates to the source are needed, then:");
+        out.println(" * - apply the necessary modifications to");
+        out.println(" *   'src/codegen/unicode/java/org/apache/fop/text/bidi/GenerateBidiClassUtils.java'");
+        out.println(" * - run 'ant codegen-unicode', which will generate a new BidiClassUtils.java");
+        out.println(" *   in 'src/java/org/apache/fop/text/bidi'");
+        out.println(" * - commit BOTH changed files");
+        out.println(" */");
+        out.println();
+        out.println("/** Bidirectional class utilities. */");
+        out.println("public final class BidiClassUtils {");
+        out.println();
+        out.println("private BidiClassUtils() {");
+        out.println("}");
+        out.println();
+        dumpData(out);
+        out.println ("/**");
+        out.println (" * Lookup bidi class for character expressed as unicode scalar value.");
+        out.println (" * @param ch a unicode scalar value");
+        out.println (" * @return bidi class");
+        out.println (" */");
+        out.println("public static int getBidiClass ( int ch ) {");
+        out.println("  if ( ch <= 0x00FF ) {");
+        out.println("    return bcL1 [ ch - 0x0000 ];");
+        out.println("  } else if ( ( ch >= 0x0590 ) && ( ch <= 0x06FF ) ) {");
+        out.println("    return bcR1 [ ch - 0x0590 ];");
+        out.println("  } else {");
+        out.println("    return getBidiClass ( ch, bcS1, bcE1, bcC1 );");
+        out.println("  }");
+        out.println("}");
+        out.println();
+        out.println("private static int getBidiClass ( int ch, int[] sa, int[] ea, byte[] ca ) {");
+        out.println("  int k = Arrays.binarySearch ( sa, ch );");
+        out.println("  if ( k >= 0 ) {");
+        out.println("    return ca [ k ];");
+        out.println("  } else {");
+        out.println("    k = - ( k + 1 );");
+        out.println("    if ( k == 0 ) {");
+        out.println("      return BidiConstants.L;");
+        out.println("    } else if ( ch <= ea [ k - 1 ] ) {");
+        out.println("      return ca [ k - 1 ];");
+        out.println("    } else {");
+        out.println("      return BidiConstants.L;");
+        out.println("    }");
+        out.println("  }");
+        out.println("}");
+        out.println();
+        out.println("}");
+        out.flush();
+        out.close();
+    }
+
+    /**
+     * Read bidi class property data.
+     *
+     * @param bidiFileName name (as URL) of bidi type data
+     */
+    private static void readBidiClassProperties(String bidiFileName) throws Exception {
+        // read property names
+        BufferedReader b = new BufferedReader(new InputStreamReader(new URL(bidiFileName).openStream()));
+        String line;
+        int lineNumber = 0;
+        TreeSet intervals = new TreeSet();
+        while ( ( line = b.readLine() ) != null ) {
+            lineNumber++;
+            if ( line.startsWith("#") ) {
+                continue;
+            } else if ( line.length() == 0 ) {
+                continue;
+            } else {
+                if ( line.indexOf ( "#" ) != -1 ) {
+                    line = ( line.split ( "#" ) ) [ 0 ];
+                }
+                String[] fa = line.split ( ";" );
+                if ( fa.length == 2 ) {
+                    int[] interval = parseInterval ( fa[0].trim() );
+                    byte bidiClass = (byte) parseBidiClass ( fa[1].trim() );
+                    if ( interval[1] == interval[0] ) { // singleton
+                        int c = interval[0];
+                        if ( c <= 0x00FF ) {
+                            if ( bcL1 [ c - 0x0000 ] == 0 ) {
+                                bcL1 [ c - 0x0000 ] = bidiClass;
+                            } else {
+                                throw new Exception ( "duplicate singleton entry: " + c );
+                            }
+                        } else if ( ( c >= 0x0590 ) && ( c <= 0x06FF ) ) {
+                            if ( bcR1 [ c - 0x0590 ] == 0 ) {
+                                bcR1 [ c - 0x0590 ] = bidiClass;
+                            } else {
+                                throw new Exception ( "duplicate singleton entry: " + c );
+                            }
+                        } else {
+                            addInterval ( intervals, c, c, bidiClass );
+                        }
+                    } else {                            // non-singleton
+                        int s = interval[0];
+                        int e = interval[1];            // inclusive
+                        if ( s <= 0x00FF ) {
+                            for ( int i = s; i <= e; i++ ) {
+                                if ( i <= 0x00FF ) {
+                                    if ( bcL1 [ i - 0x0000 ] == 0 ) {
+                                        bcL1 [ i - 0x0000 ] = bidiClass;
+                                    } else {
+                                        throw new Exception ( "duplicate singleton entry: " + i );
+                                    }
+                                } else {
+                                    addInterval ( intervals, i, e, bidiClass );
+                                    break;
+                                }
+                            }
+                        } else if ( ( s >= 0x0590 ) && ( s <= 0x06FF ) ) {
+                            for ( int i = s; i <= e; i++ ) {
+                                if ( i <= 0x06FF ) {
+                                    if ( bcR1 [ i - 0x0590 ] == 0 ) {
+                                        bcR1 [ i - 0x0590 ] = bidiClass;
+                                    } else {
+                                        throw new Exception ( "duplicate singleton entry: " + i );
+                                    }
+                                } else {
+                                    addInterval ( intervals, i, e, bidiClass );
+                                    break;
+                                }
+                            }
+                        } else {
+                            addInterval ( intervals, s, e, bidiClass );
+                        }
+                    }
+                } else {
+                    throw new Exception ( "bad syntax, line(" + lineNumber + "): " + line );
+                }
+            }
+        }
+        // compile interval search data
+        int ivIndex = 0, niv = intervals.size();
+        bcS1 = new int [ niv ];
+        bcE1 = new int [ niv ];
+        bcC1 = new byte [ niv ];
+        for ( Iterator it = intervals.iterator(); it.hasNext(); ivIndex++ ) {
+            Interval iv = (Interval) it.next();
+            bcS1[ivIndex] = iv.start;
+            bcE1[ivIndex] = iv.end;
+            bcC1[ivIndex] = (byte) iv.bidiClass;
+        }
+        // test data
+        test();
+    }
+
+    private static int[] parseInterval ( String interval ) throws Exception {
+        int s, e;
+        String[] fa = interval.split("\\.\\.");
+        if ( fa.length == 1 ) {
+            s = Integer.parseInt ( fa[0], 16 );
+            e = s;
+        } else if ( fa.length == 2 ) {
+            s = Integer.parseInt ( fa[0], 16 );
+            e = Integer.parseInt ( fa[1], 16 );
+        } else {
+            throw new Exception ( "bad interval syntax: " + interval );
+        }
+        if ( e < s ) {
+            throw new Exception ( "bad interval, start must be less than or equal to end: " + interval );
+        }
+        return new int[] {s, e};
+    }
+
+    private static int parseBidiClass ( String bidiClass ) {
+        int bc = 0;
+        if ( "L".equals ( bidiClass ) ) {
+            bc = BidiConstants.L;
+        } else if ( "LRE".equals ( bidiClass ) ) {
+            bc = BidiConstants.LRE;
+        } else if ( "LRO".equals ( bidiClass ) ) {
+            bc = BidiConstants.LRO;
+        } else if ( "R".equals ( bidiClass ) ) {
+            bc = BidiConstants.R;
+        } else if ( "AL".equals ( bidiClass ) ) {
+            bc = BidiConstants.AL;
+        } else if ( "RLE".equals ( bidiClass ) ) {
+            bc = BidiConstants.RLE;
+        } else if ( "RLO".equals ( bidiClass ) ) {
+            bc = BidiConstants.RLO;
+        } else if ( "PDF".equals ( bidiClass ) ) {
+            bc = BidiConstants.PDF;
+        } else if ( "EN".equals ( bidiClass ) ) {
+            bc = BidiConstants.EN;
+        } else if ( "ES".equals ( bidiClass ) ) {
+            bc = BidiConstants.ES;
+        } else if ( "ET".equals ( bidiClass ) ) {
+            bc = BidiConstants.ET;
+        } else if ( "AN".equals ( bidiClass ) ) {
+            bc = BidiConstants.AN;
+        } else if ( "CS".equals ( bidiClass ) ) {
+            bc = BidiConstants.CS;
+        } else if ( "NSM".equals ( bidiClass ) ) {
+            bc = BidiConstants.NSM;
+        } else if ( "BN".equals ( bidiClass ) ) {
+            bc = BidiConstants.BN;
+        } else if ( "B".equals ( bidiClass ) ) {
+            bc = BidiConstants.B;
+        } else if ( "S".equals ( bidiClass ) ) {
+            bc = BidiConstants.S;
+        } else if ( "WS".equals ( bidiClass ) ) {
+            bc = BidiConstants.WS;
+        } else if ( "ON".equals ( bidiClass ) ) {
+            bc = BidiConstants.ON;
+        } else {
+            throw new IllegalArgumentException ( "unknown bidi class: " + bidiClass );
+        }
+        return bc;
+    }
+
+    private static void addInterval ( SortedSet intervals, int start, int end, int bidiClass ) {
+        intervals.add ( new Interval ( start, end, bidiClass ) );
+    }
+
+    private static void dumpData ( PrintWriter out ) {
+        boolean first;
+        StringBuffer sb = new StringBuffer();
+
+        // bcL1
+        first = true;
+        sb.setLength(0);
+        out.println ( "private static byte[] bcL1 = {" );
+        for ( int i = 0; i < bcL1.length; i++ ) {
+            if ( ! first ) {
+                sb.append ( "," );
+            } else {
+                first = false;
+            }
+            sb.append ( bcL1[i] );
+            if ( sb.length() > 120 ) {
+                sb.append(',');
+                out.println(sb);
+                first = true;
+                sb.setLength(0);
+            }
+        }
+        if ( sb.length() > 0 ) {
+            out.println(sb);
+        }
+        out.println ( "};" );
+        out.println();
+
+        // bcR1
+        first = true;
+        sb.setLength(0);
+        out.println ( "private static byte[] bcR1 = {" );
+        for ( int i = 0; i < bcR1.length; i++ ) {
+            if ( ! first ) {
+                sb.append ( "," );
+            } else {
+                first = false;
+            }
+            sb.append ( bcR1[i] );
+            if ( sb.length() > 120 ) {
+                sb.append(',');
+                out.println(sb);
+                first = true;
+                sb.setLength(0);
+            }
+        }
+        if ( sb.length() > 0 ) {
+            out.println(sb);
+        }
+        out.println ( "};" );
+        out.println();
+
+        // bcS1
+        first = true;
+        sb.setLength(0);
+        out.println ( "private static int[] bcS1 = {" );
+        for ( int i = 0; i < bcS1.length; i++ ) {
+            if ( ! first ) {
+                sb.append ( "," );
+            } else {
+                first = false;
+            }
+            sb.append ( bcS1[i] );
+            if ( sb.length() > 120 ) {
+                sb.append(',');
+                out.println(sb);
+                first = true;
+                sb.setLength(0);
+            }
+        }
+        if ( sb.length() > 0 ) {
+            out.println(sb);
+        }
+        out.println ( "};" );
+        out.println();
+
+        // bcE1
+        first = true;
+        sb.setLength(0);
+        out.println ( "private static int[] bcE1 = {" );
+        for ( int i = 0; i < bcE1.length; i++ ) {
+            if ( ! first ) {
+                sb.append ( "," );
+            } else {
+                first = false;
+            }
+            sb.append ( bcE1[i] );
+            if ( sb.length() > 120 ) {
+                sb.append(',');
+                out.println(sb);
+                first = true;
+                sb.setLength(0);
+            }
+        }
+        if ( sb.length() > 0 ) {
+            out.println(sb);
+        }
+        out.println ( "};" );
+        out.println();
+
+        // bcC1
+        first = true;
+        sb.setLength(0);
+        out.println ( "private static byte[] bcC1 = {" );
+        for ( int i = 0; i < bcC1.length; i++ ) {
+            if ( ! first ) {
+                sb.append ( "," );
+            } else {
+                first = false;
+            }
+            sb.append ( bcC1[i] );
+            if ( sb.length() > 120 ) {
+                sb.append(',');
+                out.println(sb);
+                first = true;
+                sb.setLength(0);
+            }
+        }
+        if ( sb.length() > 0 ) {
+            out.println(sb);
+        }
+        out.println ( "};" );
+        out.println();
+    }
+
+    private static int getBidiClass ( int ch ) {
+        if ( ch <= 0x00FF ) {
+            return bcL1 [ ch - 0x0000 ];
+        } else if ( ( ch >= 0x0590 ) && ( ch <= 0x06FF ) ) {
+            return bcR1 [ ch - 0x0590 ];
+        } else {
+            return getBidiClass ( ch, bcS1, bcE1, bcC1 );
+        }
+    }
+
+    private static int getBidiClass ( int ch, int[] sa, int[] ea, byte[] ca ) {
+        int k = Arrays.binarySearch ( sa, ch );
+        if ( k >= 0 ) {
+            return ca [ k ];
+        } else {
+            k = - ( k + 1 );
+            if ( k == 0 ) {
+                return BidiConstants.L;
+            } else if ( ch <= ea [ k - 1 ] ) {
+                return ca [ k - 1 ];
+            } else {
+                return BidiConstants.L;
+            }
+        }
+    }
+
+    private static final int[] testData =                       // CSOK: ConstantName
+    {
+        0x000000, BidiConstants.BN,
+        0x000009, BidiConstants.S,
+        0x00000A, BidiConstants.B,
+        0x00000C, BidiConstants.WS,
+        0x000020, BidiConstants.WS,
+        0x000023, BidiConstants.ET,
+        0x000028, BidiConstants.ON,
+        0x00002B, BidiConstants.ES,
+        0x00002C, BidiConstants.CS,
+        0x000031, BidiConstants.EN,
+        0x00003A, BidiConstants.CS,
+        0x000041, BidiConstants.L,
+        0x000300, BidiConstants.NSM,
+        0x000374, BidiConstants.ON,
+        0x0005BE, BidiConstants.R,
+        0x000601, BidiConstants.AN,
+        0x000608, BidiConstants.AL,
+        0x000670, BidiConstants.NSM,
+        0x000710, BidiConstants.AL,
+        0x0007FA, BidiConstants.R,
+        0x000970, BidiConstants.L,
+        0x001392, BidiConstants.ON,
+        0x002000, BidiConstants.WS,
+        0x00200E, BidiConstants.L,
+        0x00200F, BidiConstants.R,
+        0x00202A, BidiConstants.LRE,
+        0x00202B, BidiConstants.RLE,
+        0x00202C, BidiConstants.PDF,
+        0x00202D, BidiConstants.LRO,
+        0x00202E, BidiConstants.RLO,
+        0x0020E1, BidiConstants.NSM,
+        0x002212, BidiConstants.ES,
+        0x002070, BidiConstants.EN,
+        0x003000, BidiConstants.WS,
+        0x003009, BidiConstants.ON,
+        0x00FBD4, BidiConstants.AL,
+        0x00FE69, BidiConstants.ET,
+        0x00FF0C, BidiConstants.CS,
+        0x00FEFF, BidiConstants.BN,
+        0x01034A, BidiConstants.L,
+        0x010E60, BidiConstants.AN,
+        0x01F100, BidiConstants.EN,
+        0x0E0001, BidiConstants.BN,
+        0x0E0100, BidiConstants.NSM,
+        0x10FFFF, BidiConstants.BN
+    };
+
+    private static void test() throws Exception {
+        for ( int i = 0, n = testData.length / 2; i < n; i++ ) {
+            int ch = testData [ i * 2 + 0 ];
+            int tc = testData [ i * 2 + 1 ];
+            int bc = getBidiClass ( ch );
+            if ( bc != tc ) {
+                throw new Exception ( "test mapping failed for character (0x" + Integer.toHexString(ch) + "): expected " + tc + ", got " + bc );
+            }
+        }
+    }
+
+    /**
+     * Main entry point for generator.
+     * @param args array of command line arguments
+     */
+    public static void main(String[] args) {
+        String bidiFileName = "http://www.unicode.org/Public/UNIDATA/extracted/DerivedBidiClass.txt";
+        String outFileName = "BidiClassUtils.java";
+        boolean ok = true;
+        for (int i = 0; i < args.length; i = i + 2) {
+            if (i + 1 == args.length) {
+                ok = false;
+            } else {
+                String opt = args[i];
+                if ("-b".equals(opt)) {
+                    bidiFileName = args [i + 1];
+                } else if ("-o".equals(opt)) {
+                    outFileName = args [i + 1];
+                } else {
+                    ok = false;
+                }
+            }
+        }
+        if (!ok) {
+            System.out.println("Usage: GenerateBidiClassUtils [-b <bidiFile>] [-o <outputFile>]");
+            System.out.println("  defaults:");
+            System.out.println("    <bidiFile>:     " + bidiFileName);
+            System.out.println("    <outputFile>:        " + outFileName);
+        } else {
+            try {
+                convertBidiClassProperties(bidiFileName, outFileName);
+                System.out.println("Generated " + outFileName + " from");
+                System.out.println("  <bidiFile>:     " + bidiFileName);
+            } catch (Exception e) {
+                System.out.println("An unexpected error occured");
+                e.printStackTrace();
+            }
+        }
+    }
+
+    private static class Interval implements Comparable {
+        int start;                                              // CSOK: VisibilityModifier
+        int end;                                                // CSOK: VisibilityModifier
+        int bidiClass;                                          // CSOK: VisibilityModifier
+        Interval ( int start, int end, int bidiClass ) {
+            this.start = start;
+            this.end = end;
+            this.bidiClass = bidiClass;
+        }
+        public int compareTo ( Object o ) {
+            Interval iv = (Interval) o;
+            if ( start < iv.start ) {
+                return -1;
+            } else if ( start > iv.start ) {
+                return 1;
+            } else if ( end < iv.end ) {
+                return -1;
+            } else if ( end > iv.end ) {
+                return 1;
+            } else {
+                return 0;
+            }
+        }
+    }
+}

Propchange: xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/unicode/java/org/apache/fop/text/bidi/GenerateBidiClassUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: xmlgraphics/fop/branches/Temp_ComplexScripts/src/codegen/unicode/java/org/apache/fop/text/bidi/GenerateBidiClassUtils.java
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Area.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Area.java?rev=987282&r1=987281&r2=987282&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Area.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Area.java Thu Aug 19 19:46:41 2010
@@ -38,26 +38,6 @@ import org.apache.fop.traits.BorderProps
  * Base object for all areas.
  */
 public class Area extends AreaTreeObject implements Serializable {
-    // stacking directions
-    /**
-     * Stacking left to right
-     */
-    public static final int LR = 0;
-
-    /**
-     * Stacking right to left
-     */
-    public static final int RL = 1;
-
-    /**
-     * Stacking top to bottom
-     */
-    public static final int TB = 2;
-
-    /**
-     * Stacking bottom to top
-     */
-    public static final int BT = 3;
 
     // orientations for reference areas
     /**
@@ -127,16 +107,20 @@ public class Area extends AreaTreeObject
     protected int bpd;
 
     /**
+     * Resolved bidirectional level for area.
+     */
+    protected int bidiLevel = -1;
+
+    /**
      * Traits for this area stored in a HashMap
      */
-    protected Map props = null;
+    protected Map traits = null;
 
     /**
      * logging instance
      */
     protected static Log log = LogFactory.getLog(Area.class);
 
-
     /**
      * Get the area class of this area.
      *
@@ -223,6 +207,32 @@ public class Area extends AreaTreeObject
     }
 
     /**
+     * Set the bidirectional embedding level.
+     *
+     * @param bidiLevel the bidirectional embedding level
+     */
+    public void setBidiLevel ( int bidiLevel ) {
+        this.bidiLevel = bidiLevel;
+    }
+
+    /**
+     * Reset the bidirectional embedding level to default
+     * value (-1).
+     */
+    public void resetBidiLevel() {
+        setBidiLevel(-1);
+    }
+
+    /**
+     * Get the bidirectional embedding level.
+     *
+     * @return the bidirectional embedding level
+     */
+    public int getBidiLevel() {
+        return bidiLevel;
+    }
+
+    /**
      * Return the sum of region border- and padding-before
      *
      * @return width in millipoints
@@ -376,10 +386,23 @@ public class Area extends AreaTreeObject
      * @param prop the value of the trait
      */
     public void addTrait(Object traitCode, Object prop) {
-        if (props == null) {
-            props = new java.util.HashMap(20);
+        if (traits == null) {
+            traits = new java.util.HashMap(20);
+        }
+        traits.put(traitCode, prop);
+    }
+
+    /**
+     * Set traits on this area, copying from an existing traits map.
+     *
+     * @param traits the map of traits
+     */
+    public void setTraits ( Map traits ) {
+        if ( traits != null ) {
+            this.traits = new java.util.HashMap ( traits );
+        } else {
+            this.traits = null;
         }
-        props.put(traitCode, prop);
     }
 
     /**
@@ -388,12 +411,12 @@ public class Area extends AreaTreeObject
      * @return the map of traits
      */
     public Map getTraits() {
-        return this.props;
+        return this.traits;
     }
 
     /** @return true if the area has traits */
     public boolean hasTraits() {
-        return (this.props != null);
+        return (this.traits != null);
     }
 
     /**
@@ -403,7 +426,7 @@ public class Area extends AreaTreeObject
      * @return the trait value
      */
     public Object getTrait(Object oTraitCode) {
-        return (props != null ? props.get(oTraitCode) : null);
+        return (traits != null ? traits.get(oTraitCode) : null);
     }
 
     /**
@@ -453,4 +476,3 @@ public class Area extends AreaTreeObject
         return sb.toString();
     }
 }
-

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/AreaTreeParser.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/AreaTreeParser.java?rev=987282&r1=987281&r2=987282&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/AreaTreeParser.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/AreaTreeParser.java Thu Aug 19 19:46:41 2010
@@ -742,7 +742,7 @@ public class AreaTreeParser {
             public void startElement(Attributes attributes) {
                 InlineArea inl = new InlineArea();
                 transferForeignObjects(attributes, inl);
-                inl.setOffset(XMLUtil.getAttributeAsInt(attributes, "offset", 0));
+                inl.setBlockProgressionOffset(XMLUtil.getAttributeAsInt(attributes, "offset", 0));
                 setAreaAttributes(attributes, inl);
                 setTraits(attributes, inl, SUBSET_COMMON);
                 setTraits(attributes, inl, SUBSET_BOX);
@@ -762,7 +762,7 @@ public class AreaTreeParser {
             public void startElement(Attributes attributes) {
                 InlineParent ip = new InlineParent();
                 transferForeignObjects(attributes, ip);
-                ip.setOffset(XMLUtil.getAttributeAsInt(attributes, "offset", 0));
+                ip.setBlockProgressionOffset(XMLUtil.getAttributeAsInt(attributes, "offset", 0));
                 setAreaAttributes(attributes, ip);
                 setTraits(attributes, ip, SUBSET_COMMON);
                 setTraits(attributes, ip, SUBSET_BOX);
@@ -784,7 +784,7 @@ public class AreaTreeParser {
             public void startElement(Attributes attributes) {
                 InlineBlockParent ibp = new InlineBlockParent();
                 transferForeignObjects(attributes, ibp);
-                ibp.setOffset(XMLUtil.getAttributeAsInt(attributes, "offset", 0));
+                ibp.setBlockProgressionOffset(XMLUtil.getAttributeAsInt(attributes, "offset", 0));
                 setAreaAttributes(attributes, ibp);
                 setTraits(attributes, ibp, SUBSET_COMMON);
                 setTraits(attributes, ibp, SUBSET_BOX);
@@ -812,7 +812,7 @@ public class AreaTreeParser {
                 setTraits(attributes, text, SUBSET_COLOR);
                 setTraits(attributes, text, SUBSET_FONT);
                 text.setBaselineOffset(XMLUtil.getAttributeAsInt(attributes, "baseline", 0));
-                text.setOffset(XMLUtil.getAttributeAsInt(attributes, "offset", 0));
+                text.setBlockProgressionOffset(XMLUtil.getAttributeAsInt(attributes, "offset", 0));
                 text.setTextLetterSpaceAdjust(XMLUtil.getAttributeAsInt(attributes,
                         "tlsadjust", 0));
                 text.setTextWordSpaceAdjust(XMLUtil.getAttributeAsInt(attributes,
@@ -835,8 +835,10 @@ public class AreaTreeParser {
                 int[] letterAdjust
                         = ConversionUtils.toIntArray(
                             lastAttributes.getValue("letter-adjust"), "\\s");
+                int level = XMLUtil.getAttributeAsInt(lastAttributes, "level", -1);
                 content.flip();
-                WordArea word = new WordArea(content.toString().trim(), offset, letterAdjust);
+                WordArea word = new WordArea
+                    ( offset, level, content.toString().trim(), letterAdjust, null );
                 AbstractTextArea text = getCurrentText();
                 word.setParentArea(text);
                 text.addChildArea(word);
@@ -855,7 +857,8 @@ public class AreaTreeParser {
                 if (content.position() > 0) {
                     content.flip();
                     boolean adjustable = XMLUtil.getAttributeAsBoolean(lastAttributes, "adj", true);
-                    SpaceArea space = new SpaceArea(content.charAt(0), offset, adjustable);
+                    int level = XMLUtil.getAttributeAsInt(lastAttributes, "level", -1);
+                    SpaceArea space = new SpaceArea(offset, level, content.charAt(0), adjustable);
                     AbstractTextArea text = getCurrentText();
                     space.setParentArea(text);
                     text.addChildArea(space);
@@ -865,7 +868,7 @@ public class AreaTreeParser {
                     setTraits(lastAttributes, space, SUBSET_COMMON);
                     setTraits(lastAttributes, space, SUBSET_BOX);
                     setTraits(lastAttributes, space, SUBSET_COLOR);
-                    space.setOffset(offset);
+                    space.setBlockProgressionOffset(offset);
                     Area parent = (Area)areaStack.peek();
                     parent.addChildArea(space);
                 }
@@ -886,7 +889,8 @@ public class AreaTreeParser {
                 setTraits(attributes, leader, SUBSET_BOX);
                 setTraits(attributes, leader, SUBSET_COLOR);
                 setTraits(attributes, leader, SUBSET_FONT);
-                leader.setOffset(XMLUtil.getAttributeAsInt(attributes, "offset", 0));
+                leader.setBlockProgressionOffset
+                    ( XMLUtil.getAttributeAsInt(attributes, "offset", 0) );
                 String ruleStyle = attributes.getValue("ruleStyle");
                 if (ruleStyle != null) {
                     leader.setRuleStyle(ruleStyle);
@@ -909,7 +913,8 @@ public class AreaTreeParser {
                 setTraits(attributes, viewport, SUBSET_COLOR);
                 viewport.setContentPosition(XMLUtil.getAttributeAsRectangle2D(attributes, "pos"));
                 viewport.setClip(XMLUtil.getAttributeAsBoolean(attributes, "clip", false));
-                viewport.setOffset(XMLUtil.getAttributeAsInt(attributes, "offset", 0));
+                viewport.setBlockProgressionOffset
+                    ( XMLUtil.getAttributeAsInt(attributes, "offset", 0) );
                 setPtr(viewport, attributes);
                 Area parent = (Area)areaStack.peek();
                 parent.addChildArea(viewport);
@@ -1071,6 +1076,7 @@ public class AreaTreeParser {
         private void setAreaAttributes(Attributes attributes, Area area) {
             area.setIPD(Integer.parseInt(attributes.getValue("ipd")));
             area.setBPD(Integer.parseInt(attributes.getValue("bpd")));
+            area.setBidiLevel(XMLUtil.getAttributeAsInt(attributes, "level", -1));
         }
 
         private static final Object[] SUBSET_COMMON = new Object[] {

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Block.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Block.java?rev=987282&r1=987281&r2=987282&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Block.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Block.java Thu Aug 19 19:46:41 2010
@@ -55,7 +55,6 @@ public class Block extends BlockParent {
      */
     public static final int FIXED = 3;
 
-    private int stacking = TB;
     private int positioning = STACK;
 
     /** if true, allow BPD update */

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/CTM.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/CTM.java?rev=987282&r1=987281&r2=987282&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/CTM.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/CTM.java Thu Aug 19 19:46:41 2010
@@ -26,6 +26,7 @@ import java.io.Serializable;
 
 import org.apache.fop.datatypes.FODimension;
 import org.apache.fop.fo.Constants;
+import org.apache.fop.traits.WritingMode;
 
 /**
  * Describe a PDF or PostScript style coordinate transformation matrix (CTM).
@@ -121,16 +122,16 @@ public class CTM implements Serializable
      * Return a CTM which will transform coordinates for a particular writing-mode
      * into normalized first quandrant coordinates.
      * @param wm A writing mode constant from fo.properties.WritingMode, ie.
-     * one of LR_TB, RL_TB, TB_RL.
+     * one of LR_TB, RL_TB, TB_RL, TB_LR.
      * @param ipd The inline-progression dimension of the reference area whose
      * CTM is being set..
      * @param bpd The block-progression dimension of the reference area whose
      * CTM is being set.
      * @return a new CTM with the required transform
      */
-    public static CTM getWMctm(int wm, int ipd, int bpd) {
+    public static CTM getWMctm(WritingMode wm, int ipd, int bpd) {
         CTM wmctm;
-        switch (wm) {
+        switch (wm.getEnumValue()) {
             case Constants.EN_LR_TB:
                 return new CTM(CTM_LRTB);
             case Constants.EN_RL_TB:
@@ -139,6 +140,7 @@ public class CTM implements Serializable
                 return wmctm;
                 //return  CTM_RLTB.translate(ipd, 0);
             case Constants.EN_TB_RL:  // CJK
+            case Constants.EN_TB_LR:  // CJK
                 wmctm = new CTM(CTM_TBRL);
                 wmctm.e = bpd;
                 return wmctm;
@@ -279,7 +281,7 @@ public class CTM implements Serializable
      * @return CTM the coordinate transformation matrix (CTM)
      */
     public static CTM getCTMandRelDims(int absRefOrient,
-                                       int writingMode,
+                                       WritingMode writingMode,
                                        Rectangle2D absVPrect,
                                        FODimension reldims) {
         int width, height;
@@ -330,12 +332,18 @@ public class CTM implements Serializable
          * can set ipd and bpd appropriately based on the writing mode.
          */
 
-        if (writingMode == Constants.EN_LR_TB || writingMode == Constants.EN_RL_TB) {
+        switch ( writingMode.getEnumValue() ) {
+        default:
+        case Constants.EN_LR_TB:
+        case Constants.EN_RL_TB:
             reldims.ipd = width;
             reldims.bpd = height;
-        } else {
+            break;
+        case Constants.EN_TB_LR:
+        case Constants.EN_TB_RL:
             reldims.ipd = height;
             reldims.bpd = width;
+            break;
         }
         // Set a rectangle to be the writing-mode relative version???
         // Now transform for writing mode

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/LineArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/LineArea.java?rev=987282&r1=987281&r2=987282&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/LineArea.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/LineArea.java Thu Aug 19 19:46:41 2010
@@ -106,6 +106,15 @@ public class LineArea extends Area {
     }
 
     /**
+     * <p>Set (en masse) the inline child areas of this line area.</p>
+     * <p> Used by bidirectional processing after line area consituent reordering.</p>
+     * @param inlineAreas the list of inline areas
+     */
+    public void setInlineAreas ( List inlineAreas ) {
+        this.inlineAreas = inlineAreas;
+    }
+
+    /**
      * Get the inline child areas of this line area.
      *
      * @return the list of inline areas
@@ -179,7 +188,7 @@ public class LineArea extends Area {
                 // if the LineArea has already been added to the area tree,
                 // call finalize(); otherwise, wait for the LineLM to call it
                 if (adjustingInfo.bAddedToAreaTree) {
-                    finalise();
+                    finish();
                 }
                 break;
             default:
@@ -192,7 +201,7 @@ public class LineArea extends Area {
      * and destroy the AdjustingInfo object if there are
      * no UnresolvedAreas left
      */
-    public void finalise() {
+    public void finish() {
         if (adjustingInfo.lineAlignment == Constants.EN_JUSTIFY) {
             // justified line: apply the variation factor
             boolean bUnresolvedAreasPresent = false;

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/RegionViewport.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/RegionViewport.java?rev=987282&r1=987281&r2=987282&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/RegionViewport.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/RegionViewport.java Thu Aug 19 19:46:41 2010
@@ -93,7 +93,7 @@ public class RegionViewport extends Area
         out.writeFloat((float) viewArea.getWidth());
         out.writeFloat((float) viewArea.getHeight());
         out.writeBoolean(clip);
-        out.writeObject(props);
+        out.writeObject(traits);
         out.writeObject(regionReference);
     }
 
@@ -102,7 +102,7 @@ public class RegionViewport extends Area
         viewArea = new Rectangle2D.Float(in.readFloat(), in.readFloat(),
                                          in.readFloat(), in.readFloat());
         clip = in.readBoolean();
-        props = (HashMap)in.readObject();
+        traits = (HashMap)in.readObject();
         setRegionReference((RegionReference) in.readObject());
     }
 
@@ -115,8 +115,8 @@ public class RegionViewport extends Area
     public Object clone() {
         RegionViewport rv = new RegionViewport((Rectangle2D)viewArea.clone());
         rv.regionReference = (RegionReference)regionReference.clone();
-        if (props != null) {
-            rv.props = new HashMap(props);
+        if (traits != null) {
+            rv.traits = new HashMap(traits);
         }
         if (foreignAttributes != null) {
             rv.foreignAttributes = new HashMap(foreignAttributes);

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Trait.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Trait.java?rev=987282&r1=987281&r2=987282&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Trait.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/Trait.java Thu Aug 19 19:46:41 2010
@@ -27,6 +27,8 @@ import org.apache.xmlgraphics.image.load
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fonts.FontTriplet;
 import org.apache.fop.traits.BorderProps;
+import org.apache.fop.traits.Direction;
+import org.apache.fop.traits.WritingMode;
 import org.apache.fop.util.ColorUtil;
 
 // properties should be serialized by the holder
@@ -201,8 +203,17 @@ public final class Trait implements Seri
     /** The ptr trait. Used for accessibility   */
     public static final Integer PTR = new Integer(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];
 
@@ -284,6 +295,14 @@ public final class Trait implements Seri
                 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));
 
     }
 

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/FilledArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/FilledArea.java?rev=987282&r1=987281&r2=987282&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/FilledArea.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/FilledArea.java Thu Aug 19 19:46:41 2010
@@ -49,7 +49,7 @@ public class FilledArea extends InlinePa
      * @param v the offset
      */
     /*
-    public void setOffset(int v) {
+    public void setBlockProgressionOffset(int v) {
         setChildOffset(inlines.listIterator(), v);
     }
     */
@@ -62,7 +62,7 @@ public class FilledArea extends InlinePa
             } else if (child instanceof org.apache.fop.area.inline.Viewport) {
                 // nothing
             } else {
-                child.setOffset(v);
+                child.setBlockProgressionOffset(v);
             }
         }
     }

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/InlineArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/InlineArea.java?rev=987282&r1=987281&r2=987282&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/InlineArea.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/InlineArea.java Thu Aug 19 19:46:41 2010
@@ -74,7 +74,7 @@ public class InlineArea extends Area {
     /**
      * offset position from before edge of parent area
      */
-    protected int offset = 0;
+    protected int blockProgressionOffset = 0;
 
     /**
      * parent area
@@ -96,6 +96,23 @@ public class InlineArea extends Area {
     protected InlineAdjustingInfo adjustingInfo = null;
 
     /**
+     * Default constructor for inline area.
+     */
+    public InlineArea() {
+        this (  0, -1 );
+    }
+
+    /**
+     * Instantiate inline area.
+     * @param blockProgressionOffset a block progression offset or zero
+     * @param bidiLevel a resolved bidi level or -1
+     */
+    protected InlineArea ( int blockProgressionOffset, int bidiLevel ) {
+        this.blockProgressionOffset = blockProgressionOffset;
+        setBidiLevel(bidiLevel);
+    }
+
+    /**
      * @return the adjustment information object
      */
     public InlineAdjustingInfo getAdjustingInfo() {
@@ -133,25 +150,25 @@ public class InlineArea extends Area {
     }
 
     /**
-     * Set the offset of this inline area.
+     * Set the block progression offset of this inline area.
      * This is used to set the offset of the inline area
      * which is relative to the before edge of the parent area.
      *
-     * @param offset the offset
+     * @param blockProgressionOffset the offset
      */
-    public void setOffset(int offset) {
-        this.offset = offset;
+    public void setBlockProgressionOffset(int blockProgressionOffset) {
+        this.blockProgressionOffset = blockProgressionOffset;
     }
 
     /**
-     * Get the offset of this inline area.
+     * Get the block progression offset of this inline area.
      * This returns the offset of the inline area
-     * which is relative to the before edge of the parent area.
+     * relative to the before edge of the parent area.
      *
-     * @return the offset
+     * @return the blockProgressionOffset
      */
-    public int getOffset() {
-        return offset;
+    public int getBlockProgressionOffset() {
+        return blockProgressionOffset;
     }
 
     /**
@@ -243,4 +260,3 @@ public class InlineArea extends Area {
         }
     }
 }
-

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/InlineParent.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/InlineParent.java?rev=987282&r1=987281&r2=987282&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/InlineParent.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/InlineParent.java Thu Aug 19 19:46:41 2010
@@ -21,8 +21,9 @@ package org.apache.fop.area.inline;
 
 import org.apache.fop.area.Area;
 
-import java.util.List;
 import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
 
 /**
  * Inline parent area.
@@ -60,6 +61,7 @@ public class InlineParent extends Inline
             if (autoSize) {
                 increaseIPD(inlineChildArea.getAllocIPD());
             }
+            updateLevel ( childArea.getBidiLevel() );
         }
     }
 
@@ -89,5 +91,28 @@ public class InlineParent extends Inline
         }
         return bUnresolvedAreasPresent;
     }
-}
 
+    /**
+     * 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 );
+            }
+        }
+    }
+
+
+}

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/SpaceArea.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/SpaceArea.java?rev=987282&r1=987281&r2=987282&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/SpaceArea.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/area/inline/SpaceArea.java Thu Aug 19 19:46:41 2010
@@ -36,25 +36,27 @@ public class SpaceArea extends InlineAre
 
     /**
      * 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 = new String() + 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.isAdjustable = adjustable;
     }
 
     /**
      * @return Returns the space.
      */
     public String getSpace() {
-        return new String(space);
+        return space;
     }
 
     /** @return true if the space is adjustable (WRT word-space processing) */
     public boolean isAdjustable() {
         return this.isAdjustable;
     }
+
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org