From: Simon Pepping Date: Thu, 29 Sep 2011 09:49:24 +0000 (+0000) Subject: Merged /xmlgraphics/fop/trunk:r1149494-1177230 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=3dae5bcd7ea906930ff37a51d11f6c7e74c821a7;p=xmlgraphics-fop.git Merged /xmlgraphics/fop/trunk:r1149494-1177230 git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_ComplexScripts@1177244 13f79535-47bb-0310-9956-ffa450edef68 --- 3dae5bcd7ea906930ff37a51d11f6c7e74c821a7 diff --cc build.xml index 5d1c1d73a,c1828a144..805323c17 --- a/build.xml +++ b/build.xml @@@ -748,7 -738,7 +748,8 @@@ list of possible build targets + + @@@ -991,7 -963,13 +992,13 @@@ - + + + + + ++ junit-text-linebreak, junit-fotree, junit-render-pdf, junit-complexscripts"/> diff --cc src/java/org/apache/fop/fonts/LazyFont.java index ef48cf877,f331a331e..ce7b1eec9 --- a/src/java/org/apache/fop/fonts/LazyFont.java +++ b/src/java/org/apache/fop/fonts/LazyFont.java @@@ -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(); + } + } diff --cc src/java/org/apache/fop/fonts/MultiByteFont.java index 33e99ff67,0d9897268..285d754be --- a/src/java/org/apache/fop/fonts/MultiByteFont.java +++ b/src/java/org/apache/fop/fonts/MultiByteFont.java @@@ -19,59 -19,26 +19,54 @@@ 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 */