]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Merged /xmlgraphics/fop/trunk:r1149494-1177230
authorSimon Pepping <spepping@apache.org>
Thu, 29 Sep 2011 09:49:24 +0000 (09:49 +0000)
committerSimon Pepping <spepping@apache.org>
Thu, 29 Sep 2011 09:49:24 +0000 (09:49 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ComplexScripts@1177244 13f79535-47bb-0310-9956-ffa450edef68

1  2 
build.xml
src/java/org/apache/fop/fonts/LazyFont.java
src/java/org/apache/fop/fonts/MultiByteFont.java
src/java/org/apache/fop/render/java2d/Java2DRenderer.java

diff --cc build.xml
index 5d1c1d73adeca63d4a5a63ccbd0a63074e917871,c1828a144e5686405c36cf7bd1c4bb1473926233..805323c173de3d2af9f84cd8454b776d48178de3
+++ b/build.xml
@@@ -748,7 -738,7 +748,8 @@@ list of possible build targets
          <include name="META-INF/**"/>
          <include name="**/*.xml"/>
          <include name="**/*.fo"/>
 +        <include name="**/BidiTestData*.ser"/>
+         <include name="**/*.afp"/>
        </fileset>
        <fileset dir="${build.dir}/test-gensrc">
          <include name="**/*.xml"/>
        <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-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>
index ef48cf8774fbbdf28441c703fe7411c04d587b6f,f331a331e51d1ef554ab128fb8b920a997ab3a6a..ce7b1eec90d5a6421eda087ca09172f959c151ad
@@@ -384,83 -373,13 +382,91 @@@ public class LazyFont extends Typeface 
          return realFontDescriptor.isEmbeddable();
      }
  
 +    /**
 +     * {@inheritDoc}
 +     */
 +    public boolean performsSubstitution() {
 +        load(true);
 +        if ( realFontDescriptor instanceof Substitutable ) {
 +            return ((Substitutable)realFontDescriptor).performsSubstitution();
 +        } else {
 +            return false;
 +        }
 +    }
 +
 +    /**
 +     * {@inheritDoc}
 +     */
 +    public CharSequence performSubstitution ( CharSequence cs, String script, String language ) {
 +        load(true);
 +        if ( realFontDescriptor instanceof Substitutable ) {
 +            return ((Substitutable)realFontDescriptor).performSubstitution(cs, script, language);
 +        } else {
 +            return cs;
 +        }
 +    }
 +
 +    /**
 +     * {@inheritDoc}
 +     */
 +    public CharSequence reorderCombiningMarks
 +        ( CharSequence cs, int[][] gpa, String script, String language ) {
 +        load(true);
 +        if ( realFontDescriptor instanceof Substitutable ) {
 +            return ((Substitutable)realFontDescriptor).
 +                reorderCombiningMarks(cs, gpa, script, language);
 +        } else {
 +            return cs;
 +        }
 +    }
 +
 +    /**
 +     * {@inheritDoc}
 +     */
 +    public boolean performsPositioning() {
 +        load(true);
 +        if ( realFontDescriptor instanceof Positionable ) {
 +            return ((Positionable)realFontDescriptor).performsPositioning();
 +        } else {
 +            return false;
 +        }
 +    }
 +
 +    /**
 +     * {@inheritDoc}
 +     */
 +    public int[][]
 +        performPositioning ( CharSequence cs, String script, String language, int fontSize ) {
 +        load(true);
 +        if ( realFontDescriptor instanceof Positionable ) {
 +            return ((Positionable)realFontDescriptor)
 +                .performPositioning(cs, script, language, fontSize);
 +        } else {
 +            return null;
 +        }
 +    }
 +
 +    /**
 +     * {@inheritDoc}
 +     */
 +    public int[][]
 +        performPositioning ( CharSequence cs, String script, String language ) {
 +        load(true);
 +        if ( realFontDescriptor instanceof Positionable ) {
 +            return ((Positionable)realFontDescriptor)
 +                .performPositioning(cs, script, language);
 +        } else {
 +            return null;
 +        }
 +    }
 +
+     /**
+      * {@inheritDoc}
+      */
+     public boolean isSubsetEmbedded() {
+         load(true);
+         return realFont.isMultiByte();
+     }
  }
  
index 33e99ff67f6f5259b8f700310a07c8bfe3276390,0d98972687bc9c94188d0299858bbb20b4be1091..285d754bec50924a4d98ca4234d777e9dd1b53a2
  
  package org.apache.fop.fonts;
  
 -//Java
 +import java.nio.CharBuffer;
 +import java.nio.IntBuffer;
- import java.text.DecimalFormat;
  import java.util.Map;
  
 +import org.apache.commons.logging.Log;
 +import org.apache.commons.logging.LogFactory;
 +
 +import org.apache.fop.util.CharUtilities;
  
  /**
   * Generic MultiByte (CID) font
   */
 -public class MultiByteFont extends CIDFont {
 +public class MultiByteFont extends CIDFont implements Substitutable, Positionable {
 +
 +    /** logging instance */
 +    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();
  
 -    /** A map from Unicode indices to glyph indices */
 +    /**
 +     * A map from Unicode indices to glyph indices. No assumption
 +     * about ordering is made below. If lookup is changed to a binary
 +     * search (from the current linear search), then addPrivateUseMapping()
 +     * needs to be changed to perform ordered inserts.
 +     */
      private BFEntry[] bfentries = null;
  
 +    /* advanced typographic support */
 +    private GlyphDefinitionTable gdef;
 +    private GlyphSubstitutionTable gsub;
 +    private GlyphPositioningTable gpos;
 +
 +    /* dynamic private use (character) mappings */
 +    private int numMapped;
 +    private int numUnmapped;
 +    private int nextPrivateUse = 0xE000;
 +    private int firstPrivate;
 +    private int lastPrivate;
 +    private int firstUnmapped;
 +    private int lastUnmapped;
 +
      /**
       * Default constructor
       */