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 vh...@apache.org on 2013/05/07 18:23:17 UTC
svn commit: r1479969 [3/16] - in /xmlgraphics/fop/trunk: ./
src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/
src/codegen/unicode/java/org/apache/fop/hyphenation/
src/java/org/apache/fop/afp/ src/java/org/apache/fop/afp/modca/
src/java/org/a...
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/bidi/UnicodeBidiAlgorithm.java Tue May 7 16:23:13 2013
@@ -59,10 +59,10 @@ public final class UnicodeBidiAlgorithm
* @param cs input character sequence representing a UTF-16 encoded string
* @param defaultLevel the default paragraph level, which must be zero (LR) or one (RL)
*/
- public static int[] resolveLevels (CharSequence cs, Direction defaultLevel) {
+ public static int[] resolveLevels(CharSequence cs, Direction defaultLevel) {
int[] chars = new int [ cs.length() ];
- if (convertToScalar (cs, chars) || (defaultLevel == Direction.RL)) {
- return resolveLevels (chars, (defaultLevel == Direction.RL) ? 1 : 0, new int [ chars.length ]);
+ if (convertToScalar(cs, chars) || (defaultLevel == Direction.RL)) {
+ return resolveLevels(chars, (defaultLevel == Direction.RL) ? 1 : 0, new int [ chars.length ]);
} else {
return null;
}
@@ -78,8 +78,8 @@ public final class UnicodeBidiAlgorithm
* @param defaultLevel the default paragraph level, which must be zero (LR) or one (RL)
* @param levels array to receive levels, one for each character in chars array
*/
- public static int[] resolveLevels (int[] chars, int defaultLevel, int[] levels) {
- return resolveLevels (chars, getClasses (chars), defaultLevel, levels, false);
+ public static int[] resolveLevels(int[] chars, int defaultLevel, int[] levels) {
+ return resolveLevels(chars, getClasses(chars), defaultLevel, levels, false);
}
/**
@@ -94,26 +94,26 @@ public final class UnicodeBidiAlgorithm
* @param levels array to receive levels, one for each character in chars array
* @param useRuleL1 true if rule L1 should be used
*/
- public static int[] resolveLevels (int[] chars, int[] classes, int defaultLevel, int[] levels, boolean useRuleL1) {
+ public static int[] resolveLevels(int[] chars, int[] classes, int defaultLevel, int[] levels, boolean useRuleL1) {
int[] ica = classes;
- int[] wca = copySequence (ica);
+ int[] wca = copySequence(ica);
int[] ea = new int [ levels.length ];
- resolveExplicit (wca, defaultLevel, ea);
- resolveRuns (wca, defaultLevel, ea, levelsFromEmbeddings (ea, levels));
+ resolveExplicit(wca, defaultLevel, ea);
+ resolveRuns(wca, defaultLevel, ea, levelsFromEmbeddings(ea, levels));
if (useRuleL1) {
- resolveSeparators (ica, wca, defaultLevel, levels);
+ resolveSeparators(ica, wca, defaultLevel, levels);
}
- dump ("RL: CC(" + ((chars != null) ? chars.length : -1) + ")", chars, classes, defaultLevel, levels);
+ dump("RL: CC(" + ((chars != null) ? chars.length : -1) + ")", chars, classes, defaultLevel, levels);
return levels;
}
- private static int[] copySequence (int[] ta) {
+ private static int[] copySequence(int[] ta) {
int[] na = new int [ ta.length ];
- System.arraycopy (ta, 0, na, 0, na.length);
+ System.arraycopy(ta, 0, na, 0, na.length);
return na;
}
- private static void resolveExplicit (int[] wca, int defaultLevel, int[] ea) {
+ private static void resolveExplicit(int[] wca, int defaultLevel, int[] ea) {
int[] es = new int [ MAX_LEVELS ]; /* embeddings stack */
int ei = 0; /* embeddings stack index */
int ec = defaultLevel; /* current embedding level */
@@ -175,7 +175,7 @@ public final class UnicodeBidiAlgorithm
break;
default:
if ((el & OVERRIDE) != 0) {
- wca [ i ] = directionOfLevel (el);
+ wca [ i ] = directionOfLevel(el);
}
break;
}
@@ -183,38 +183,38 @@ public final class UnicodeBidiAlgorithm
}
}
- private static int directionOfLevel (int level) {
+ private static int directionOfLevel(int level) {
return ((level & 1) != 0) ? R : L;
}
- private static int levelOfEmbedding (int embedding) {
+ private static int levelOfEmbedding(int embedding) {
return embedding & ~OVERRIDE;
}
- private static int[] levelsFromEmbeddings (int[] ea, int[] la) {
+ private static int[] levelsFromEmbeddings(int[] ea, int[] la) {
assert ea != null;
assert la != null;
assert la.length == ea.length;
for (int i = 0, n = la.length; i < n; i++) {
- la [ i ] = levelOfEmbedding (ea [ i ]);
+ la [ i ] = levelOfEmbedding(ea [ i ]);
}
return la;
}
- private static void resolveRuns (int[] wca, int defaultLevel, int[] ea, int[] la) {
+ private static void resolveRuns(int[] wca, int defaultLevel, int[] ea, int[] la) {
if (la.length != wca.length) {
- throw new IllegalArgumentException ("levels sequence length must match classes sequence length");
+ throw new IllegalArgumentException("levels sequence length must match classes sequence length");
} else if (la.length != ea.length) {
- throw new IllegalArgumentException ("levels sequence length must match embeddings sequence length");
+ throw new IllegalArgumentException("levels sequence length must match embeddings sequence length");
} else {
for (int i = 0, n = ea.length, lPrev = defaultLevel; i < n; ) {
int s = i;
int e = s;
- int l = findNextNonRetainedFormattingLevel (wca, ea, s, lPrev);
+ int l = findNextNonRetainedFormattingLevel(wca, ea, s, lPrev);
while (e < n) {
if (la [ e ] != l) {
- if (startsWithRetainedFormattingRun (wca, ea, e)) {
- e += getLevelRunLength (ea, e);
+ if (startsWithRetainedFormattingRun(wca, ea, e)) {
+ e += getLevelRunLength(ea, e);
} else {
break;
}
@@ -222,34 +222,34 @@ public final class UnicodeBidiAlgorithm
e++;
}
}
- lPrev = resolveRun (wca, defaultLevel, ea, la, s, e, l, lPrev);
+ lPrev = resolveRun(wca, defaultLevel, ea, la, s, e, l, lPrev);
i = e;
}
}
}
- private static int findNextNonRetainedFormattingLevel (int[] wca, int[] ea, int start, int lPrev) {
+ private static int findNextNonRetainedFormattingLevel(int[] wca, int[] ea, int start, int lPrev) {
int s = start;
int e = wca.length;
while (s < e) {
- if (startsWithRetainedFormattingRun (wca, ea, s)) {
- s += getLevelRunLength (ea, s);
+ if (startsWithRetainedFormattingRun(wca, ea, s)) {
+ s += getLevelRunLength(ea, s);
} else {
break;
}
}
if (s < e) {
- return levelOfEmbedding (ea [ s ]);
+ return levelOfEmbedding(ea [ s ]);
} else {
return lPrev;
}
}
- private static int getLevelRunLength (int[] ea, int start) {
+ private static int getLevelRunLength(int[] ea, int start) {
assert start < ea.length;
int nl = 0;
- for (int s = start, e = ea.length, l0 = levelOfEmbedding (ea [ start ]); s < e; s++) {
- if (levelOfEmbedding (ea [ s ]) == l0) {
+ for (int s = start, e = ea.length, l0 = levelOfEmbedding(ea [ start ]); s < e; s++) {
+ if (levelOfEmbedding(ea [ s ]) == l0) {
nl++;
} else {
break;
@@ -258,17 +258,17 @@ public final class UnicodeBidiAlgorithm
return nl;
}
- private static boolean startsWithRetainedFormattingRun (int[] wca, int[] ea, int start) {
- int nl = getLevelRunLength (ea, start);
+ private static boolean startsWithRetainedFormattingRun(int[] wca, int[] ea, int start) {
+ int nl = getLevelRunLength(ea, start);
if (nl > 0) {
- int nc = getRetainedFormattingRunLength (wca, start);
+ int nc = getRetainedFormattingRunLength(wca, start);
return (nc >= nl);
} else {
return false;
}
}
- private static int getRetainedFormattingRunLength (int[] wca, int start) {
+ private static int getRetainedFormattingRunLength(int[] wca, int start) {
assert start < wca.length;
int nc = 0;
for (int s = start, e = wca.length; s < e; s++) {
@@ -281,41 +281,41 @@ public final class UnicodeBidiAlgorithm
return nc;
}
- private static int resolveRun (int[] wca, int defaultLevel, int[] ea, int[] la, int start, int end, int level, int levelPrev) {
+ private static int resolveRun(int[] wca, int defaultLevel, int[] ea, int[] la, int start, int end, int level, int levelPrev) {
// determine start of run direction
- int sor = directionOfLevel (max (levelPrev, level));
+ int sor = directionOfLevel(max(levelPrev, level));
// determine end of run direction
int le = -1;
if (end == wca.length) {
- le = max (level, defaultLevel);
+ le = max(level, defaultLevel);
} else {
for (int i = end; i < wca.length; i++) {
if (wca [ i ] != BidiConstants.BN) {
- le = max (level, la [ i ]);
+ le = max(level, la [ i ]);
break;
}
}
if (le < 0) {
- le = max (level, defaultLevel);
+ le = max(level, defaultLevel);
}
}
- int eor = directionOfLevel (le);
+ int eor = directionOfLevel(le);
if (log.isDebugEnabled()) {
- log.debug ("BR[" + padLeft (start, 3) + "," + padLeft (end, 3) + "] :" + padLeft (level, 2) + ": SOR(" + getClassName(sor) + "), EOR(" + getClassName(eor) + ")");
+ log.debug("BR[" + padLeft(start, 3) + "," + padLeft(end, 3) + "] :" + padLeft(level, 2) + ": SOR(" + getClassName(sor) + "), EOR(" + getClassName(eor) + ")");
}
- resolveWeak (wca, defaultLevel, ea, la, start, end, level, sor, eor);
- resolveNeutrals (wca, defaultLevel, ea, la, start, end, level, sor, eor);
- resolveImplicit (wca, defaultLevel, ea, la, start, end, level, sor, eor);
+ resolveWeak(wca, defaultLevel, ea, la, start, end, level, sor, eor);
+ resolveNeutrals(wca, defaultLevel, ea, la, start, end, level, sor, eor);
+ resolveImplicit(wca, defaultLevel, ea, la, start, end, level, sor, eor);
// if this run is all retained formatting, then return prior level, otherwise this run's level
- return isRetainedFormatting (wca, start, end) ? levelPrev : level;
+ return isRetainedFormatting(wca, start, end) ? levelPrev : level;
}
- private static void resolveWeak (int[] wca, int defaultLevel, int[] ea, int[] la, int start, int end, int level, int sor, int eor) {
+ private static void resolveWeak(int[] wca, int defaultLevel, int[] ea, int[] la, int start, int end, int level, int sor, int eor) {
// W1 - X BN* NSM -> X BN* X
for (int i = start, n = end, bcPrev = sor; i < n; i++) {
@@ -334,7 +334,7 @@ public final class UnicodeBidiAlgorithm
if (bcPrev == AL) {
wca [ i ] = AN;
}
- } else if (isStrong (bc)) {
+ } else if (isStrong(bc)) {
bcPrev = bc;
}
}
@@ -405,7 +405,7 @@ public final class UnicodeBidiAlgorithm
int bc = wca [ i ];
if ((bc == ET) || (bc == ES) || (bc == CS)) {
wca [ i ] = ON;
- resolveAdjacentBoundaryNeutrals (wca, start, end, i, ON);
+ resolveAdjacentBoundaryNeutrals(wca, start, end, i, ON);
}
}
@@ -423,12 +423,12 @@ public final class UnicodeBidiAlgorithm
}
- private static void resolveNeutrals (int[] wca, int defaultLevel, int[] ea, int[] la, int start, int end, int level, int sor, int eor) {
+ private static void resolveNeutrals(int[] wca, int defaultLevel, int[] ea, int[] la, int start, int end, int level, int sor, int eor) {
// N1 - (L|R) N+ (L|R) -> L L+ L | R R+ R; (AN|EN) N+ R -> (AN|EN) R+ R; R N+ (AN|EN) -> R R+ (AN|EN)
for (int i = start, n = end, bcPrev = sor; i < n; i++) {
int bc = wca [ i ];
- if (isNeutral (bc)) {
+ if (isNeutral(bc)) {
int bcNext = eor;
for (int j = i + 1; j < n; j++) {
bc = wca [ j ];
@@ -438,9 +438,9 @@ public final class UnicodeBidiAlgorithm
} else if ((bc == AN) || (bc == EN)) {
bcNext = R;
break;
- } else if (isNeutral (bc)) {
+ } else if (isNeutral(bc)) {
continue;
- } else if (isRetainedFormatting (bc)) {
+ } else if (isRetainedFormatting(bc)) {
continue;
} else {
break;
@@ -448,7 +448,7 @@ public final class UnicodeBidiAlgorithm
}
if (bcPrev == bcNext) {
wca [ i ] = bcPrev;
- resolveAdjacentBoundaryNeutrals (wca, start, end, i, bcPrev);
+ resolveAdjacentBoundaryNeutrals(wca, start, end, i, bcPrev);
}
} else if ((bc == L) || (bc == R)) {
bcPrev = bc;
@@ -460,16 +460,16 @@ public final class UnicodeBidiAlgorithm
// N2 - N -> embedding level
for (int i = start, n = end; i < n; i++) {
int bc = wca [ i ];
- if (isNeutral (bc)) {
- int bcEmbedding = directionOfLevel (levelOfEmbedding (ea [ i ]));
+ if (isNeutral(bc)) {
+ int bcEmbedding = directionOfLevel(levelOfEmbedding(ea [ i ]));
wca [ i ] = bcEmbedding;
- resolveAdjacentBoundaryNeutrals (wca, start, end, i, bcEmbedding);
+ resolveAdjacentBoundaryNeutrals(wca, start, end, i, bcEmbedding);
}
}
}
- private static void resolveAdjacentBoundaryNeutrals (int[] wca, int start, int end, int index, int bcNew) {
+ private static void resolveAdjacentBoundaryNeutrals(int[] wca, int start, int end, int index, int bcNew) {
if ((index < start) || (index >= end)) {
throw new IllegalArgumentException();
} else {
@@ -492,7 +492,7 @@ public final class UnicodeBidiAlgorithm
}
}
- private static void resolveImplicit (int[] wca, int defaultLevel, int[] ea, int[] la, int start, int end, int level, int sor, int eor) {
+ private static void resolveImplicit(int[] wca, int defaultLevel, int[] ea, int[] la, int start, int end, int level, int sor, int eor) {
for (int i = start, n = end; i < n; i++) {
int bc = wca [ i ]; // bidi class
int el = la [ i ]; // embedding level
@@ -526,7 +526,7 @@ public final class UnicodeBidiAlgorithm
* @param dl default paragraph level
* @param la array of output levels to be adjusted, as produced by bidi algorithm
*/
- private static void resolveSeparators (int[] ica, int[] wca, int dl, int[] la) {
+ private static void resolveSeparators(int[] ica, int[] wca, int dl, int[] la) {
// steps (1) through (3)
for (int i = 0, n = ica.length; i < n; i++) {
int ic = ica[i];
@@ -534,7 +534,7 @@ public final class UnicodeBidiAlgorithm
la[i] = dl;
for (int k = i - 1; k >= 0; k--) {
int pc = ica[k];
- if (isRetainedFormatting (pc)) {
+ if (isRetainedFormatting(pc)) {
continue;
} else if (pc == BidiConstants.WS) {
la[k] = dl;
@@ -548,7 +548,7 @@ public final class UnicodeBidiAlgorithm
for (int i = ica.length; i > 0; i--) {
int k = i - 1;
int ic = ica[k];
- if (isRetainedFormatting (ic)) {
+ if (isRetainedFormatting(ic)) {
continue;
} else if (ic == BidiConstants.WS) {
la[k] = dl;
@@ -559,7 +559,7 @@ public final class UnicodeBidiAlgorithm
// step (5) - per section 5.2
for (int i = 0, n = ica.length; i < n; i++) {
int ic = ica[i];
- if (isRetainedFormatting (ic)) {
+ if (isRetainedFormatting(ic)) {
if (i == 0) {
la[i] = dl;
} else {
@@ -569,7 +569,7 @@ public final class UnicodeBidiAlgorithm
}
}
- private static boolean isStrong (int bc) {
+ private static boolean isStrong(int bc) {
switch (bc) {
case L:
case R:
@@ -580,7 +580,7 @@ public final class UnicodeBidiAlgorithm
}
}
- private static boolean isNeutral (int bc) {
+ private static boolean isNeutral(int bc) {
switch (bc) {
case WS:
case ON:
@@ -592,7 +592,7 @@ public final class UnicodeBidiAlgorithm
}
}
- private static boolean isRetainedFormatting (int bc) {
+ private static boolean isRetainedFormatting(int bc) {
switch (bc) {
case LRE:
case LRO:
@@ -606,16 +606,16 @@ public final class UnicodeBidiAlgorithm
}
}
- private static boolean isRetainedFormatting (int[] ca, int s, int e) {
+ private static boolean isRetainedFormatting(int[] ca, int s, int e) {
for (int i = s; i < e; i++) {
- if (! isRetainedFormatting (ca[i])) {
+ if (! isRetainedFormatting(ca[i])) {
return false;
}
}
return true;
}
- private static int max (int x, int y) {
+ private static int max(int x, int y) {
if (x > y) {
return x;
} else {
@@ -623,13 +623,13 @@ public final class UnicodeBidiAlgorithm
}
}
- private static int[] getClasses (int[] chars) {
+ private static int[] getClasses(int[] chars) {
int[] classes = new int [ chars.length ];
int bc;
for (int i = 0, n = chars.length; i < n; i++) {
int ch = chars [ i ];
if (ch >= 0) {
- bc = BidiClass.getBidiClass (chars [ i ]);
+ bc = BidiClass.getBidiClass(chars [ i ]);
} else {
bc = SURROGATE;
}
@@ -652,13 +652,13 @@ public final class UnicodeBidiAlgorithm
* @throws IllegalArgumentException if the input sequence is not a valid UTF-16 string, e.g.,
* if it contains an isolated UTF-16 surrogate
*/
- private static boolean convertToScalar (CharSequence cs, int[] chars) throws IllegalArgumentException {
+ private static boolean convertToScalar(CharSequence cs, int[] chars) throws IllegalArgumentException {
boolean triggered = false;
if (chars.length != cs.length()) {
- throw new IllegalArgumentException ("characters array length must match input sequence length");
+ throw new IllegalArgumentException("characters array length must match input sequence length");
}
for (int i = 0, n = chars.length; i < n; ) {
- int chIn = cs.charAt (i);
+ int chIn = cs.charAt(i);
int chOut;
if (chIn < 0xD800) {
chOut = chIn;
@@ -666,21 +666,21 @@ public final class UnicodeBidiAlgorithm
int chHi = chIn;
int chLo;
if ((i + 1) < n) {
- chLo = cs.charAt (i + 1);
+ chLo = cs.charAt(i + 1);
if ((chLo >= 0xDC00) && (chLo <= 0xDFFF)) {
- chOut = convertToScalar (chHi, chLo);
+ chOut = convertToScalar(chHi, chLo);
} else {
- throw new IllegalArgumentException ("isolated high surrogate");
+ throw new IllegalArgumentException("isolated high surrogate");
}
} else {
- throw new IllegalArgumentException ("truncated surrogate pair");
+ throw new IllegalArgumentException("truncated surrogate pair");
}
} else if (chIn < 0xE000) {
- throw new IllegalArgumentException ("isolated low surrogate");
+ throw new IllegalArgumentException("isolated low surrogate");
} else {
chOut = chIn;
}
- if (! triggered && triggersBidi (chOut)) {
+ if (! triggered && triggersBidi(chOut)) {
triggered = true;
}
if ((chOut & 0xFF0000) == 0) {
@@ -700,11 +700,11 @@ public final class UnicodeBidiAlgorithm
* @param chLo low (least significant or second) surrogate
* @throws IllegalArgumentException if one of the input surrogates is not valid
*/
- private static int convertToScalar (int chHi, int chLo) {
+ private static int convertToScalar(int chHi, int chLo) {
if ((chHi < 0xD800) || (chHi > 0xDBFF)) {
- throw new IllegalArgumentException ("bad high surrogate");
+ throw new IllegalArgumentException("bad high surrogate");
} else if ((chLo < 0xDC00) || (chLo > 0xDFFF)) {
- throw new IllegalArgumentException ("bad low surrogate");
+ throw new IllegalArgumentException("bad low surrogate");
} else {
return (((chHi & 0x03FF) << 10) | (chLo & 0x03FF)) + 0x10000;
}
@@ -718,8 +718,8 @@ public final class UnicodeBidiAlgorithm
* @return true if character triggers bidirectional processing
* @param ch a unicode scalar value
*/
- private static boolean triggersBidi (int ch) {
- switch (BidiClass.getBidiClass (ch)) {
+ private static boolean triggersBidi(int ch) {
+ switch (BidiClass.getBidiClass(ch)) {
case R:
case AL:
case AN:
@@ -731,38 +731,38 @@ public final class UnicodeBidiAlgorithm
}
}
- private static void dump (String header, int[] chars, int[] classes, int defaultLevel, int[] levels) {
- log.debug (header);
- log.debug ("BD: default level(" + defaultLevel + ")");
+ private static void dump(String header, int[] chars, int[] classes, int defaultLevel, int[] levels) {
+ log.debug(header);
+ log.debug("BD: default level(" + defaultLevel + ")");
StringBuffer sb = new StringBuffer();
if (chars != null) {
for (int i = 0, n = chars.length; i < n; i++) {
int ch = chars [ i ];
sb.setLength(0);
if ((ch > 0x20) && (ch < 0x7F)) {
- sb.append ((char) ch);
+ sb.append((char) ch);
} else {
- sb.append (CharUtilities.charToNCRef (ch));
+ sb.append(CharUtilities.charToNCRef(ch));
}
for (int k = sb.length(); k < 12; k++) {
- sb.append (' ');
+ sb.append(' ');
}
- sb.append (": " + padRight (getClassName (classes[i]), 4) + " " + levels[i]);
- log.debug (sb);
+ sb.append(": " + padRight(getClassName(classes[i]), 4) + " " + levels[i]);
+ log.debug(sb);
}
} else {
for (int i = 0, n = classes.length; i < n; i++) {
sb.setLength(0);
for (int k = sb.length(); k < 12; k++) {
- sb.append (' ');
+ sb.append(' ');
}
- sb.append (": " + padRight (getClassName (classes[i]), 4) + " " + levels[i]);
- log.debug (sb);
+ sb.append(": " + padRight(getClassName(classes[i]), 4) + " " + levels[i]);
+ log.debug(sb);
}
}
}
- private static String getClassName (int bc) {
+ private static String getClassName(int bc) {
switch (bc) {
case L: // left-to-right
return "L";
@@ -809,16 +809,16 @@ public final class UnicodeBidiAlgorithm
}
}
- private static String padLeft (int n, int width) {
- return padLeft (Integer.toString (n), width);
+ private static String padLeft(int n, int width) {
+ return padLeft(Integer.toString(n), width);
}
- private static String padLeft (String s, int width) {
+ private static String padLeft(String s, int width) {
StringBuffer sb = new StringBuffer();
for (int i = s.length(); i < width; i++) {
sb.append(' ');
}
- sb.append (s);
+ sb.append(s);
return sb.toString();
}
@@ -828,8 +828,8 @@ public final class UnicodeBidiAlgorithm
}
*/
- private static String padRight (String s, int width) {
- StringBuffer sb = new StringBuffer (s);
+ private static String padRight(String s, int width) {
+ StringBuffer sb = new StringBuffer(s);
for (int i = sb.length(); i < width; i++) {
sb.append(' ');
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphClassMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphClassMapping.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphClassMapping.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphClassMapping.java Tue May 7 16:23:13 2013
@@ -35,7 +35,7 @@ public interface GlyphClassMapping {
* @param set for coverage set based class mappings, indicates set index, otherwise ignored
* @return size of class table
*/
- int getClassSize (int set);
+ int getClassSize(int set);
/**
* Map glyph identifier (code) to coverge index. Returns -1 if glyph identifier is not in the domain of
@@ -44,6 +44,6 @@ public interface GlyphClassMapping {
* @param set for coverage set based class mappings, indicates set index, otherwise ignored
* @return non-negative glyph class index or -1 if glyph identifiers is not mapped by table
*/
- int getClassIndex (int gid, int set);
+ int getClassIndex(int gid, int set);
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java Tue May 7 16:23:13 2013
@@ -46,7 +46,7 @@ public final class GlyphClassTable exten
private GlyphClassMapping cm;
- private GlyphClassTable (GlyphClassMapping cm) {
+ private GlyphClassTable(GlyphClassMapping cm) {
assert cm != null;
assert cm instanceof GlyphMappingTable;
this.cm = cm;
@@ -63,13 +63,13 @@ public final class GlyphClassTable exten
}
/** {@inheritDoc} */
- public int getClassSize (int set) {
- return cm.getClassSize (set);
+ public int getClassSize(int set) {
+ return cm.getClassSize(set);
}
/** {@inheritDoc} */
- public int getClassIndex (int gid, int set) {
- return cm.getClassIndex (gid, set);
+ public int getClassIndex(int gid, int set) {
+ return cm.getClassIndex(gid, set);
}
/**
@@ -77,24 +77,24 @@ public final class GlyphClassTable exten
* @param entries list of mapped or ranged class entries, or null or empty list
* @return a new covera table instance
*/
- public static GlyphClassTable createClassTable (List entries) {
+ public static GlyphClassTable createClassTable(List entries) {
GlyphClassMapping cm;
if ((entries == null) || (entries.size() == 0)) {
- cm = new EmptyClassTable (entries);
- } else if (isMappedClass (entries)) {
- cm = new MappedClassTable (entries);
- } else if (isRangeClass (entries)) {
- cm = new RangeClassTable (entries);
- } else if (isCoverageSetClass (entries)) {
- cm = new CoverageSetClassTable (entries);
+ cm = new EmptyClassTable(entries);
+ } else if (isMappedClass(entries)) {
+ cm = new MappedClassTable(entries);
+ } else if (isRangeClass(entries)) {
+ cm = new RangeClassTable(entries);
+ } else if (isCoverageSetClass(entries)) {
+ cm = new CoverageSetClassTable(entries);
} else {
cm = null;
}
assert cm != null : "unknown class type";
- return new GlyphClassTable (cm);
+ return new GlyphClassTable(cm);
}
- private static boolean isMappedClass (List entries) {
+ private static boolean isMappedClass(List entries) {
if ((entries == null) || (entries.size() == 0)) {
return false;
} else {
@@ -108,7 +108,7 @@ public final class GlyphClassTable exten
}
}
- private static boolean isRangeClass (List entries) {
+ private static boolean isRangeClass(List entries) {
if ((entries == null) || (entries.size() == 0)) {
return false;
} else {
@@ -122,7 +122,7 @@ public final class GlyphClassTable exten
}
}
- private static boolean isCoverageSetClass (List entries) {
+ private static boolean isCoverageSetClass(List entries) {
if ((entries == null) || (entries.size() == 0)) {
return false;
} else {
@@ -137,15 +137,15 @@ public final class GlyphClassTable exten
}
private static class EmptyClassTable extends GlyphMappingTable.EmptyMappingTable implements GlyphClassMapping {
- public EmptyClassTable (List entries) {
- super (entries);
+ public EmptyClassTable(List entries) {
+ super(entries);
}
/** {@inheritDoc} */
- public int getClassSize (int set) {
+ public int getClassSize(int set) {
return 0;
}
/** {@inheritDoc} */
- public int getClassIndex (int gid, int set) {
+ public int getClassIndex(int gid, int set) {
return -1;
}
}
@@ -154,16 +154,16 @@ public final class GlyphClassTable exten
private int firstGlyph;
private int[] gca;
private int gcMax = -1;
- public MappedClassTable (List entries) {
- populate (entries);
+ public MappedClassTable(List entries) {
+ populate(entries);
}
/** {@inheritDoc} */
public List getEntries() {
List entries = new java.util.ArrayList();
- entries.add (Integer.valueOf (firstGlyph));
+ entries.add(Integer.valueOf(firstGlyph));
if (gca != null) {
for (int i = 0, n = gca.length; i < n; i++) {
- entries.add (Integer.valueOf (gca [ i ]));
+ entries.add(Integer.valueOf(gca [ i ]));
}
}
return entries;
@@ -173,7 +173,7 @@ public final class GlyphClassTable exten
return gcMax + 1;
}
/** {@inheritDoc} */
- public int getMappedIndex (int gid) {
+ public int getMappedIndex(int gid) {
int i = gid - firstGlyph;
if ((i >= 0) && (i < gca.length)) {
return gca [ i ];
@@ -182,14 +182,14 @@ public final class GlyphClassTable exten
}
}
/** {@inheritDoc} */
- public int getClassSize (int set) {
+ public int getClassSize(int set) {
return getMappingSize();
}
/** {@inheritDoc} */
- public int getClassIndex (int gid, int set) {
- return getMappedIndex (gid);
+ public int getClassIndex(int gid, int set) {
+ return getMappedIndex(gid);
}
- private void populate (List entries) {
+ private void populate(List entries) {
// obtain entries iterator
Iterator it = entries.iterator();
// extract first glyph
@@ -199,7 +199,7 @@ public final class GlyphClassTable exten
if (o instanceof Integer) {
firstGlyph = ((Integer) o) . intValue();
} else {
- throw new AdvancedTypographicTableFormatException ("illegal entry, first entry must be Integer denoting first glyph value, but is: " + o);
+ throw new AdvancedTypographicTableFormatException("illegal entry, first entry must be Integer denoting first glyph value, but is: " + o);
}
}
// extract glyph class array
@@ -216,7 +216,7 @@ public final class GlyphClassTable exten
gcMax = gc;
}
} else {
- throw new AdvancedTypographicTableFormatException ("illegal mapping entry, must be Integer: " + o);
+ throw new AdvancedTypographicTableFormatException("illegal mapping entry, must be Integer: " + o);
}
}
assert i == n;
@@ -233,7 +233,7 @@ public final class GlyphClassTable exten
if (i > 0) {
sb.append(',');
}
- sb.append (Integer.toString (gca [ i ]));
+ sb.append(Integer.toString(gca [ i ]));
}
sb.append("} }");
return sb.toString();
@@ -241,37 +241,37 @@ public final class GlyphClassTable exten
}
private static class RangeClassTable extends GlyphMappingTable.RangeMappingTable implements GlyphClassMapping {
- public RangeClassTable (List entries) {
- super (entries);
+ public RangeClassTable(List entries) {
+ super(entries);
}
/** {@inheritDoc} */
- public int getMappedIndex (int gid, int s, int m) {
+ public int getMappedIndex(int gid, int s, int m) {
return m;
}
/** {@inheritDoc} */
- public int getClassSize (int set) {
+ public int getClassSize(int set) {
return getMappingSize();
}
/** {@inheritDoc} */
- public int getClassIndex (int gid, int set) {
- return getMappedIndex (gid);
+ public int getClassIndex(int gid, int set) {
+ return getMappedIndex(gid);
}
}
private static class CoverageSetClassTable extends GlyphMappingTable.EmptyMappingTable implements GlyphClassMapping {
- public CoverageSetClassTable (List entries) {
- throw new UnsupportedOperationException ("coverage set class table not yet supported");
+ public CoverageSetClassTable(List entries) {
+ throw new UnsupportedOperationException("coverage set class table not yet supported");
}
/** {@inheritDoc} */
public int getType() {
return GLYPH_CLASS_TYPE_COVERAGE_SET;
}
/** {@inheritDoc} */
- public int getClassSize (int set) {
+ public int getClassSize(int set) {
return 0;
}
/** {@inheritDoc} */
- public int getClassIndex (int gid, int set) {
+ public int getClassIndex(int gid, int set) {
return -1;
}
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphCoverageMapping.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphCoverageMapping.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphCoverageMapping.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphCoverageMapping.java Tue May 7 16:23:13 2013
@@ -42,6 +42,6 @@ public interface GlyphCoverageMapping {
* @param gid glyph identifier (code)
* @return non-negative glyph coverage index or -1 if glyph identifiers is not mapped by table
*/
- int getCoverageIndex (int gid);
+ int getCoverageIndex(int gid);
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphCoverageTable.java Tue May 7 16:23:13 2013
@@ -51,7 +51,7 @@ public final class GlyphCoverageTable ex
private GlyphCoverageMapping cm;
- private GlyphCoverageTable (GlyphCoverageMapping cm) {
+ private GlyphCoverageTable(GlyphCoverageMapping cm) {
assert cm != null;
assert cm instanceof GlyphMappingTable;
this.cm = cm;
@@ -73,8 +73,8 @@ public final class GlyphCoverageTable ex
}
/** {@inheritDoc} */
- public int getCoverageIndex (int gid) {
- return cm.getCoverageIndex (gid);
+ public int getCoverageIndex(int gid) {
+ return cm.getCoverageIndex(gid);
}
/**
@@ -82,22 +82,22 @@ public final class GlyphCoverageTable ex
* @param entries list of mapped or ranged coverage entries, or null or empty list
* @return a new covera table instance
*/
- public static GlyphCoverageTable createCoverageTable (List entries) {
+ public static GlyphCoverageTable createCoverageTable(List entries) {
GlyphCoverageMapping cm;
if ((entries == null) || (entries.size() == 0)) {
- cm = new EmptyCoverageTable (entries);
- } else if (isMappedCoverage (entries)) {
- cm = new MappedCoverageTable (entries);
- } else if (isRangeCoverage (entries)) {
- cm = new RangeCoverageTable (entries);
+ cm = new EmptyCoverageTable(entries);
+ } else if (isMappedCoverage(entries)) {
+ cm = new MappedCoverageTable(entries);
+ } else if (isRangeCoverage(entries)) {
+ cm = new RangeCoverageTable(entries);
} else {
cm = null;
}
assert cm != null : "unknown coverage type";
- return new GlyphCoverageTable (cm);
+ return new GlyphCoverageTable(cm);
}
- private static boolean isMappedCoverage (List entries) {
+ private static boolean isMappedCoverage(List entries) {
if ((entries == null) || (entries.size() == 0)) {
return false;
} else {
@@ -111,7 +111,7 @@ public final class GlyphCoverageTable ex
}
}
- private static boolean isRangeCoverage (List entries) {
+ private static boolean isRangeCoverage(List entries) {
if ((entries == null) || (entries.size() == 0)) {
return false;
} else {
@@ -126,30 +126,30 @@ public final class GlyphCoverageTable ex
}
private static class EmptyCoverageTable extends GlyphMappingTable.EmptyMappingTable implements GlyphCoverageMapping {
- public EmptyCoverageTable (List entries) {
- super (entries);
+ public EmptyCoverageTable(List entries) {
+ super(entries);
}
/** {@inheritDoc} */
public int getCoverageSize() {
return 0;
}
/** {@inheritDoc} */
- public int getCoverageIndex (int gid) {
+ public int getCoverageIndex(int gid) {
return -1;
}
}
private static class MappedCoverageTable extends GlyphMappingTable.MappedMappingTable implements GlyphCoverageMapping {
private int[] map;
- public MappedCoverageTable (List entries) {
- populate (entries);
+ public MappedCoverageTable(List entries) {
+ populate(entries);
}
/** {@inheritDoc} */
public List getEntries() {
List entries = new java.util.ArrayList();
if (map != null) {
for (int i = 0, n = map.length; i < n; i++) {
- entries.add (Integer.valueOf (map [ i ]));
+ entries.add(Integer.valueOf(map [ i ]));
}
}
return entries;
@@ -158,9 +158,9 @@ public final class GlyphCoverageTable ex
public int getMappingSize() {
return (map != null) ? map.length : 0;
}
- public int getMappedIndex (int gid) {
+ public int getMappedIndex(int gid) {
int i;
- if ((i = Arrays.binarySearch (map, gid)) >= 0) {
+ if ((i = Arrays.binarySearch(map, gid)) >= 0) {
return i;
} else {
return -1;
@@ -171,10 +171,10 @@ public final class GlyphCoverageTable ex
return getMappingSize();
}
/** {@inheritDoc} */
- public int getCoverageIndex (int gid) {
- return getMappedIndex (gid);
+ public int getCoverageIndex(int gid) {
+ return getMappedIndex(gid);
}
- private void populate (List entries) {
+ private void populate(List entries) {
int i = 0;
int skipped = 0;
int n = entries.size();
@@ -188,14 +188,14 @@ public final class GlyphCoverageTable ex
if (gid > gidMax) {
map [ i++ ] = gidMax = gid;
} else {
- log.info ("ignoring out of order or duplicate glyph index: " + gid);
+ log.info("ignoring out of order or duplicate glyph index: " + gid);
skipped++;
}
} else {
- throw new AdvancedTypographicTableFormatException ("illegal glyph index: " + gid);
+ throw new AdvancedTypographicTableFormatException("illegal glyph index: " + gid);
}
} else {
- throw new AdvancedTypographicTableFormatException ("illegal coverage entry, must be Integer: " + o);
+ throw new AdvancedTypographicTableFormatException("illegal coverage entry, must be Integer: " + o);
}
}
assert (i + skipped) == n;
@@ -210,7 +210,7 @@ public final class GlyphCoverageTable ex
if (i > 0) {
sb.append(',');
}
- sb.append (Integer.toString (map [ i ]));
+ sb.append(Integer.toString(map [ i ]));
}
sb.append('}');
return sb.toString();
@@ -218,11 +218,11 @@ public final class GlyphCoverageTable ex
}
private static class RangeCoverageTable extends GlyphMappingTable.RangeMappingTable implements GlyphCoverageMapping {
- public RangeCoverageTable (List entries) {
- super (entries);
+ public RangeCoverageTable(List entries) {
+ super(entries);
}
/** {@inheritDoc} */
- public int getMappedIndex (int gid, int s, int m) {
+ public int getMappedIndex(int gid, int s, int m) {
return m + gid - s;
}
/** {@inheritDoc} */
@@ -230,8 +230,8 @@ public final class GlyphCoverageTable ex
return getMappingSize();
}
/** {@inheritDoc} */
- public int getCoverageIndex (int gid) {
- return getMappedIndex (gid);
+ public int getCoverageIndex(int gid) {
+ return getMappedIndex(gid);
}
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinition.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinition.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinition.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinition.java Tue May 7 16:23:13 2013
@@ -34,6 +34,6 @@ public interface GlyphDefinition {
* @param gi a glyph index
* @return true if some (unspecified) definition is available for the specified glyph
*/
- boolean hasDefinition (int gi);
+ boolean hasDefinition(int gi);
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionSubtable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionSubtable.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionSubtable.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionSubtable.java Tue May 7 16:23:13 2013
@@ -38,8 +38,8 @@ public abstract class GlyphDefinitionSub
* @param format subtable format
* @param mapping subtable coverage table
*/
- protected GlyphDefinitionSubtable (String id, int sequence, int flags, int format, GlyphMappingTable mapping) {
- super (id, sequence, flags, format, mapping);
+ protected GlyphDefinitionSubtable(String id, int sequence, int flags, int format, GlyphMappingTable mapping) {
+ super(id, sequence, flags, format, mapping);
}
/** {@inheritDoc} */
@@ -49,7 +49,7 @@ public abstract class GlyphDefinitionSub
/** {@inheritDoc} */
public String getTypeName() {
- return GlyphDefinitionTable.getLookupTypeName (getType());
+ return GlyphDefinitionTable.getLookupTypeName(getType());
}
/** {@inheritDoc} */
@@ -58,16 +58,16 @@ public abstract class GlyphDefinitionSub
}
/** {@inheritDoc} */
- public boolean hasDefinition (int gi) {
+ public boolean hasDefinition(int gi) {
GlyphCoverageMapping cvm;
if ((cvm = getCoverage()) != null) {
- if (cvm.getCoverageIndex (gi) >= 0) {
+ if (cvm.getCoverageIndex(gi) >= 0) {
return true;
}
}
GlyphClassMapping clm;
if ((clm = getClasses()) != null) {
- if (clm.getClassIndex (gi, 0) >= 0) {
+ if (clm.getClassIndex(gi, 0) >= 0) {
return true;
}
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionTable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionTable.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionTable.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionTable.java Tue May 7 16:23:13 2013
@@ -74,17 +74,17 @@ public class GlyphDefinitionTable extend
* Instantiate a <code>GlyphDefinitionTable</code> object using the specified subtables.
* @param subtables a list of identified subtables
*/
- public GlyphDefinitionTable (List subtables) {
- super (null, new HashMap(0));
+ public GlyphDefinitionTable(List subtables) {
+ super(null, new HashMap(0));
if ((subtables == null) || (subtables.size() == 0)) {
- throw new AdvancedTypographicTableFormatException ("subtables must be non-empty");
+ throw new AdvancedTypographicTableFormatException("subtables must be non-empty");
} else {
for (Iterator it = subtables.iterator(); it.hasNext();) {
Object o = it.next();
if (o instanceof GlyphDefinitionSubtable) {
- addSubtable ((GlyphSubtable) o);
+ addSubtable((GlyphSubtable) o);
} else {
- throw new AdvancedTypographicTableFormatException ("subtable must be a glyph definition subtable");
+ throw new AdvancedTypographicTableFormatException("subtable must be a glyph definition subtable");
}
}
freezeSubtables();
@@ -102,13 +102,13 @@ public class GlyphDefinitionTable extend
* @param language a language identifier
* @return the reordered (output) glyph sequence
*/
- public GlyphSequence reorderCombiningMarks (GlyphSequence gs, int[][] gpa, String script, String language) {
- ScriptProcessor sp = ScriptProcessor.getInstance (script);
- return sp.reorderCombiningMarks (this, gs, gpa, script, language);
+ public GlyphSequence reorderCombiningMarks(GlyphSequence gs, int[][] gpa, String script, String language) {
+ ScriptProcessor sp = ScriptProcessor.getInstance(script);
+ return sp.reorderCombiningMarks(this, gs, gpa, script, language);
}
/** {@inheritDoc} */
- protected void addSubtable (GlyphSubtable subtable) {
+ protected void addSubtable(GlyphSubtable subtable) {
if (subtable instanceof GlyphClassSubtable) {
this.gct = (GlyphClassSubtable) subtable;
} else if (subtable instanceof AttachmentPointSubtable) {
@@ -120,7 +120,7 @@ public class GlyphDefinitionTable extend
} else if (subtable instanceof MarkAttachmentSubtable) {
this.mat = (MarkAttachmentSubtable) subtable;
} else {
- throw new UnsupportedOperationException ("unsupported glyph definition subtable type: " + subtable);
+ throw new UnsupportedOperationException("unsupported glyph definition subtable type: " + subtable);
}
}
@@ -130,9 +130,9 @@ public class GlyphDefinitionTable extend
* @param gc a pre-defined glyph class (GLYPH_CLASS_BASE|GLYPH_CLASS_LIGATURE|GLYPH_CLASS_MARK|GLYPH_CLASS_COMPONENT).
* @return true if glyph belongs to specified glyph class
*/
- public boolean isGlyphClass (int gid, int gc) {
+ public boolean isGlyphClass(int gid, int gc) {
if (gct != null) {
- return gct.isGlyphClass (gid, gc);
+ return gct.isGlyphClass(gid, gc);
} else {
return false;
}
@@ -143,9 +143,9 @@ public class GlyphDefinitionTable extend
* @param gid a glyph identifier (index)
* @return a pre-defined glyph class (GLYPH_CLASS_BASE|GLYPH_CLASS_LIGATURE|GLYPH_CLASS_MARK|GLYPH_CLASS_COMPONENT).
*/
- public int getGlyphClass (int gid) {
+ public int getGlyphClass(int gid) {
if (gct != null) {
- return gct.getGlyphClass (gid);
+ return gct.getGlyphClass(gid);
} else {
return -1;
}
@@ -157,9 +157,9 @@ public class GlyphDefinitionTable extend
* @param mac a (font specific) mark attachment class
* @return true if glyph belongs to specified mark attachment class
*/
- public boolean isMarkAttachClass (int gid, int mac) {
+ public boolean isMarkAttachClass(int gid, int mac) {
if (mat != null) {
- return mat.isMarkAttachClass (gid, mac);
+ return mat.isMarkAttachClass(gid, mac);
} else {
return false;
}
@@ -170,9 +170,9 @@ public class GlyphDefinitionTable extend
* @param gid a glyph identifier (index)
* @return a non-negative mark attachment class, or -1 if no class defined
*/
- public int getMarkAttachClass (int gid) {
+ public int getMarkAttachClass(int gid) {
if (mat != null) {
- return mat.getMarkAttachClass (gid);
+ return mat.getMarkAttachClass(gid);
} else {
return -1;
}
@@ -183,16 +183,16 @@ public class GlyphDefinitionTable extend
* @param name lookup type name
* @return lookup type
*/
- public static int getLookupTypeFromName (String name) {
+ public static int getLookupTypeFromName(String name) {
int t;
String s = name.toLowerCase();
- if ("glyphclass".equals (s)) {
+ if ("glyphclass".equals(s)) {
t = GDEF_LOOKUP_TYPE_GLYPH_CLASS;
- } else if ("attachmentpoint".equals (s)) {
+ } else if ("attachmentpoint".equals(s)) {
t = GDEF_LOOKUP_TYPE_ATTACHMENT_POINT;
- } else if ("ligaturecaret".equals (s)) {
+ } else if ("ligaturecaret".equals(s)) {
t = GDEF_LOOKUP_TYPE_LIGATURE_CARET;
- } else if ("markattachment".equals (s)) {
+ } else if ("markattachment".equals(s)) {
t = GDEF_LOOKUP_TYPE_MARK_ATTACHMENT;
} else {
t = -1;
@@ -205,7 +205,7 @@ public class GlyphDefinitionTable extend
* @param type lookup type
* @return lookup type name
*/
- public static String getLookupTypeName (int type) {
+ public static String getLookupTypeName(int type) {
String tn = null;
switch (type) {
case GDEF_LOOKUP_TYPE_GLYPH_CLASS:
@@ -238,20 +238,20 @@ public class GlyphDefinitionTable extend
* @param entries subtable entries
* @return a glyph subtable instance
*/
- public static GlyphSubtable createSubtable (int type, String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
+ public static GlyphSubtable createSubtable(int type, String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
GlyphSubtable st = null;
switch (type) {
case GDEF_LOOKUP_TYPE_GLYPH_CLASS:
- st = GlyphClassSubtable.create (id, sequence, flags, format, mapping, entries);
+ st = GlyphClassSubtable.create(id, sequence, flags, format, mapping, entries);
break;
case GDEF_LOOKUP_TYPE_ATTACHMENT_POINT:
- st = AttachmentPointSubtable.create (id, sequence, flags, format, mapping, entries);
+ st = AttachmentPointSubtable.create(id, sequence, flags, format, mapping, entries);
break;
case GDEF_LOOKUP_TYPE_LIGATURE_CARET:
- st = LigatureCaretSubtable.create (id, sequence, flags, format, mapping, entries);
+ st = LigatureCaretSubtable.create(id, sequence, flags, format, mapping, entries);
break;
case GDEF_LOOKUP_TYPE_MARK_ATTACHMENT:
- st = MarkAttachmentSubtable.create (id, sequence, flags, format, mapping, entries);
+ st = MarkAttachmentSubtable.create(id, sequence, flags, format, mapping, entries);
break;
default:
break;
@@ -260,8 +260,8 @@ public class GlyphDefinitionTable extend
}
private abstract static class GlyphClassSubtable extends GlyphDefinitionSubtable {
- GlyphClassSubtable (String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
- super (id, sequence, flags, format, mapping);
+ GlyphClassSubtable(String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
+ super(id, sequence, flags, format, mapping);
}
/** {@inheritDoc} */
public int getType() {
@@ -273,16 +273,16 @@ public class GlyphDefinitionTable extend
* @param gc a pre-defined glyph class (GLYPH_CLASS_BASE|GLYPH_CLASS_LIGATURE|GLYPH_CLASS_MARK|GLYPH_CLASS_COMPONENT).
* @return true if glyph belongs to specified glyph class
*/
- public abstract boolean isGlyphClass (int gid, int gc);
+ public abstract boolean isGlyphClass(int gid, int gc);
/**
* Determine glyph class.
* @param gid a glyph identifier (index)
* @return a pre-defined glyph class (GLYPH_CLASS_BASE|GLYPH_CLASS_LIGATURE|GLYPH_CLASS_MARK|GLYPH_CLASS_COMPONENT).
*/
- public abstract int getGlyphClass (int gid);
- static GlyphDefinitionSubtable create (String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
+ public abstract int getGlyphClass(int gid);
+ static GlyphDefinitionSubtable create(String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
if (format == 1) {
- return new GlyphClassSubtableFormat1 (id, sequence, flags, format, mapping, entries);
+ return new GlyphClassSubtableFormat1(id, sequence, flags, format, mapping, entries);
} else {
throw new UnsupportedOperationException();
}
@@ -290,31 +290,31 @@ public class GlyphDefinitionTable extend
}
private static class GlyphClassSubtableFormat1 extends GlyphClassSubtable {
- GlyphClassSubtableFormat1 (String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
- super (id, sequence, flags, format, mapping, entries);
+ GlyphClassSubtableFormat1(String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
+ super(id, sequence, flags, format, mapping, entries);
}
/** {@inheritDoc} */
public List getEntries() {
return null;
}
/** {@inheritDoc} */
- public boolean isCompatible (GlyphSubtable subtable) {
+ public boolean isCompatible(GlyphSubtable subtable) {
return subtable instanceof GlyphClassSubtable;
}
/** {@inheritDoc} */
- public boolean isGlyphClass (int gid, int gc) {
+ public boolean isGlyphClass(int gid, int gc) {
GlyphClassMapping cm = getClasses();
if (cm != null) {
- return cm.getClassIndex (gid, 0) == gc;
+ return cm.getClassIndex(gid, 0) == gc;
} else {
return false;
}
}
/** {@inheritDoc} */
- public int getGlyphClass (int gid) {
+ public int getGlyphClass(int gid) {
GlyphClassMapping cm = getClasses();
if (cm != null) {
- return cm.getClassIndex (gid, 0);
+ return cm.getClassIndex(gid, 0);
} else {
return -1;
}
@@ -322,16 +322,16 @@ public class GlyphDefinitionTable extend
}
private abstract static class AttachmentPointSubtable extends GlyphDefinitionSubtable {
- AttachmentPointSubtable (String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
- super (id, sequence, flags, format, mapping);
+ AttachmentPointSubtable(String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
+ super(id, sequence, flags, format, mapping);
}
/** {@inheritDoc} */
public int getType() {
return GDEF_LOOKUP_TYPE_ATTACHMENT_POINT;
}
- static GlyphDefinitionSubtable create (String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
+ static GlyphDefinitionSubtable create(String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
if (format == 1) {
- return new AttachmentPointSubtableFormat1 (id, sequence, flags, format, mapping, entries);
+ return new AttachmentPointSubtableFormat1(id, sequence, flags, format, mapping, entries);
} else {
throw new UnsupportedOperationException();
}
@@ -339,30 +339,30 @@ public class GlyphDefinitionTable extend
}
private static class AttachmentPointSubtableFormat1 extends AttachmentPointSubtable {
- AttachmentPointSubtableFormat1 (String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
- super (id, sequence, flags, format, mapping, entries);
+ AttachmentPointSubtableFormat1(String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
+ super(id, sequence, flags, format, mapping, entries);
}
/** {@inheritDoc} */
public List getEntries() {
return null;
}
/** {@inheritDoc} */
- public boolean isCompatible (GlyphSubtable subtable) {
+ public boolean isCompatible(GlyphSubtable subtable) {
return subtable instanceof AttachmentPointSubtable;
}
}
private abstract static class LigatureCaretSubtable extends GlyphDefinitionSubtable {
- LigatureCaretSubtable (String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
- super (id, sequence, flags, format, mapping);
+ LigatureCaretSubtable(String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
+ super(id, sequence, flags, format, mapping);
}
/** {@inheritDoc} */
public int getType() {
return GDEF_LOOKUP_TYPE_LIGATURE_CARET;
}
- static GlyphDefinitionSubtable create (String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
+ static GlyphDefinitionSubtable create(String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
if (format == 1) {
- return new LigatureCaretSubtableFormat1 (id, sequence, flags, format, mapping, entries);
+ return new LigatureCaretSubtableFormat1(id, sequence, flags, format, mapping, entries);
} else {
throw new UnsupportedOperationException();
}
@@ -370,22 +370,22 @@ public class GlyphDefinitionTable extend
}
private static class LigatureCaretSubtableFormat1 extends LigatureCaretSubtable {
- LigatureCaretSubtableFormat1 (String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
- super (id, sequence, flags, format, mapping, entries);
+ LigatureCaretSubtableFormat1(String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
+ super(id, sequence, flags, format, mapping, entries);
}
/** {@inheritDoc} */
public List getEntries() {
return null;
}
/** {@inheritDoc} */
- public boolean isCompatible (GlyphSubtable subtable) {
+ public boolean isCompatible(GlyphSubtable subtable) {
return subtable instanceof LigatureCaretSubtable;
}
}
private abstract static class MarkAttachmentSubtable extends GlyphDefinitionSubtable {
- MarkAttachmentSubtable (String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
- super (id, sequence, flags, format, mapping);
+ MarkAttachmentSubtable(String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
+ super(id, sequence, flags, format, mapping);
}
/** {@inheritDoc} */
public int getType() {
@@ -397,16 +397,16 @@ public class GlyphDefinitionTable extend
* @param mac a (font specific) mark attachment class
* @return true if glyph belongs to specified mark attachment class
*/
- public abstract boolean isMarkAttachClass (int gid, int mac);
+ public abstract boolean isMarkAttachClass(int gid, int mac);
/**
* Determine mark attachment class.
* @param gid a glyph identifier (index)
* @return a non-negative mark attachment class, or -1 if no class defined
*/
- public abstract int getMarkAttachClass (int gid);
- static GlyphDefinitionSubtable create (String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
+ public abstract int getMarkAttachClass(int gid);
+ static GlyphDefinitionSubtable create(String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
if (format == 1) {
- return new MarkAttachmentSubtableFormat1 (id, sequence, flags, format, mapping, entries);
+ return new MarkAttachmentSubtableFormat1(id, sequence, flags, format, mapping, entries);
} else {
throw new UnsupportedOperationException();
}
@@ -414,31 +414,31 @@ public class GlyphDefinitionTable extend
}
private static class MarkAttachmentSubtableFormat1 extends MarkAttachmentSubtable {
- MarkAttachmentSubtableFormat1 (String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
- super (id, sequence, flags, format, mapping, entries);
+ MarkAttachmentSubtableFormat1(String id, int sequence, int flags, int format, GlyphMappingTable mapping, List entries) {
+ super(id, sequence, flags, format, mapping, entries);
}
/** {@inheritDoc} */
public List getEntries() {
return null;
}
/** {@inheritDoc} */
- public boolean isCompatible (GlyphSubtable subtable) {
+ public boolean isCompatible(GlyphSubtable subtable) {
return subtable instanceof MarkAttachmentSubtable;
}
/** {@inheritDoc} */
- public boolean isMarkAttachClass (int gid, int mac) {
+ public boolean isMarkAttachClass(int gid, int mac) {
GlyphClassMapping cm = getClasses();
if (cm != null) {
- return cm.getClassIndex (gid, 0) == mac;
+ return cm.getClassIndex(gid, 0) == mac;
} else {
return false;
}
}
/** {@inheritDoc} */
- public int getMarkAttachClass (int gid) {
+ public int getMarkAttachClass(int gid) {
GlyphClassMapping cm = getClasses();
if (cm != null) {
- return cm.getClassIndex (gid, 0);
+ return cm.getClassIndex(gid, 0);
} else {
return -1;
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphMappingTable.java Tue May 7 16:23:13 2013
@@ -76,7 +76,7 @@ public class GlyphMappingTable {
* @param gid glyph identifier (code)
* @return non-negative glyph mapping index or -1 if glyph identifiers is not mapped by table
*/
- public int getMappedIndex (int gid) {
+ public int getMappedIndex(int gid) {
return -1;
}
@@ -92,7 +92,7 @@ public class GlyphMappingTable {
* Construct empty mapping table with entries (ignored).
* @param entries list of entries (ignored)
*/
- public EmptyMappingTable (List entries) {
+ public EmptyMappingTable(List entries) {
}
/** {@inheritDoc} */
public int getType() {
@@ -107,7 +107,7 @@ public class GlyphMappingTable {
return 0;
}
/** {@inheritDoc} */
- public int getMappedIndex (int gid) {
+ public int getMappedIndex(int gid) {
return -1;
}
}
@@ -135,8 +135,8 @@ public class GlyphMappingTable {
* Construct range mapping table.
* @param entries of mapping ranges
*/
- public RangeMappingTable (List entries) {
- populate (entries);
+ public RangeMappingTable(List entries) {
+ populate(entries);
}
/** {@inheritDoc} */
public int getType() {
@@ -147,7 +147,7 @@ public class GlyphMappingTable {
List entries = new java.util.ArrayList();
if (sa != null) {
for (int i = 0, n = sa.length; i < n; i++) {
- entries.add (new MappingRange (sa [ i ], ea [ i ], ma [ i ]));
+ entries.add(new MappingRange(sa [ i ], ea [ i ], ma [ i ]));
}
}
return entries;
@@ -157,17 +157,17 @@ public class GlyphMappingTable {
return miMax + 1;
}
/** {@inheritDoc} */
- public int getMappedIndex (int gid) {
+ public int getMappedIndex(int gid) {
int i;
int mi;
- if ((i = Arrays.binarySearch (sa, gid)) >= 0) {
- mi = getMappedIndex (gid, sa [ i ], ma [ i ]); // matches start of (some) range
+ if ((i = Arrays.binarySearch(sa, gid)) >= 0) {
+ mi = getMappedIndex(gid, sa [ i ], ma [ i ]); // matches start of (some) range
} else if ((i = - (i + 1)) == 0) {
mi = -1; // precedes first range
} else if (gid > ea [ --i ]) {
mi = -1; // follows preceding (or last) range
} else {
- mi = getMappedIndex (gid, sa [ i ], ma [ i ]); // intersects (some) range
+ mi = getMappedIndex(gid, sa [ i ], ma [ i ]); // intersects (some) range
}
return mi;
}
@@ -179,8 +179,8 @@ public class GlyphMappingTable {
* @param m mapping value
* @return non-negative glyph mapping index or -1 if glyph identifiers is not mapped by table
*/
- public abstract int getMappedIndex (int gid, int s, int m);
- private void populate (List entries) {
+ public abstract int getMappedIndex(int gid, int s, int m);
+ private void populate(List entries) {
int i = 0;
int n = entries.size();
int gidMax = -1;
@@ -196,15 +196,15 @@ public class GlyphMappingTable {
int ge = r.getEnd();
int mi = r.getIndex();
if ((gs < 0) || (gs > 65535)) {
- throw new AdvancedTypographicTableFormatException ("illegal glyph range: [" + gs + "," + ge + "]: bad start index");
+ throw new AdvancedTypographicTableFormatException("illegal glyph range: [" + gs + "," + ge + "]: bad start index");
} else if ((ge < 0) || (ge > 65535)) {
- throw new AdvancedTypographicTableFormatException ("illegal glyph range: [" + gs + "," + ge + "]: bad end index");
+ throw new AdvancedTypographicTableFormatException("illegal glyph range: [" + gs + "," + ge + "]: bad end index");
} else if (gs > ge) {
- throw new AdvancedTypographicTableFormatException ("illegal glyph range: [" + gs + "," + ge + "]: start index exceeds end index");
+ throw new AdvancedTypographicTableFormatException("illegal glyph range: [" + gs + "," + ge + "]: start index exceeds end index");
} else if (gs < gidMax) {
- throw new AdvancedTypographicTableFormatException ("out of order glyph range: [" + gs + "," + ge + "]");
+ throw new AdvancedTypographicTableFormatException("out of order glyph range: [" + gs + "," + ge + "]");
} else if (mi < 0) {
- throw new AdvancedTypographicTableFormatException ("illegal mapping index: " + mi);
+ throw new AdvancedTypographicTableFormatException("illegal mapping index: " + mi);
} else {
int miLast;
sa [ i ] = gs;
@@ -216,7 +216,7 @@ public class GlyphMappingTable {
i++;
}
} else {
- throw new AdvancedTypographicTableFormatException ("illegal mapping entry, must be Integer: " + o);
+ throw new AdvancedTypographicTableFormatException("illegal mapping entry, must be Integer: " + o);
}
}
assert i == n;
@@ -236,11 +236,11 @@ public class GlyphMappingTable {
if (i > 0) {
sb.append(',');
}
- sb.append ('[');
- sb.append (Integer.toString (sa [ i ]));
- sb.append (Integer.toString (ea [ i ]));
- sb.append ("]:");
- sb.append (Integer.toString (ma [ i ]));
+ sb.append('[');
+ sb.append(Integer.toString(sa [ i ]));
+ sb.append(Integer.toString(ea [ i ]));
+ sb.append("]:");
+ sb.append(Integer.toString(ma [ i ]));
}
sb.append('}');
return sb.toString();
@@ -270,7 +270,7 @@ public class GlyphMappingTable {
* @param gidEnd end of range
* @param index mapping index
*/
- public MappingRange (int gidStart, int gidEnd, int index) {
+ public MappingRange(int gidStart, int gidEnd, int index) {
if ((gidStart < 0) || (gidEnd < 0) || (index < 0)) {
throw new AdvancedTypographicTableFormatException();
} else if (gidStart > gidEnd) {
@@ -307,7 +307,7 @@ public class GlyphMappingTable {
* @param interval an array of length two or greater or null
* @return interval as a pair of integers, filled into specified array
*/
- public int[] getInterval (int[] interval) {
+ public int[] getInterval(int[] interval) {
if ((interval == null) || (interval.length != 2)) {
throw new IllegalArgumentException();
} else {
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioning.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioning.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioning.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioning.java Tue May 7 16:23:13 2013
@@ -39,6 +39,6 @@ public interface GlyphPositioning {
* adjustment occurred; it only means that no further glyph subtables for the current lookup table
* should be applied.
*/
- boolean position (GlyphPositioningState ps);
+ boolean position(GlyphPositioningState ps);
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningState.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningState.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningState.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningState.java Tue May 7 16:23:13 2013
@@ -60,8 +60,8 @@ public class GlyphPositioningState exten
* @param adjustments positioning adjustments to which positioning is applied
* @param sct script context tester (or null)
*/
- public GlyphPositioningState (GlyphSequence gs, String script, String language, String feature, int fontSize, int[] widths, int[][] adjustments, ScriptContextTester sct) {
- super (gs, script, language, feature, sct);
+ public GlyphPositioningState(GlyphSequence gs, String script, String language, String feature, int fontSize, int[] widths, int[][] adjustments, ScriptContextTester sct) {
+ super(gs, script, language, feature, sct);
this.fontSize = fontSize;
this.widths = widths;
this.adjustments = adjustments;
@@ -72,8 +72,8 @@ public class GlyphPositioningState exten
* except as follows: input glyph sequence is copied deep except for its characters array.
* @param ps existing positioning state to copy from
*/
- public GlyphPositioningState (GlyphPositioningState ps) {
- super (ps);
+ public GlyphPositioningState(GlyphPositioningState ps) {
+ super(ps);
this.fontSize = ps.fontSize;
this.widths = ps.widths;
this.adjustments = ps.adjustments;
@@ -90,8 +90,8 @@ public class GlyphPositioningState exten
* @param adjustments positioning adjustments to which positioning is applied
* @param sct script context tester (or null)
*/
- public GlyphPositioningState reset (GlyphSequence gs, String script, String language, String feature, int fontSize, int[] widths, int[][] adjustments, ScriptContextTester sct) {
- super.reset (gs, script, language, feature, sct);
+ public GlyphPositioningState reset(GlyphSequence gs, String script, String language, String feature, int fontSize, int[] widths, int[][] adjustments, ScriptContextTester sct) {
+ super.reset(gs, script, language, feature, sct);
this.fontSize = fontSize;
this.widths = widths;
this.adjustments = adjustments;
@@ -104,7 +104,7 @@ public class GlyphPositioningState exten
* @param gi glyph index
* @return design advancement, or zero if glyph index is not present
*/
- public int getWidth (int gi) {
+ public int getWidth(int gi) {
if ((widths != null) && (gi < widths.length)) {
return widths [ gi ];
} else {
@@ -117,8 +117,8 @@ public class GlyphPositioningState exten
* @param v value containing adjustments
* @return true if a non-zero adjustment was made
*/
- public boolean adjust (GlyphPositioningTable.Value v) {
- return adjust (v, 0);
+ public boolean adjust(GlyphPositioningTable.Value v) {
+ return adjust(v, 0);
}
/**
@@ -127,10 +127,10 @@ public class GlyphPositioningState exten
* @param offset from current position index
* @return true if a non-zero adjustment was made
*/
- public boolean adjust (GlyphPositioningTable.Value v, int offset) {
+ public boolean adjust(GlyphPositioningTable.Value v, int offset) {
assert v != null;
if ((index + offset) < indexLast) {
- return v.adjust (adjustments [ index + offset ], fontSize);
+ return v.adjust(adjustments [ index + offset ], fontSize);
} else {
throw new IndexOutOfBoundsException();
}
@@ -141,7 +141,7 @@ public class GlyphPositioningState exten
* @return array of adjustments (int[4]) at current position
*/
public int[] getAdjustment() {
- return getAdjustment (0);
+ return getAdjustment(0);
}
/**
@@ -150,7 +150,7 @@ public class GlyphPositioningState exten
* @return array of adjustments (int[4]) at specified offset
* @throws IndexOutOfBoundsException if offset is invalid
*/
- public int[] getAdjustment (int offset) throws IndexOutOfBoundsException {
+ public int[] getAdjustment(int offset) throws IndexOutOfBoundsException {
if ((index + offset) < indexLast) {
return adjustments [ index + offset ];
} else {
@@ -165,10 +165,10 @@ public class GlyphPositioningState exten
* @return true if subtable applied, or false if it did not (e.g., its
* input coverage table did not match current input context)
*/
- public boolean apply (GlyphPositioningSubtable st) {
+ public boolean apply(GlyphPositioningSubtable st) {
assert st != null;
- updateSubtableState (st);
- boolean applied = st.position (this);
+ updateSubtableState(st);
+ boolean applied = st.position(this);
return applied;
}
@@ -182,7 +182,7 @@ public class GlyphPositioningState exten
* the lookups are to apply, and to be consumed once the application has finished
* @return true if lookups are non-null and non-empty; otherwise, false
*/
- public boolean apply (GlyphTable.RuleLookup[] lookups, int nig) {
+ public boolean apply(GlyphTable.RuleLookup[] lookups, int nig) {
if ((lookups != null) && (lookups.length > 0)) {
// apply each rule lookup to extracted input glyph array
for (int i = 0, n = lookups.length; i < n; i++) {
@@ -191,15 +191,15 @@ public class GlyphPositioningState exten
GlyphTable.LookupTable lt = l.getLookup();
if (lt != null) {
// perform positioning on a copy of previous state
- GlyphPositioningState ps = new GlyphPositioningState (this);
+ GlyphPositioningState ps = new GlyphPositioningState(this);
// apply lookup table positioning
- if (lt.position (ps, l.getSequenceIndex())) {
- setAdjusted (true);
+ if (lt.position(ps, l.getSequenceIndex())) {
+ setAdjusted(true);
}
}
}
}
- consume (nig);
+ consume(nig);
return true;
} else {
return false;
@@ -218,7 +218,7 @@ public class GlyphPositioningState exten
* @param adjusted true if to set adjusted state, otherwise false to
* clear adjusted state
*/
- public void setAdjusted (boolean adjusted) {
+ public void setAdjusted(boolean adjusted) {
this.adjusted = adjusted;
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningSubtable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningSubtable.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningSubtable.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningSubtable.java Tue May 7 16:23:13 2013
@@ -44,8 +44,8 @@ public abstract class GlyphPositioningSu
* @param format subtable format
* @param coverage subtable coverage table
*/
- protected GlyphPositioningSubtable (String id, int sequence, int flags, int format, GlyphCoverageTable coverage) {
- super (id, sequence, flags, format, coverage);
+ protected GlyphPositioningSubtable(String id, int sequence, int flags, int format, GlyphCoverageTable coverage) {
+ super(id, sequence, flags, format, coverage);
}
/** {@inheritDoc} */
@@ -55,11 +55,11 @@ public abstract class GlyphPositioningSu
/** {@inheritDoc} */
public String getTypeName() {
- return GlyphPositioningTable.getLookupTypeName (getType());
+ return GlyphPositioningTable.getLookupTypeName(getType());
}
/** {@inheritDoc} */
- public boolean isCompatible (GlyphSubtable subtable) {
+ public boolean isCompatible(GlyphSubtable subtable) {
return subtable instanceof GlyphPositioningSubtable;
}
@@ -69,7 +69,7 @@ public abstract class GlyphPositioningSu
}
/** {@inheritDoc} */
- public boolean position (GlyphPositioningState ps) {
+ public boolean position(GlyphPositioningState ps) {
return false;
}
@@ -85,7 +85,7 @@ public abstract class GlyphPositioningSu
* @param sequenceIndex if non negative, then apply subtables only at specified sequence index
* @return true if a non-zero adjustment occurred
*/
- public static final boolean position (GlyphPositioningState ps, GlyphPositioningSubtable[] sta, int sequenceIndex) {
+ public static final boolean position(GlyphPositioningState ps, GlyphPositioningSubtable[] sta, int sequenceIndex) {
int sequenceStart = ps.getPosition();
boolean appliedOneShot = false;
while (ps.hasNext()) {
@@ -93,9 +93,9 @@ public abstract class GlyphPositioningSu
if (! appliedOneShot && ps.maybeApplicable()) {
for (int i = 0, n = sta.length; ! applied && (i < n); i++) {
if (sequenceIndex < 0) {
- applied = ps.apply (sta [ i ]);
+ applied = ps.apply(sta [ i ]);
} else if (ps.getPosition() == (sequenceStart + sequenceIndex)) {
- applied = ps.apply (sta [ i ]);
+ applied = ps.apply(sta [ i ]);
if (applied) {
appliedOneShot = true;
}
@@ -123,9 +123,9 @@ public abstract class GlyphPositioningSu
* @param sct script context tester
* @return true if a non-zero adjustment occurred
*/
- public static final boolean position (GlyphSequence gs, String script, String language, String feature, int fontSize, GlyphPositioningSubtable[] sta, int[] widths, int[][] adjustments, ScriptContextTester sct) {
+ public static final boolean position(GlyphSequence gs, String script, String language, String feature, int fontSize, GlyphPositioningSubtable[] sta, int[] widths, int[][] adjustments, ScriptContextTester sct) {
synchronized (state) {
- return position (state.reset (gs, script, language, feature, fontSize, widths, adjustments, sct), sta, -1);
+ return position(state.reset(gs, script, language, feature, fontSize, widths, adjustments, sct), sta, -1);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org