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 2011/09/29 11:49:27 UTC

svn commit: r1177244 [1/3] - in /xmlgraphics/fop/branches/Temp_ComplexScripts: ./ src/documentation/ src/documentation/content/ src/documentation/content/xdocs/ src/documentation/content/xdocs/trunk/ src/java/org/apache/fop/accessibility/ src/java/org/...

Author: spepping
Date: Thu Sep 29 09:49:24 2011
New Revision: 1177244

URL: http://svn.apache.org/viewvc?rev=1177244&view=rev
Log:
Merged /xmlgraphics/fop/trunk:r1149494-1177230

Added:
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/favicon.ico
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/src/documentation/content/xdocs/favicon.ico
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharactersetEncoder.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/fonts/CharactersetEncoder.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/truetype/GlyfTable.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/truetype/GlyfTable.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/FileIDGenerator.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/src/java/org/apache/fop/pdf/FileIDGenerator.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/AFPResourceUtilTestCase.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/afp/AFPResourceUtilTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/AFPTestSuite.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/afp/AFPTestSuite.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/expected_named_resource.afp
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/afp/expected_named_resource.afp
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/expected_resource.afp
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/afp/expected_resource.afp
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/fonts/
      - copied from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/afp/fonts/
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/fonts/CharactersetEncoderTest.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/afp/fonts/CharactersetEncoderTest.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/
      - copied from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/afp/modca/
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractAFPObjectTestCase.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/afp/modca/AbstractAFPObjectTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractNamedAFPObjectTestCase.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/afp/modca/AbstractNamedAFPObjectTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractStructuredObjectTestCase.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/afp/modca/AbstractStructuredObjectTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/AbstractTripletStructuredObjectTestCase.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/afp/modca/AbstractTripletStructuredObjectTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/afp/modca/IncludeObjectTestCase.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/afp/modca/IncludeObjectTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/fonts/truetype/
      - copied from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/fonts/truetype/
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/fonts/truetype/GlyfTableTestCase.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/fonts/truetype/GlyfTableTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/pdf/FileIDGeneratorTestCase.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/FileIDGeneratorTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/pdf/PDFEncryptionJCETestCase.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFEncryptionJCETestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/pdf/PDFFactoryTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/render/pdf/PDFRendererConfiguratorTestCase.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/PDFRendererConfiguratorTestCase.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/render/pdf/RenderPDFTestSuite.java
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/java/org/apache/fop/render/pdf/RenderPDFTestSuite.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/resources/org/
      - copied from r1177230, xmlgraphics/fop/trunk/test/resources/org/
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/resources/org/apache/
      - copied from r1177230, xmlgraphics/fop/trunk/test/resources/org/apache/
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/resources/org/apache/fop/
      - copied from r1177230, xmlgraphics/fop/trunk/test/resources/org/apache/fop/
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/resources/org/apache/fop/render/
      - copied from r1177230, xmlgraphics/fop/trunk/test/resources/org/apache/fop/render/
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/resources/org/apache/fop/render/pdf/
      - copied from r1177230, xmlgraphics/fop/trunk/test/resources/org/apache/fop/render/pdf/
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/resources/org/apache/fop/render/pdf/above128.xconf
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/resources/org/apache/fop/render/pdf/above128.xconf
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/resources/org/apache/fop/render/pdf/below40.xconf
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/resources/org/apache/fop/render/pdf/below40.xconf
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/resources/org/apache/fop/render/pdf/correct.xconf
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/resources/org/apache/fop/render/pdf/correct.xconf
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/resources/org/apache/fop/render/pdf/roundDown.xconf
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/resources/org/apache/fop/render/pdf/roundDown.xconf
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/resources/org/apache/fop/render/pdf/roundUp.xconf
      - copied unchanged from r1177230, xmlgraphics/fop/trunk/test/resources/org/apache/fop/render/pdf/roundUp.xconf
Removed:
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/favicon.ico
Modified:
    xmlgraphics/fop/branches/Temp_ComplexScripts/   (props changed)
    xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/compliance.ihtml
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/configuration.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/output.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/pdfencryption.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/running.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/skinconf.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/accessibility/StructureTreeBuilder.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/AFPDataObjectFactory.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/apps/   (props changed)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/AFPBase12FontCollection.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSet.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/FopCharacterSet.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractNamedAFPObject.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractTripletStructuredObject.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/IncludeObject.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/TagLogicalElement.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/parser/   (props changed)
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/TextDataInfoProducer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/util/AFPResourceUtil.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/cli/CommandLineOptions.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/FontDescriptor.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/SingleByteFont.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.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/PDFEncryption.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFEncryptionJCE.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFEncryptionManager.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFEncryptionParams.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFFactory.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/pdf/PDFObject.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/bitmap/BitmapRendererConfigurator.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.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/java2d/Java2DUtil.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pdf/PDFConfigurationConstants.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pdf/PDFEventProducer.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pdf/PDFEventProducer.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/pdf/PDFRenderingUtil.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/ps/PSImageHandlerGraphics2D.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/render/rtf/RTFHandler.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/util/ColorExt.java   (props changed)
    xmlgraphics/fop/branches/Temp_ComplexScripts/status.xml
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/StandardTestSuite.java
    xmlgraphics/fop/branches/Temp_ComplexScripts/test/java/org/apache/fop/UtilityCodeTestSuite.java

Propchange: xmlgraphics/fop/branches/Temp_ComplexScripts/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 29 09:49:24 2011
@@ -2,4 +2,4 @@
 /xmlgraphics/fop/branches/Temp_Color:956535-1069429
 /xmlgraphics/fop/branches/fop-0_95:684572,688085,688696
 /xmlgraphics/fop/branches/fop-1_0:959975-964707
-/xmlgraphics/fop/trunk:981451-1149493
+/xmlgraphics/fop/trunk:981451-1177230

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/build.xml Thu Sep 29 09:49:24 2011
@@ -749,6 +749,7 @@ list of possible build targets.
         <include name="**/*.xml"/>
         <include name="**/*.fo"/>
         <include name="**/BidiTestData*.ser"/>
+        <include name="**/*.afp"/>
       </fileset>
       <fileset dir="${build.dir}/test-gensrc">
         <include name="**/*.xml"/>
@@ -991,7 +992,13 @@ list of possible build targets.
       <test name="org.apache.fop.text.linebreak.LineBreakStatusTest" todir="${junit.reports.dir}"/>
     </junit>
   </target>
-  <target name="junit-reduced" depends="junit-userconfig, junit-basic, junit-transcoder, junit-text-linebreak, junit-fotree, junit-complexscripts"/>
+  <target name="junit-render-pdf" depends="junit-compile">
+    <echo message="Running tests for the render pdf package"/>
+    <junit-run title="render-pdf" testsuite="org.apache.fop.render.pdf.RenderPDFTestSuite" 
+      outfile="TEST-render-pdf"/>
+  </target>
+  <target name="junit-reduced" depends="junit-userconfig, junit-basic, junit-transcoder, 
+    junit-text-linebreak, junit-fotree, junit-render-pdf, junit-complexscripts"/>
   <target name="junit-full" depends="junit-reduced, junit-layout, junit-area-tree-xml-format, junit-intermediate-format"/>
   <target name="junit" depends="junit-full" description="Runs all of FOP's JUnit tests" if="junit.present">
     <fail><condition><or><isset property="fop.junit.error"/><isset property="fop.junit.failure"/><not><isset property="hyphenation.present"/></not></or></condition>

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/compliance.ihtml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/compliance.ihtml?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/compliance.ihtml (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/compliance.ihtml Thu Sep 29 09:49:24 2011
@@ -3669,10 +3669,10 @@
       "http://www.w3.org/TR/xsl/#format">&sect;7.26.1</a></td>
       <td><a name="fo-property-format" id="fo-property-format">format</a></td>
       <td class="basic">Basic</td>
-      <td class="yes">yes</td>
-      <td class="yes">yes</td>
-      <td class="yes">yes</td>
-      <td>&nbsp;</td>
+      <td class="partial">partial</td>
+      <td class="partial">partial</td>
+      <td class="partial">partial</td>
+      <td>only values '0*1', 'a', 'A', 'i', 'I' supported</td>
     </tr>
     <tr>
       <td align="center"><a href=

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/configuration.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/configuration.xml?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/configuration.xml (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/configuration.xml Thu Sep 29 09:49:24 2011
@@ -367,12 +367,17 @@
       <source><![CDATA[
     <renderer mime="application/pdf">
       <encryption-params>
+         <encryption-length>128</encryption-length>
          <user-password>testuserpass</user-password>
          <owner-password>testownerpass</owner-password>
          <noprint/>
          <nocopy/>
          <noedit/>
          <noannotations/>
+         <nofillinforms/>
+         <noaccesscontent/>
+         <noassembledoc/>
+         <noprinthq/>
       </encryption-params>
     </renderer>]]></source>
       

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/output.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/output.xml?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/output.xml (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/output.xml Thu Sep 29 09:49:24 2011
@@ -743,6 +743,12 @@ Note that the value of the encoding attr
           <a href="fonts.html#embedding"><code>referenced-fonts</code> section of the configuration file</a>.
           However, the default fonts shown above will not be embedded.
         </p>
+        <p>
+          For double byte EBCDIC encoded character sets, there is an optional tag that must be set to prevent
+          characters from being miscoded. This defaults to "false" if not specified.</p>
+          <source><![CDATA[
+        <afp-font type="CIDKeyed" codepage="T10835  " encoding="Cp937" characterset="CZTKAI" ebcdic-dbcs="true"/>]]>
+          </source>
       </section>
       <section id="afp-renderer-resolution-config">
         <title>Output Resolution</title>

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/pdfencryption.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/pdfencryption.xml?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/pdfencryption.xml (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/pdfencryption.xml Thu Sep 29 09:49:24 2011
@@ -69,10 +69,45 @@
         supplied, viewing the content is not restricted.
       </p>
       <p>
-        Further restrictions can be imposed by using the <code>-noprint</code>,
-        <code>-nocopy</code>, <code>-noedit</code> and
-        <code>-noannotations</code> options, which disable printing, copying
-        text, editing in Adobe Acrobat and making annotations, respectively.
+        Further restrictions can be imposed by using the following command-line options:
+        <table>
+          <tr>
+            <th>Option</th>
+            <th>Description</th>
+          </tr>
+          <tr>
+            <td><code>-noprint</code></td>
+            <td>disable printing</td>
+          </tr>
+          <tr>
+            <td><code>-nocopy</code></td>
+            <td>disable copy/paste of content</td>
+          </tr>
+          <tr>
+            <td><code>-noedit</code></td>
+            <td>disable editing in Adobe Acrobat</td>
+          </tr>
+          <tr>
+            <td><code>-noannotations</code></td>
+            <td>disable editing of annotations</td>
+          </tr>
+          <tr>
+            <td><code>-nofillinforms</code></td>
+            <td>disable filling in forms</td>
+          </tr>
+          <tr>
+            <td><code>-noaccesscontent</code></td>
+            <td>disable text and graphics extraction for accessibility purposes</td>
+          </tr>
+          <tr>
+            <td><code>-noassembledoc</code></td>
+            <td>disable assembling documents</td>
+          </tr>
+          <tr>
+            <td><code>-noprinthq</code></td>
+            <td>disable high quality printing</td>
+          </tr>
+        </table>
       </p>
     </section>
     <section>
@@ -89,6 +124,12 @@
           <th>Default</th>
         </tr>
         <tr>
+          <td>encryption-length</td>
+          <td>The encryption length in bit</td>
+          <td>Any multiple of 8 between 40 and 128</td>
+          <td>40</td>
+        </tr>
+        <tr>
           <td>ownerPassword</td>
           <td>The owner password</td>
           <td>String</td>
@@ -114,7 +155,7 @@
         </tr>
         <tr>
           <td>allowEditContent</td>
-          <td>Allows/disallows editing of content</td>
+          <td>Allows/disallows editing in Adobe Acrobat</td>
           <td>"TRUE" or "FALSE"</td>
           <td>"TRUE"</td>
         </tr>
@@ -124,6 +165,30 @@
           <td>"TRUE" or "FALSE"</td>
           <td>"TRUE"</td>
         </tr>
+        <tr>
+          <td>allowFillInForms</td>
+          <td>Allows/disallows filling in forms</td>
+          <td>"TRUE" or "FALSE"</td>
+          <td>"TRUE"</td>
+        </tr>
+        <tr>
+          <td>allowAccessContent</td>
+          <td>Allows/disallows text and graphics extraction for accessibility purposes</td>
+          <td>"TRUE" or "FALSE"</td>
+          <td>"TRUE"</td>
+        </tr>
+        <tr>
+          <td>allowAssembleDocument</td>
+          <td>Allows/disallows assembling document</td>
+          <td>"TRUE" or "FALSE"</td>
+          <td>"TRUE"</td>
+        </tr>
+        <tr>
+          <td>allowPrintHq</td>
+          <td>Allows/disallows high quality printing</td>
+          <td>"TRUE" or "FALSE"</td>
+          <td>"TRUE"</td>
+        </tr>
       </table>
       <note>
         Encryption is enabled as soon as one of these options is set.
@@ -151,6 +216,10 @@ Fop fop = fopFactory.newFop(MimeConstant
         <li>allowCopyContent: true if copying content is allowed</li>
         <li>allowEditContent: true if editing content is allowed</li>
         <li>allowEditAnnotations: true if editing annotations is allowed</li>
+        <li>allowFillInForms: true if filling in forms is allowed.</li>
+        <li>allowAccessContent: true if extracting text and graphics is allowed</li>
+        <li>allowAssembleDocument: true if assembling document is allowed</li>
+        <li>allowPrintHq: true if printing to high quality is allowed</li>
       </ol>
       <p>
         Alternatively, you can set each value separately in the Map provided by 
@@ -163,6 +232,10 @@ Fop fop = fopFactory.newFop(MimeConstant
         <li>nocopy: Boolean or "true"/"false"</li>
         <li>noedit: Boolean or "true"/"false"</li>
         <li>noannotations: Boolean or "true"/"false"</li>
+        <li>nofillinforms: Boolean or "true"/"false"</li>
+        <li>noaccesscontent: Boolean or "true"/"false"</li>
+        <li>noassembledoc: Boolean or "true"/"false"</li>
+        <li>noprinthq: Boolean or "true"/"false"</li>
       </ol>
     </section>
     <section>

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/running.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/running.xml?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/running.xml (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/content/xdocs/trunk/running.xml Thu Sep 29 09:49:24 2011
@@ -128,6 +128,10 @@ Fop [options] [-fo|-xml] infile [-xsl fi
   -nocopy           PDF file will be encrypted without copy content permission
   -noedit           PDF file will be encrypted without edit content permission
   -noannotations    PDF file will be encrypted without edit annotation permission
+  -nofillinforms    PDF file will be encrypted without fill in forms permission
+  -noaccesscontent  PDF file will be encrypted without extract text and graphics permission
+  -noassembledoc    PDF file will be encrypted without assemble the document permission
+  -noprinthq        PDF file will be encrypted without print high quality permission
   -a                enables accessibility features (Tagged PDF etc., default off)
   -pdfprofile prof  PDF file will be generated with the specified profile
                     (Examples for prof: PDF/A-1b or PDF/X-3:2003)

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/skinconf.xml
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/skinconf.xml?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/skinconf.xml (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/documentation/skinconf.xml Thu Sep 29 09:49:24 2011
@@ -94,7 +94,7 @@ See main/fresh-site/src/documentation/sk
   <copyright-link>http://www.apache.org/licenses/</copyright-link>
 <!-- Optional text trademark statement below the copyright statement -->
   <trademark-statement>
-    Apache, Apache Forrest, the Apache feather logo, and the Apache Forrest
+    Apache, Apache FOP, the Apache feather logo, and the Apache FOP
     logos are trademarks of The Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their respective owners.
   </trademark-statement>
 <!-- Some skins use this to form a 'breadcrumb trail' of links.
@@ -109,6 +109,7 @@ See main/fresh-site/src/documentation/sk
   <trail location="alt">
     <link1 name="The Apache Software Foundation" href="http://www.apache.org/"/>
     <link2 name="Apache XML Graphics Project" href="http://xmlgraphics.apache.org/"/>
+    <link3 name="" href=""/>
   </trail>
 <!-- Configure the TOC, i.e. the Table of Contents.
   @max-depth

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/accessibility/StructureTreeBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/accessibility/StructureTreeBuilder.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/accessibility/StructureTreeBuilder.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/accessibility/StructureTreeBuilder.java Thu Sep 29 09:49:24 2011
@@ -31,7 +31,7 @@ import org.apache.fop.util.DelegatingCon
 
 /**
  * Helper class that re-builds a structure tree from what is stored in an
- * intermediate XML file (IF XML or Area Tree XML).
+ * intermediate XML file (IF XML or Area Tree XML).
  */
 public final class StructureTreeBuilder {
 

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/AFPDataObjectFactory.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/AFPDataObjectFactory.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/AFPDataObjectFactory.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/AFPDataObjectFactory.java Thu Sep 29 09:49:24 2011
@@ -124,8 +124,10 @@ public class AFPDataObjectFactory {
             break;
         case 4:
         case 8:
+            //A grayscale image
             ideStruct = content.needIDEStructureParameter();
             ideStruct.setBitsPerComponent(new int[] {bitsPerPixel});
+            ideStruct.setColorModel(IDEStructureParameter.COLOR_MODEL_YCBCR);
             break;
         case 24:
             ideStruct = content.needIDEStructureParameter();
@@ -139,7 +141,7 @@ public class AFPDataObjectFactory {
             throw new IllegalArgumentException("Unsupported number of bits per pixel: "
                     + bitsPerPixel);
         }
-        if (imageObjectInfo.isSubtractive()) {
+        if (bitsPerPixel > 1 && imageObjectInfo.isSubtractive()) {
             ideStruct = content.needIDEStructureParameter();
             ideStruct.setSubtractive(imageObjectInfo.isSubtractive());
         }

Propchange: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/apps/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 29 09:49:24 2011
@@ -3,4 +3,4 @@
 /xmlgraphics/fop/branches/Temp_Color/src/java/org/apache/fop/afp/apps:956535-1069429
 /xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/afp/apps:684572,688085,688696
 /xmlgraphics/fop/branches/fop-1_0/src/java/org/apache/fop/afp/apps:959975-964707
-/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/apps:959946-1149493
+/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/apps:959946-1177230

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/AFPBase12FontCollection.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/AFPBase12FontCollection.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/AFPBase12FontCollection.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/AFPBase12FontCollection.java Thu Sep 29 09:49:24 2011
@@ -108,22 +108,22 @@ public class AFPBase12FontCollection imp
                 "Times New Roman", "TimesNewRoman", "serif", "any"};
 
         font = createReferencedRasterFont("Times Roman");
-        addCharacterSet(font, "CON200", new TimesRoman());
+        addCharacterSet(font, "C0N200", new TimesRoman());
         num = addFontProperties(fontInfo, font, timesNames,
                 Font.STYLE_NORMAL, Font.WEIGHT_NORMAL, num);
 
         font = createReferencedRasterFont("Times Roman Italic");
-        addCharacterSet(font, "CON300", new TimesItalic());
+        addCharacterSet(font, "C0N300", new TimesItalic());
         num = addFontProperties(fontInfo, font, timesNames,
                 Font.STYLE_ITALIC, Font.WEIGHT_NORMAL, num);
 
         font = createReferencedRasterFont("Times Roman Bold");
-        addCharacterSet(font, "CON400", new TimesBold());
+        addCharacterSet(font, "C0N400", new TimesBold());
         num = addFontProperties(fontInfo, font, timesNames,
                 Font.STYLE_NORMAL, Font.WEIGHT_BOLD, num);
 
         font = createReferencedRasterFont("Times Roman Italic Bold");
-        addCharacterSet(font, "CON500", new TimesBoldItalic());
+        addCharacterSet(font, "C0N500", new TimesBoldItalic());
         num = addFontProperties(fontInfo, font, timesNames,
                 Font.STYLE_ITALIC, Font.WEIGHT_BOLD, num);
 

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSet.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSet.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSet.java Thu Sep 29 09:49:24 2011
@@ -21,19 +21,13 @@ package org.apache.fop.afp.fonts;
 
 import java.io.File;
 import java.io.UnsupportedEncodingException;
-import java.nio.ByteBuffer;
-import java.nio.CharBuffer;
 import java.nio.charset.CharacterCodingException;
-import java.nio.charset.Charset;
-import java.nio.charset.CharsetEncoder;
-import java.nio.charset.CodingErrorAction;
-import java.nio.charset.UnsupportedCharsetException;
 import java.util.Map;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
 import org.apache.fop.afp.AFPConstants;
+import org.apache.fop.afp.fonts.CharactersetEncoder.EncodedChars;
 import org.apache.fop.afp.util.ResourceAccessor;
 import org.apache.fop.afp.util.SimpleResourceAccessor;
 import org.apache.fop.afp.util.StringUtils;
@@ -70,16 +64,16 @@ public class CharacterSet {
 
 
     /** The code page to which the character set relates */
-    protected String codePage;
+    protected final String codePage;
 
     /** The encoding used for the code page */
-    protected String encoding;
+    protected final String encoding;
 
-    /** The charset encoder corresponding to this encoding */
-    private CharsetEncoder encoder;
+    /** The characterset encoder corresponding to this encoding */
+    private final CharactersetEncoder encoder;
 
     /** The character set relating to the font */
-    protected String name;
+    protected final String name;
 
     /** The path to the installed fonts */
     private ResourceAccessor accessor;
@@ -105,20 +99,22 @@ public class CharacterSet {
      * {@link #CharacterSet(String, String, String, ResourceAccessor)} instead.
      */
     public CharacterSet(String codePage, String encoding, String name, String path) {
-        this(codePage, encoding, name,
+        this(codePage, encoding, false, name,
                 new SimpleResourceAccessor(path != null ? new File(path) : null));
     }
 
     /**
-     * Constructor for the CharacterSetMetric object, the character set is used
-     * to load the font information from the actual AFP font.
+     * Constructor for the CharacterSetMetric object, the character set is used to load the font
+     * information from the actual AFP font.
      *
      * @param codePage the code page identifier
      * @param encoding the encoding of the font
+     * @param isEBDCS if this is an EBCDIC double byte character set.
      * @param name the character set name
      * @param accessor the resource accessor to load resource with
      */
-     CharacterSet(String codePage, String encoding, String name, ResourceAccessor accessor) {
+    CharacterSet(String codePage, String encoding, boolean isEBDCS, String name,
+            ResourceAccessor accessor) {
         if (name.length() > MAX_NAME_LEN) {
             String msg = "Character set name '" + name + "' must be a maximum of "
                 + MAX_NAME_LEN + " characters";
@@ -133,14 +129,7 @@ public class CharacterSet {
         }
         this.codePage = codePage;
         this.encoding = encoding;
-        try {
-            this.encoder = Charset.forName(encoding).newEncoder();
-            this.encoder.onUnmappableCharacter(CodingErrorAction.REPLACE);
-        } catch (UnsupportedCharsetException uce) {
-            //No nio-capable encoder available
-            //This may happen with "Cp500" on Sun Java 1.4.2
-            this.encoder = null;
-        }
+        this.encoder = CharactersetEncoder.newInstance(encoding, isEBDCS);
         this.accessor = accessor;
 
         this.characterSetOrientations = new java.util.HashMap(4);
@@ -357,32 +346,8 @@ public class CharacterSet {
      * @return the encoded characters
      * @throws CharacterCodingException if the encoding operation fails
      */
-    public byte[] encodeChars(CharSequence chars) throws CharacterCodingException {
-        if (encoder != null) {
-            ByteBuffer bb;
-            // encode method is not thread safe
-            synchronized (encoder) {
-                bb = encoder.encode(CharBuffer.wrap(chars));
-            }
-            if (bb.hasArray()) {
-                return bb.array();
-            } else {
-                bb.rewind();
-                byte[] bytes = new byte[bb.remaining()];
-                bb.get(bytes);
-                return bytes;
-            }
-        } else {
-            //Sun Java 1.4.2 compatibility
-            byte[] bytes;
-            try {
-                bytes = chars.toString().getBytes(this.encoding);
-                return bytes;
-            } catch (UnsupportedEncodingException uee) {
-                throw new UnsupportedOperationException(
-                        "Unsupported encoding: " + uee.getMessage());
-            }
-        }
+    public EncodedChars encodeChars(CharSequence chars) throws CharacterCodingException {
+        return encoder.encode(chars);
     }
 
     /**

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSetBuilder.java Thu Sep 29 09:49:24 2011
@@ -30,13 +30,11 @@ import java.util.WeakHashMap;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import org.apache.xmlgraphics.image.loader.util.SoftMapCache;
-
 import org.apache.fop.afp.AFPConstants;
 import org.apache.fop.afp.util.ResourceAccessor;
 import org.apache.fop.afp.util.StructuredFieldReader;
 import org.apache.fop.fonts.Typeface;
+import org.apache.xmlgraphics.image.loader.util.SoftMapCache;
 
 /**
  * The CharacterSetBuilder is responsible building the a CharacterSet instance that holds
@@ -181,9 +179,9 @@ public class CharacterSetBuilder {
     }
 
     /**
-     * Load the font details and metrics into the CharacterSetMetric object,
-     * this will use the actual afp code page and character set files to load
-     * the object with the necessary metrics.
+     * Load the font details and metrics into the CharacterSetMetric object, this will use the
+     * actual afp code page and character set files to load the object with the necessary metrics.
+     * 
      * @param characterSetName name of the characterset
      * @param codePageName name of the code page file
      * @param encoding encoding name
@@ -191,9 +189,47 @@ public class CharacterSetBuilder {
      * @return CharacterSet object
      * @throws IOException if an I/O error occurs
      */
-    public CharacterSet build(String characterSetName, String codePageName,
-            String encoding, ResourceAccessor accessor) throws IOException {
+    public CharacterSet build(String characterSetName, String codePageName, String encoding,
+            ResourceAccessor accessor) throws IOException {
+        return processFont(characterSetName, codePageName, encoding, false, accessor);
+    }
 
+    /**
+     * Load the font details and metrics into the CharacterSetMetric object, this will use the
+     * actual afp code page and character set files to load the object with the necessary metrics.
+     * This method is to be used for double byte character sets (DBCS).
+     *
+     * @param characterSetName name of the characterset
+     * @param codePageName name of the code page file
+     * @param encoding encoding name
+     * @param isEDBCS if this is an EBCDIC double byte character set (DBCS)
+     * @param accessor used to load codepage and characterset
+     * @return CharacterSet object
+     * @throws IOException if an I/O error occurs
+     */
+    public CharacterSet buildDBCS(String characterSetName, String codePageName, String encoding,
+            boolean isEDBCS, ResourceAccessor accessor) throws IOException {
+        return processFont(characterSetName, codePageName, encoding, isEDBCS, accessor);
+    }
+
+    /**
+     * Load the font details and metrics into the CharacterSetMetric object, this will use the
+     * actual afp code page and character set files to load the object with the necessary metrics.
+     * 
+     * @param characterSetName the CharacterSetMetric object to populate
+     * @param codePageName the name of the code page to use
+     * @param encoding name of the encoding in use
+     * @param typeface base14 font name
+     * @return CharacterSet object
+     * @throws IOException if an I/O error occurs
+     */
+    public CharacterSet build(String characterSetName, String codePageName, String encoding,
+            Typeface typeface) throws IOException {
+        return new FopCharacterSet(codePageName, encoding, characterSetName, typeface);
+    }
+
+    private CharacterSet processFont(String characterSetName, String codePageName, String encoding,
+            boolean isEDBCS, ResourceAccessor accessor) throws IOException {
         // check for cached version of the characterset
         String descriptor = characterSetName + "_" + encoding + "_" + codePageName;
         CharacterSet characterSet = (CharacterSet)characterSetsCache.get(descriptor);
@@ -203,8 +239,8 @@ public class CharacterSetBuilder {
         }
 
         // characterset not in the cache, so recreating
-        characterSet = new CharacterSet(
-                codePageName, encoding, characterSetName, accessor);
+        characterSet = new CharacterSet(codePageName, encoding, isEDBCS, characterSetName,
+                accessor);
 
         InputStream inputStream = null;
 
@@ -268,23 +304,6 @@ public class CharacterSetBuilder {
         }
         characterSetsCache.put(descriptor, characterSet);
         return characterSet;
-
-    }
-
-    /**
-     * Load the font details and metrics into the CharacterSetMetric object,
-     * this will use the actual afp code page and character set files to load
-     * the object with the necessary metrics.
-     *
-     * @param characterSetName the CharacterSetMetric object to populate
-     * @param codePageName the name of the code page to use
-     * @param encoding name of the encoding in use
-     * @param typeface base14 font name
-     * @return CharacterSet object
-     */
-    public CharacterSet build(String characterSetName, String codePageName,
-            String encoding, Typeface typeface) {
-       return new FopCharacterSet(codePageName, encoding, characterSetName, typeface);
     }
 
     /**

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/CharacterSetOrientation.java Thu Sep 29 09:49:24 2011
@@ -107,7 +107,7 @@ public class CharacterSetOrientation {
      * a character rotation other than 0, ascender height loses its
      * meaning when the character is lying on its side or is upside down
      * with respect to normal viewing orientation. For the general case,
-     * Ascender Height is the character�s most positive y-axis value.
+     * Ascender Height is the character's most positive y-axis value.
      * For bounded character boxes, for a given character having an
      * ascender, ascender height and baseline offset are equal.
      * @return the ascender value in millipoints

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/FopCharacterSet.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/FopCharacterSet.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/FopCharacterSet.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/fonts/FopCharacterSet.java Thu Sep 29 09:49:24 2011
@@ -44,7 +44,7 @@ public class FopCharacterSet extends Cha
         String name,
         Typeface charSet) {
 
-        super(codePage, encoding, name, (ResourceAccessor)null);
+        super(codePage, encoding, false, name, (ResourceAccessor) null);
         this.charSet = charSet;
     }
 
@@ -55,7 +55,7 @@ public class FopCharacterSet extends Cha
      * a character rotation other than 0, ascender height loses its
      * meaning when the character is lying on its side or is upside down
      * with respect to normal viewing orientation. For the general case,
-     * Ascender Height is the character�s most positive y-axis value.
+     * Ascender Height is the character's most positive y-axis value.
      * For bounded character boxes, for a given character having an
      * ascender, ascender height and baseline offset are equal.
      * @return the ascender value in millipoints
@@ -135,4 +135,4 @@ public class FopCharacterSet extends Cha
         return charSet.mapChar(c);
     }
 
-}
\ No newline at end of file
+}

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ioca/IDEStructureParameter.java Thu Sep 29 09:49:24 2011
@@ -46,7 +46,7 @@ public class IDEStructureParameter imple
     private boolean grayCoding = false;
 
     /** the image color model */
-    private byte colorModel = COLOR_MODEL_YCRCB;
+    private byte colorModel = COLOR_MODEL_RGB;
 
     /** the array with the number of bits/IDE for each component */
     private byte[] bitsPerIDE = new byte[] {(byte)1}; //1-bit by default

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java Thu Sep 29 09:49:24 2011
@@ -39,13 +39,12 @@ import org.apache.fop.afp.util.BinaryUti
 public abstract class AbstractAFPObject implements Streamable {
 
     /** Static logging instance */
-    protected static final Log LOG = LogFactory.getLog("org.apache.xmlgraphics.afp.modca");
+    protected static final Log LOG = LogFactory.getLog(AbstractAFPObject.class);
 
     /** the structured field class id */
     protected static final byte SF_CLASS = (byte)0xD3;
 
-    /** the structure field header */
-    static final byte[] SF_HEADER = new byte[] {
+    private static final byte[] SF_HEADER = new byte[] {
         0x5A, // Structured field identifier
         0x00, // Length byte 1
         0x10, // Length byte 2
@@ -57,6 +56,9 @@ public abstract class AbstractAFPObject 
         0x00, // Reserved
     };
 
+    /** Length of bytes of a Structured Field Header */
+    protected static final int SF_HEADER_LENGTH = SF_HEADER.length;
+
     /**
      * Copies the template structured field data array to the given byte array
      *
@@ -77,7 +79,7 @@ public abstract class AbstractAFPObject 
      * @param category the category code
      */
     protected static void copySF(byte[] data, byte clazz, byte type, byte category) {
-        System.arraycopy(SF_HEADER, 0, data, 0, SF_HEADER.length);
+        System.arraycopy(SF_HEADER, 0, data, 0, SF_HEADER_LENGTH);
         data[3] = clazz;
         data[4] = type;
         data[5] = category;
@@ -87,54 +89,23 @@ public abstract class AbstractAFPObject 
      * Writes a collection of Streamable to the AFP Datastream.
      *
      * @param objects a list of AFPObjects
+     * @param <S> Streamable view of an AFPObject
      * @param os The stream to write to
      * @throws java.io.IOException an I/O exception of some sort has occurred.
      */
-    protected void writeObjects(Collection/*<Streamable>*/ objects, OutputStream os)
-        throws IOException {
-        if (objects != null && objects.size() > 0) {
-            Iterator it = objects.iterator();
+    protected <S extends Streamable> void writeObjects(Collection<S> objects, OutputStream os)
+            throws IOException {
+        if (objects != null) {
+            Iterator<S> it = objects.iterator();
             while (it.hasNext()) {
-                Object object = it.next();
-                if (object instanceof Streamable) {
-                    ((Streamable)object).writeToStream(os);
-                    it.remove(); // once written, immediately remove the object
-                }
+                Streamable s = it.next();
+                s.writeToStream(os);
+                it.remove(); // once written, immediately remove the object
             }
         }
     }
 
     /**
-     * Reads data chunks from an InputStream
-     * and then formats them with a structured header to a given OutputStream
-     *
-     * @param dataHeader the header data
-     * @param lengthOffset offset of length field in data chunk
-     * @param maxChunkLength the maximum chunk length
-     * @param inputStream the InputStream to read from
-     * @param outputStream the OutputStream to write to
-     * @throws IOException thrown if an I/O exception of some sort has occurred.
-     */
-    protected static void copyChunks(byte[] dataHeader, int lengthOffset,
-            int maxChunkLength, InputStream inputStream, OutputStream outputStream)
-    throws IOException {
-        int headerLen = dataHeader.length - lengthOffset;
-        // length field is just before data so do not include in data length
-        if (headerLen == 2) {
-            headerLen = 0;
-        }
-        byte[] data = new byte[maxChunkLength];
-        int numBytesRead = 0;
-        while ((numBytesRead = inputStream.read(data, 0, maxChunkLength)) > 0) {
-            byte[] len = BinaryUtils.convert(headerLen + numBytesRead, 2);
-            dataHeader[lengthOffset] = len[0]; // Length byte 1
-            dataHeader[lengthOffset + 1] = len[1]; // Length byte 2
-            outputStream.write(dataHeader);
-            outputStream.write(data, 0, numBytesRead);
-        }
-    }
-
-    /**
      * Writes data chunks to a given outputstream
      *
      * @param data the data byte array
@@ -186,7 +157,7 @@ public abstract class AbstractAFPObject 
      * @param maxLength the maximum length allowed for the string
      * @return a possibly truncated string
      */
-    protected String truncate(String str, int maxLength) {
+    protected static String truncate(String str, int maxLength) {
         if (str.length() > maxLength) {
             str = str.substring(0, maxLength);
             LOG.warn("truncated character string '"

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractNamedAFPObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractNamedAFPObject.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractNamedAFPObject.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractNamedAFPObject.java Thu Sep 29 09:49:24 2011
@@ -90,7 +90,7 @@ public abstract class AbstractNamedAFPOb
         return nameBytes;
     }
 
-    /** {@inheritDoc} */
+    @Override
     protected void copySF(byte[] data, byte type, byte category) {
         super.copySF(data, type, category);
         byte[] nameData = getNameBytes();

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractTripletStructuredObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractTripletStructuredObject.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractTripletStructuredObject.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/AbstractTripletStructuredObject.java Thu Sep 29 09:49:24 2011
@@ -22,7 +22,6 @@ package org.apache.fop.afp.modca;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
 
 import org.apache.fop.afp.modca.Registry.ObjectType;
@@ -35,10 +34,10 @@ import org.apache.fop.afp.modca.triplets
 /**
  * A MODCA structured object base class providing support for Triplets
  */
-public class AbstractTripletStructuredObject extends AbstractStructuredObject {
+public abstract class AbstractTripletStructuredObject extends AbstractStructuredObject {
 
     /** list of object triplets */
-    protected List/*<Triplet>*/ triplets = new java.util.ArrayList/*<Triplet>*/();
+    protected List<AbstractTriplet> triplets = new java.util.ArrayList<AbstractTriplet>();
 
     /**
      * Returns the triplet data length
@@ -47,12 +46,8 @@ public class AbstractTripletStructuredOb
      */
     protected int getTripletDataLength() {
         int dataLength = 0;
-        if (hasTriplets()) {
-            Iterator it = triplets.iterator();
-            while (it.hasNext()) {
-                AbstractTriplet triplet = (AbstractTriplet)it.next();
-                dataLength += triplet.getDataLength();
-            }
+        for (Triplet triplet : triplets) {
+            dataLength += triplet.getDataLength();
         }
         return dataLength;
     }
@@ -85,11 +80,9 @@ public class AbstractTripletStructuredOb
      * @param tripletId the triplet identifier
      */
     private AbstractTriplet getTriplet(byte tripletId) {
-        Iterator it = getTriplets().iterator();
-        while (it.hasNext()) {
-            AbstractTriplet triplet = (AbstractTriplet)it.next();
-            if (triplet.getId() == tripletId) {
-                return triplet;
+        for (AbstractTriplet trip : triplets) {
+            if (trip.getId() == tripletId) {
+                return trip;
             }
         }
         return null;
@@ -110,7 +103,7 @@ public class AbstractTripletStructuredOb
      *
      * @param triplet the triplet to add
      */
-    protected void addTriplet(Triplet triplet) {
+    protected void addTriplet(AbstractTriplet triplet) {
         triplets.add(triplet);
     }
 
@@ -119,14 +112,14 @@ public class AbstractTripletStructuredOb
      *
      * @param tripletCollection a collection of triplets
      */
-    public void addTriplets(Collection/*<Triplet>*/ tripletCollection) {
+    public void addTriplets(Collection<AbstractTriplet> tripletCollection) {
         if (tripletCollection != null) {
             triplets.addAll(tripletCollection);
         }
     }
 
     /** @return the triplet list pertaining to this resource */
-    protected List/*<Triplet>*/ getTriplets() {
+    protected List<AbstractTriplet> getTriplets() {
         return triplets;
     }
 

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/IncludeObject.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/IncludeObject.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/IncludeObject.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/IncludeObject.java Thu Sep 29 09:49:24 2011
@@ -57,7 +57,6 @@ public class IncludeObject extends Abstr
     /** the object referenced is of type image */
     public static final byte TYPE_IMAGE = (byte)0xFB;
 
-
     /** the object type referenced (default is other) */
     private byte objectType = TYPE_OTHER;
 
@@ -68,7 +67,7 @@ public class IncludeObject extends Abstr
     private int yoaOset = 0;
 
     /** the orientation of the referenced object */
-    private int oaOrent = 0;
+    private ObjectAreaRotation oaOrent = ObjectAreaRotation.RIGHT_HANDED_0;
 
     /** the X-axis origin defined in the object */
     private int xocaOset = -1;
@@ -94,13 +93,7 @@ public class IncludeObject extends Abstr
      *            The orientation (0,90, 180, 270)
      */
     public void setObjectAreaOrientation(int orientation) {
-        if (orientation == 0 || orientation == 90 || orientation == 180
-            || orientation == 270) {
-            this.oaOrent = orientation;
-        } else {
-            throw new IllegalArgumentException(
-                "The orientation must be one of the values 0, 90, 180, 270");
-        }
+        this.oaOrent = ObjectAreaRotation.objectAreaRotationFor(orientation);
     }
 
     /**
@@ -151,87 +144,16 @@ public class IncludeObject extends Abstr
         data[17] = 0x00; // reserved
         data[18] = objectType;
 
-        //XoaOset (object area)
-        if (xoaOset > -1) {
-            byte[] x = BinaryUtils.convert(xoaOset, 3);
-            data[19] = x[0];
-            data[20] = x[1];
-            data[21] = x[2];
-        } else {
-            data[19] = (byte)0xFF;
-            data[20] = (byte)0xFF;
-            data[21] = (byte)0xFF;
-        }
+        writeOsetTo(data, 19, xoaOset);
 
-        // YoaOset (object area)
-        if (yoaOset > -1) {
-            byte[] y = BinaryUtils.convert(yoaOset, 3);
-            data[22] = y[0];
-            data[23] = y[1];
-            data[24] = y[2];
-        } else {
-            data[22] = (byte)0xFF;
-            data[23] = (byte)0xFF;
-            data[24] = (byte)0xFF;
-        }
-
-        // XoaOrent/YoaOrent
-        switch (oaOrent) {
-            case -1: // use x/y axis orientation defined in object
-                data[25] = (byte)0xFF; // x axis rotation
-                data[26] = (byte)0xFF; //
-                data[27] = (byte)0xFF; // y axis rotation
-                data[28] = (byte)0xFF;
-                break;
-            case 90:
-                data[25] = 0x2D;
-                data[26] = 0x00;
-                data[27] = 0x5A;
-                data[28] = 0x00;
-                break;
-            case 180:
-                data[25] = 0x5A;
-                data[25] = 0x00;
-                data[27] = (byte)0x87;
-                data[28] = 0x00;
-                break;
-            case 270:
-                data[25] = (byte)0x87;
-                data[26] = 0x00;
-                data[27] = 0x00;
-                data[28] = 0x00;
-                break;
-            default: // 0 degrees
-                data[25] = 0x00;
-                data[26] = 0x00;
-                data[27] = 0x2D;
-                data[28] = 0x00;
-                break;
-        }
-
-        // XocaOset (object content)
-        if (xocaOset > -1) {
-            byte[] x = BinaryUtils.convert(xocaOset, 3);
-            data[29] = x[0];
-            data[30] = x[1];
-            data[31] = x[2];
-        } else {
-            data[29] = (byte)0xFF;
-            data[30] = (byte)0xFF;
-            data[31] = (byte)0xFF;
-        }
+        writeOsetTo(data, 22, yoaOset);
+
+        oaOrent.writeTo(data, 25);
+
+        writeOsetTo(data, 29, xocaOset);
+
+        writeOsetTo(data, 32, yocaOset);
 
-        // YocaOset (object content)
-        if (yocaOset > -1) {
-            byte[] y = BinaryUtils.convert(yocaOset, 3);
-            data[32] = y[0];
-            data[33] = y[1];
-            data[34] = y[2];
-        } else {
-            data[32] = (byte)0xFF;
-            data[33] = (byte)0xFF;
-            data[34] = (byte)0xFF;
-        }
         // RefCSys (Reference coordinate system)
         data[35] = 0x01; // Page or overlay coordinate system
 
@@ -242,6 +164,19 @@ public class IncludeObject extends Abstr
         writeTriplets(os);
     }
 
+    private static void writeOsetTo(byte[] out, int offset, int oset) {
+        if (oset > -1) {
+            byte[] y = BinaryUtils.convert(oset, 3);
+            out[offset] = y[0];
+            out[offset + 1] = y[1];
+            out[offset + 2] = y[2];
+        } else {
+            out[offset] = (byte)0xFF;
+            out[offset + 1] = (byte)0xFF;
+            out[offset + 2] = (byte)0xFF;
+        }
+    }
+
     private String getObjectTypeName() {
         String objectTypeName = null;
         if (objectType == TYPE_PAGE_SEGMENT) {
@@ -299,4 +234,69 @@ public class IncludeObject extends Abstr
         addTriplet(new MeasurementUnitsTriplet(xRes, xRes));
     }
 
-}
\ No newline at end of file
+    /**
+     * Represents the 4 bytes that specify the area rotation reference coordinate system
+     *
+     */
+    private enum ObjectAreaRotation {
+
+        RIGHT_HANDED_0(Rotation.ROTATION_0, Rotation.ROTATION_90),
+        RIGHT_HANDED_90(Rotation.ROTATION_90, Rotation.ROTATION_180),
+        RIGHT_HANDED_180(Rotation.ROTATION_180, Rotation.ROTATION_270),
+        RIGHT_HANDED_270(Rotation.ROTATION_270, Rotation.ROTATION_0);
+
+        /**
+         * The object area's X-axis rotation from the X axis of the reference coordinate system
+         */
+        private final Rotation xoaOrent;
+        /**
+         * The object area's Y-axis rotation from the Y axis of the reference coordinate system
+         */
+        private final Rotation yoaOrent;
+
+        public void writeTo(byte[] out, int offset) {
+            xoaOrent.writeTo(out, offset);
+            yoaOrent.writeTo(out, offset + 2);
+        }
+
+        ObjectAreaRotation(Rotation xoaOrent, Rotation yoaOrent) {
+            this.xoaOrent = xoaOrent;
+            this.yoaOrent = yoaOrent;
+        }
+
+        private static ObjectAreaRotation objectAreaRotationFor(int orientation) {
+            switch (orientation) {
+                case 0: return RIGHT_HANDED_0;
+                case 90: return RIGHT_HANDED_90;
+                case 180: return RIGHT_HANDED_180;
+                case 270: return RIGHT_HANDED_270;
+                default: throw new IllegalArgumentException(
+                "The orientation must be one of the values 0, 90, 180, 270");
+            }
+        }
+    }
+
+    /**
+     * Represents a rotation value
+     *
+     */
+    private enum Rotation {
+
+        ROTATION_0(0),
+        ROTATION_90(0x2D),
+        ROTATION_180(0x5A),
+        ROTATION_270(0x87);
+
+        private final byte firstByte;
+
+        public void writeTo(byte[] out, int offset) {
+            out[offset] = firstByte;
+            out[offset + 1] = (byte)0;
+        }
+
+        Rotation(int firstByte) {
+            this.firstByte = (byte) firstByte;
+        }
+    }
+
+}

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/TagLogicalElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/TagLogicalElement.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/TagLogicalElement.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/modca/TagLogicalElement.java Thu Sep 29 09:49:24 2011
@@ -104,7 +104,7 @@ public class TagLogicalElement extends A
         setAttributeValue(value);
         setAttributeQualifier(tleID, 1);
 
-        byte[] data = new byte[SF_HEADER.length];
+        byte[] data = new byte[SF_HEADER_LENGTH];
         copySF(data, Type.ATTRIBUTE, Category.PROCESS_ELEMENT);
 
         int tripletDataLength = getTripletDataLength();

Propchange: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/parser/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 29 09:49:24 2011
@@ -3,4 +3,4 @@
 /xmlgraphics/fop/branches/Temp_Color/src/java/org/apache/fop/afp/parser:956535-1069429
 /xmlgraphics/fop/branches/fop-0_95/src/java/org/apache/fop/afp/parser:684572,688085,688696
 /xmlgraphics/fop/branches/fop-1_0/src/java/org/apache/fop/afp/parser:959975-964707
-/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/parser:959946-1149493
+/xmlgraphics/fop/trunk/src/java/org/apache/fop/afp/parser:959946-1177230

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java Thu Sep 29 09:49:24 2011
@@ -25,7 +25,7 @@ import java.io.IOException;
 import java.io.OutputStream;
 
 import org.apache.commons.io.output.ByteArrayOutputStream;
-
+import org.apache.fop.afp.fonts.CharactersetEncoder.EncodedChars;
 import org.apache.xmlgraphics.java2d.color.CIELabColorSpace;
 import org.apache.xmlgraphics.java2d.color.ColorUtil;
 import org.apache.xmlgraphics.java2d.color.ColorWithAlternatives;
@@ -85,10 +85,6 @@ public abstract class PtocaBuilder imple
         baout.writeTo(out);
     }
 
-    private void write(byte[] data, int offset, int length) {
-        baout.write(data, offset, length);
-    }
-
     private void writeByte(int data) {
         baout.write(data);
     }
@@ -180,44 +176,34 @@ public abstract class PtocaBuilder imple
         currentX = -1;
     }
 
-    private static final int TRANSPARENT_MAX_SIZE = 253;
-
     /**
      * The Transparent Data control sequence contains a sequence of code points
      * that are presented without a scan for embedded control sequences. If the data is larger
      * than fits in one chunk, additional chunks are automatically generated.
      *
-     * @param data The text data to add.
+     * @param encodedChars The encoded text data to add.
      * @throws IOException if an I/O error occurs
      */
-    public void addTransparentData(byte[] data) throws IOException {
-        if (data.length <= TRANSPARENT_DATA_MAX_SIZE) {
-            addTransparentDataChunk(data);
-        } else {
-            // data size greater than TRANSPARENT_MAX_SIZE, so slice
-            int numTransData = data.length / TRANSPARENT_DATA_MAX_SIZE;
-            int currIndex = 0;
-            for (int transDataCnt = 0; transDataCnt < numTransData; transDataCnt++) {
-                addTransparentDataChunk(data, currIndex, TRANSPARENT_DATA_MAX_SIZE);
-                currIndex += TRANSPARENT_DATA_MAX_SIZE;
-            }
-            int left = data.length - currIndex;
-            addTransparentDataChunk(data, currIndex, left);
+    public void addTransparentData(EncodedChars encodedChars) throws IOException {
+
+        // data size greater than TRANSPARENT_MAX_SIZE, so slice
+        int numTransData = encodedChars.getLength() / TRANSPARENT_DATA_MAX_SIZE;
+        int currIndex = 0;
+        for (int transDataCnt = 0; transDataCnt < numTransData; transDataCnt++) {
+            addTransparentDataChunk(encodedChars, currIndex, TRANSPARENT_DATA_MAX_SIZE);
+            currIndex += TRANSPARENT_DATA_MAX_SIZE;
         }
-    }
+        int left = encodedChars.getLength() - currIndex;
+        addTransparentDataChunk(encodedChars, currIndex, left);
 
-    private void addTransparentDataChunk(byte[] data) throws IOException {
-        addTransparentDataChunk(data, 0, data.length);
     }
 
-    private void addTransparentDataChunk(byte[] data, int offset, int length) throws IOException {
-        if (length > TRANSPARENT_MAX_SIZE) {
-            // Check that we are not exceeding the maximum length
-            throw new IllegalArgumentException(
-                    "Transparent data is longer than " + TRANSPARENT_MAX_SIZE + " bytes");
-        }
+
+
+    private void addTransparentDataChunk(EncodedChars encodedChars, int offset, int length)
+            throws IOException {
         newControlSequence();
-        write(data, offset, length);
+        encodedChars.writeTo(baout, offset, length);
         commit(chained(TRN));
     }
 

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/TextDataInfoProducer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/TextDataInfoProducer.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/TextDataInfoProducer.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/ptoca/TextDataInfoProducer.java Thu Sep 29 09:49:24 2011
@@ -22,6 +22,7 @@ package org.apache.fop.afp.ptoca;
 import java.io.IOException;
 
 import org.apache.fop.afp.AFPTextDataInfo;
+import org.apache.fop.afp.fonts.CharactersetEncoder;
 
 /**
  * {@link PtocaProducer} implementation that interprets {@link AFPTextDataInfo} objects.
@@ -55,8 +56,7 @@ public class TextDataInfoProducer implem
         // Add transparent data
         String textString = textDataInfo.getString();
         String encoding = textDataInfo.getEncoding();
-        byte[] data = textString.getBytes(encoding);
-        builder.addTransparentData(data);
+        builder.addTransparentData(CharactersetEncoder.encodeSBCS(textString, encoding, false));
     }
 
 }

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/util/AFPResourceUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/util/AFPResourceUtil.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/util/AFPResourceUtil.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/afp/util/AFPResourceUtil.java Thu Sep 29 09:49:24 2011
@@ -92,10 +92,13 @@ public final class AFPResourceUtil {
             throws UnsupportedEncodingException {
         //The first 8 bytes of the field data represent the resource name
         byte[] nameBytes = new byte[8];
-        System.arraycopy(field.getData(), 0, nameBytes, 0, 8);
-        String asciiName;
-        asciiName = new String(nameBytes, AFPConstants.EBCIDIC_ENCODING);
-        return asciiName;
+
+        byte[] fieldData = field.getData();
+        if (fieldData.length < 8) {
+            throw new IllegalArgumentException("Field data does not contain a resource name");
+        }
+        System.arraycopy(fieldData, 0, nameBytes, 0, 8);
+        return new String(nameBytes, AFPConstants.EBCIDIC_ENCODING);
     }
 
     /**
@@ -128,12 +131,13 @@ public final class AFPResourceUtil {
     public static void copyNamedResource(String name,
             final InputStream in, final OutputStream out) throws IOException {
         final MODCAParser parser = new MODCAParser(in);
-        Collection resourceNames = new java.util.HashSet();
+        Collection<String> resourceNames = new java.util.HashSet<String>();
 
         //Find matching "Begin" field
         final UnparsedStructuredField fieldBegin;
         while (true) {
-            UnparsedStructuredField field = parser.readNextStructuredField();
+            final UnparsedStructuredField field = parser.readNextStructuredField();
+
             if (field == null) {
                 throw new IOException("Requested resource '" + name
                         + "' not found. Encountered resource names: " + resourceNames);
@@ -142,8 +146,10 @@ public final class AFPResourceUtil {
             if (field.getSfTypeCode() != TYPE_CODE_BEGIN) { //0xA8=Begin
                 continue; //Not a "Begin" field
             }
-            String resourceName = getResourceName(field);
+            final String resourceName = getResourceName(field);
+
             resourceNames.add(resourceName);
+
             if (resourceName.equals(name)) {
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("Start of requested structured field found:\n"
@@ -170,45 +176,35 @@ public final class AFPResourceUtil {
         if (wrapInResource) {
             ResourceObject resourceObject =  new ResourceObject(name) {
                 protected void writeContent(OutputStream os) throws IOException {
-                    copyStructuredFields(name, fieldBegin, parser, out);
+                    copyNamedStructuredFields(name, fieldBegin, parser, out);
                 }
             };
             resourceObject.setType(ResourceObject.TYPE_PAGE_SEGMENT);
             resourceObject.writeToStream(out);
         } else {
-            copyStructuredFields(name, fieldBegin, parser, out);
+            copyNamedStructuredFields(name, fieldBegin, parser, out);
         }
     }
 
-    private static void copyStructuredFields(String name, UnparsedStructuredField fieldBegin,
-            MODCAParser parser, OutputStream out) throws IOException {
-        boolean inRequestedResource;
-
-        //The "Begin" field first
-        out.write(MODCAParser.CARRIAGE_CONTROL_CHAR);
-        fieldBegin.writeTo(out);
-        UnparsedStructuredField field;
-
-        //Then the rest of the fields until the corresponding "End" field
-        inRequestedResource = true;
-        do {
-            field = parser.readNextStructuredField();
-            if (field == null) {
-                break; //Unexpected EOF
-            }
+    private static void copyNamedStructuredFields(final String name,
+            UnparsedStructuredField fieldBegin, MODCAParser parser,
+            OutputStream out) throws IOException {
 
-            if (field.getSfTypeCode() == TYPE_CODE_END) {
-                String resourceName = getResourceName(field);
-                if (resourceName.equals(name)) {
-                    inRequestedResource = false; //Signal end of loop
-                }
+        UnparsedStructuredField field = fieldBegin;
+
+        while (true) {
+            if (field == null) {
+                throw new IOException("Ending structured field not found for resource " + name);
             }
             out.write(MODCAParser.CARRIAGE_CONTROL_CHAR);
             field.writeTo(out);
-        } while (inRequestedResource);
-        if (inRequestedResource) {
-            throw new IOException("Ending structured field not found for resource " + name);
+
+            if (field.getSfTypeCode() == TYPE_CODE_END
+                    && fieldBegin.getSfCategoryCode() == field.getSfCategoryCode()
+                    && name.equals(getResourceName(field))) {
+                break;
+            }
+            field = parser.readNextStructuredField();
         }
     }
-
 }

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/cli/CommandLineOptions.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/cli/CommandLineOptions.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/cli/CommandLineOptions.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/cli/CommandLineOptions.java Thu Sep 29 09:49:24 2011
@@ -381,6 +381,14 @@ public class CommandLineOptions {
                 getPDFEncryptionParams().setAllowEditContent(false);
             } else if (args[i].equals("-noannotations")) {
                 getPDFEncryptionParams().setAllowEditAnnotations(false);
+            } else if (args[i].equals("-nofillinforms")) {
+                getPDFEncryptionParams().setAllowFillInForms(false);
+            } else if (args[i].equals("-noaccesscontent")) {
+                getPDFEncryptionParams().setAllowAccessContent(false);
+            } else if (args[i].equals("-noassembledoc")) {
+                getPDFEncryptionParams().setAllowAssembleDocument(false);
+            } else if (args[i].equals("-noprinthq")) {
+                getPDFEncryptionParams().setAllowPrintHq(false);
             } else if (args[i].equals("-version")) {
                 printVersion();
                 return false;
@@ -1181,6 +1189,14 @@ public class CommandLineOptions {
             + "  -nocopy           PDF file will be encrypted without copy content permission\n"
             + "  -noedit           PDF file will be encrypted without edit content permission\n"
             + "  -noannotations    PDF file will be encrypted without edit annotation permission\n"
+            + "  -nofillinforms    PDF file will be encrypted without"
+            + " fill in interactive form fields permission\n"
+            + "  -noaccesscontent  PDF file will be encrypted without"
+            + " extract text and graphics permission\n"
+            + "  -noassembledoc    PDF file will be encrypted without"
+            + " assemble the document permission\n"
+            + "  -noprinthq        PDF file will be encrypted without"
+            + " print high quality permission\n"
             + "  -a                enables accessibility features (Tagged PDF etc., default off)\n"
             + "  -pdfprofile prof  PDF file will be generated with the specified profile\n"
             + "                    (Examples for prof: PDF/A-1b or PDF/X-3:2003)\n\n"

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/FontDescriptor.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/FontDescriptor.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/FontDescriptor.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/FontDescriptor.java Thu Sep 29 09:49:24 2011
@@ -86,5 +86,10 @@ public interface FontDescriptor extends 
      */
     boolean isEmbeddable();
 
+    /**
+     * Indicates whether this font is subset embedded.
+     * @return true if this font is subset embedded
+     */
+    boolean isSubsetEmbedded();
 
 }

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/LazyFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/LazyFont.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/LazyFont.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/LazyFont.java Thu Sep 29 09:49:24 2011
@@ -27,12 +27,10 @@ import java.util.Set;
 import javax.xml.transform.Source;
 import javax.xml.transform.stream.StreamSource;
 
-import org.xml.sax.InputSource;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
 import org.apache.fop.apps.FOPException;
+import org.xml.sax.InputSource;
 
 /**
  * This class is used to defer the loading of a font until it is really used.
@@ -462,5 +460,13 @@ public class LazyFont extends Typeface i
         }
     }
 
+    /**
+     * {@inheritDoc}
+     */
+    public boolean isSubsetEmbedded() {
+        load(true);
+        return realFont.isMultiByte();
+    }
+
 }
 

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/MultiByteFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/MultiByteFont.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/MultiByteFont.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/MultiByteFont.java Thu Sep 29 09:49:24 2011
@@ -21,7 +21,6 @@ package org.apache.fop.fonts;
 
 import java.nio.CharBuffer;
 import java.nio.IntBuffer;
-import java.text.DecimalFormat;
 import java.util.Map;
 
 import org.apache.commons.logging.Log;
@@ -38,16 +37,12 @@ public class MultiByteFont extends CIDFo
     private static final Log log // CSOK: ConstantNameCheck
         = LogFactory.getLog(MultiByteFont.class);
 
-    private static int uniqueCounter = -1;
-
     private String ttcName = null;
     private String encoding = "Identity-H";
 
     private int defaultWidth = 0;
     private CIDFontType cidType = CIDFontType.CIDTYPE2;
 
-    private String namePrefix = null;    // Quasi unique prefix
-
     private CIDSubset subset = new CIDSubset();
 
     /**
@@ -77,26 +72,6 @@ public class MultiByteFont extends CIDFo
      */
     public MultiByteFont() {
         subset.setupFirstGlyph();
-
-        // Create a quasiunique prefix for fontname
-        synchronized (this.getClass()) {
-            uniqueCounter++;
-            if (uniqueCounter > 99999 || uniqueCounter < 0) {
-                uniqueCounter = 0; //We need maximum 5 character then we start again
-            }
-        }
-        DecimalFormat counterFormat = new DecimalFormat("00000");
-        String cntString = counterFormat.format(uniqueCounter);
-
-        //Subset prefix as described in chapter 5.5.3 of PDF 1.4
-        StringBuffer sb = new StringBuffer("E");
-        for (int i = 0, c = cntString.length(); i < c; i++) {
-            //translate numbers to uppercase characters
-            sb.append((char)(cntString.charAt(i) + (65 - 48)));
-        }
-        sb.append("+");
-        namePrefix = sb.toString();
-
         setFontType(FontType.TYPE0);
     }
 
@@ -133,14 +108,10 @@ public class MultiByteFont extends CIDFo
         this.cidType = cidType;
     }
 
-    private String getPrefixedFontName() {
-        return namePrefix + FontUtil.stripWhiteSpace(super.getFontName());
-    }
-
     /** {@inheritDoc} */
     public String getEmbedFontName() {
         if (isEmbeddable()) {
-            return getPrefixedFontName();
+            return FontUtil.stripWhiteSpace(super.getFontName());
         } else {
             return super.getFontName();
         }
@@ -152,6 +123,11 @@ public class MultiByteFont extends CIDFo
     }
 
     /** {@inheritDoc} */
+    public boolean isSubsetEmbedded() {
+        return true;
+    }
+
+    /** {@inheritDoc} */
     public CIDSubset getCIDSubset() {
         return this.subset;
     }

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/SingleByteFont.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/SingleByteFont.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/SingleByteFont.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/SingleByteFont.java Thu Sep 29 09:49:24 2011
@@ -63,7 +63,11 @@ public class SingleByteFont extends Cust
     }
 
     /** {@inheritDoc} */
-    @Override
+    public boolean isSubsetEmbedded() {
+        return false;
+    }
+
+    /** {@inheritDoc} */
     public String getEncodingName() {
         return this.mapping.getName();
     }

Modified: xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/truetype/FontFileReader.java?rev=1177244&r1=1177243&r2=1177244&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/truetype/FontFileReader.java (original)
+++ xmlgraphics/fop/branches/Temp_ComplexScripts/src/java/org/apache/fop/fonts/truetype/FontFileReader.java Thu Sep 29 09:49:24 2011
@@ -198,14 +198,15 @@ public class FontFileReader {
      * @param val The value to write
      * @throws IOException If EOF is reached
      */
-    public final void writeTTFUShort(int pos, int val) throws IOException {
+    public final void writeTTFUShort(long pos, int val) throws IOException {
         if ((pos + 2) > fsize) {
             throw new java.io.EOFException("Reached EOF");
         }
         final byte b1 = (byte)((val >> 8) & 0xff);
         final byte b2 = (byte)(val & 0xff);
-        file[pos] = b1;
-        file[pos + 1] = b2;
+        final int fileIndex = (int) pos;
+        file[fileIndex] = b1;
+        file[fileIndex + 1] = b2;
     }
 
     /**



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