<!-- ===================================================================================================== -->
<!-- ===================================================================================================== -->
- <!-- produces 46 new errors
<module name="RegexpSingleline">
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/>
</module>
- -->
<!-- ===================================================================================================== -->
<!-- ===================================================================================================== -->
int[] la = new int [ levels.size() ];
int k = 0;
for ( Iterator it = levels.iterator(); it.hasNext(); ) {
- la [ k++ ] = ( (Integer) it.next() ).intValue();
+ la [ k++ ] = ( (Integer) it.next() ).intValue();
}
return la;
}
if ( it.hasNext() ) {
r = ( (Integer) it.next() ).intValue();
}
- }
+ }
ra [ i ] = r;
}
return ra;
int k = 0;
ta [ k++ ] = bitset;
for ( Iterator it = classes.iterator(); it.hasNext(); ) {
- ta [ k++ ] = ( (Integer) it.next() ).intValue();
+ ta [ k++ ] = ( (Integer) it.next() ).intValue();
}
return ta;
} else {
/**
* The bytes
- *
+ *
* @return the bytes
*/
public byte[] getBytes() {
* @return the text string as an encoded byte array
* @throws UnsupportedEncodingException, CharacterCodingException
*/
- private byte[] getStringAsBytes() throws UnsupportedEncodingException,
+ private byte[] getStringAsBytes() throws UnsupportedEncodingException,
CharacterCodingException {
return charSet.encodeChars(str).getBytes();
}
int SURROGATE = 20;
// other constants
- /** last
+ /** last
/** maximum bidirectional levels */
int MAX_LEVELS = 61;
/** override flag */
/**
* 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).
+ * @return a pre-defined glyph class (GLYPH_CLASS_BASE|GLYPH_CLASS_LIGATURE|GLYPH_CLASS_MARK|GLYPH_CLASS_COMPONENT).
*/
public int getGlyphClass ( int gid ) {
if ( gct != null ) {
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
+ mi = -1; // precedes first range
} else if ( gid > ea [ --i ] ) {
mi = -1; // follows preceding (or last) range
} else {
/**
* Instantiate a DeviceTable.
- * @param startSize the
+ * @param startSize the
* @param endSize the ending (scaled) size
* @param deltas adjustments for each scaled size
*/
*/
public void putGlyph ( int glyph, GlyphSequence.CharAssociation a, Object predication ) {
if ( ! ogb.hasRemaining() ) {
- ogb = growBuffer ( ogb );
+ ogb = growBuffer ( ogb );
}
ogb.put ( glyph );
if ( predications && ( predication != null ) ) {
return false;
} else {
LigatureSet ls = getLigatureSetForCoverageIndex ( ci, gi );
- if ( ls != null ) {
+ if ( ls != null ) {
boolean reverse = false;
GlyphTester ignores = ss.getIgnoreDefault();
int[] counts = ss.getGlyphsAvailable ( 0, reverse, ignores );
*/
public static class Ligature {
- private final int ligature; // (resulting) ligature glyph
+ private final int ligature; // (resulting) ligature glyph
private final int[] components; // component glyph codes (note that first component is implied)
/**
}
return (UseSpec[]) uss.toArray ( new UseSpec [ uss.size() ] );
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer(super.toString());
// frozen state
private GlyphSubtable[] subtablesArray;
private static GlyphSubtable[] subtablesArrayEmpty = new GlyphSubtable[0];
-
+
/**
* Instantiate a LookupTable.
* @param id the lookup table's identifier
/**
* Construct a glyph lookup table use specification.
* @param lookupTable a glyph lookup table
- * @param feature a feature that caused lookup table selection
+ * @param feature a feature that caused lookup table selection
*/
public UseSpec ( LookupTable lookupTable, String feature ) {
this.lookupTable = lookupTable;
if (log.isDebugEnabled()) {
log.debug(tableTag + " pair set table value[" + i + "][" + j + "]: " + pv);
}
- }
+ }
}
// store results
seMapping = ct;
if (log.isDebugEnabled()) {
log.debug(tableTag + " mark-to-base positioning base anchor[" + i + "][" + j + "]: " + a);
}
- }
+ }
}
// store results
seMapping = mct;
if (log.isDebugEnabled()) {
log.debug(tableTag + " mark-to-mark positioning mark #2 anchor[" + i + "][" + j + "]: " + a);
}
- }
+ }
}
// store results
seMapping = mct1;
case GPOSLookupType.SINGLE:
subtableFormat = readSinglePosTable ( lookupType, lookupFlags, subtableOffset );
break;
- case GPOSLookupType.PAIR:
+ case GPOSLookupType.PAIR:
subtableFormat = readPairPosTable ( lookupType, lookupFlags, subtableOffset );
break;
case GPOSLookupType.CURSIVE:
for ( int i = 0; i < nl; i++ ) {
lgto [ i ] = in.readTTFUShort();
}
-
+
// dump info if debugging
if (log.isDebugEnabled()) {
log.debug(tableTag + " ligature caret coverage table offset: " + co );
// The following script codes are based on ISO 15924. Codes less than 1000 are
// official assignments from 15924; those equal to or greater than 1000 are FOP
// implementation specific.
- //
+ //
/** hebrew script constant */
public static final int SCRIPT_HEBREW = 125; // 'hebr'
/** mongolian script constant */
* @return true if character belongs to han (unified cjk) script
*/
public static boolean isHan ( int c ) {
- if ( ( c >= 0x3400 ) && ( c <= 0x4DBF ) ) {
+ if ( ( c >= 0x3400 ) && ( c <= 0x4DBF ) ) {
return true; // cjk unified ideographs extension a
- } else if ( ( c >= 0x4E00 ) && ( c <= 0x9FFF ) ) {
+ } else if ( ( c >= 0x4E00 ) && ( c <= 0x9FFF ) ) {
return true; // cjk unified ideographs
- } else if ( ( c >= 0xF900 ) && ( c <= 0xFAFF ) ) {
+ } else if ( ( c >= 0xF900 ) && ( c <= 0xFAFF ) ) {
return true; // cjk compatibility ideographs
- } else if ( ( c >= 0x20000 ) && ( c <= 0x2A6DF ) ) {
+ } else if ( ( c >= 0x20000 ) && ( c <= 0x2A6DF ) ) {
return true; // cjk unified ideographs extension b
- } else if ( ( c >= 0x2A700 ) && ( c <= 0x2B73F ) ) {
+ } else if ( ( c >= 0x2A700 ) && ( c <= 0x2B73F ) ) {
return true; // cjk unified ideographs extension c
- } else if ( ( c >= 0x2F800 ) && ( c <= 0x2FA1F ) ) {
+ } else if ( ( c >= 0x2F800 ) && ( c <= 0x2FA1F ) ) {
return true; // cjk compatibility ideographs supplement
} else {
return false;
}
if ( predicationMergers != null ) {
predicationMergers.put ( key, pm );
- }
+ }
}
/**
/**
* Format NUMBER as word according to TYPE, which must be either
- * Character.UPPERCASE_LETTER, Character.LOWERCASE_LETTER, or
+ * Character.UPPERCASE_LETTER, Character.LOWERCASE_LETTER, or
* Character.TITLECASE_LETTER. Makes use of this.language to
* determine language of word.
* @param number to be formatted
* Convert Java string (UTF-16) to a Unicode scalar array (UTF-32).
* Note that if there are any non-BMP encoded characters present in the
* input, then the number of entries in the output array will be less
- * than the number of elements in the input string. Any
+ * than the number of elements in the input string. Any
* @param s input string
* @param substitution value to substitute for ill-formed surrogate
* @param errorOnSubstitution throw runtime exception (IllegalArgumentException) in
sbuf.append(",advanced=" + useAdvanced);
sbuf.append('}');
return sbuf.toString();
- }
+ }
private void load(boolean fail) {
if (!isMetricsLoaded) {
if (bslm != null) {
bslm.addId();
}
-
+
// "unwrap" the NonLeafPositions stored in parentIter
// and put them in a new list;
LinkedList<Position> positionList = new LinkedList<Position>();
this.par.add(0, KnuthPenalty.DUMMY_ZERO_PENALTY);
}
}
-
+
// content would overflow, insert empty line/page and try again
return createNode(
lastTooLong.previous.position, lastTooLong.previous.line + 1, 1,
protected List<ListElement> getNextChildElements(LayoutManager childLM, LayoutContext context,
LayoutContext childLC, int alignment, Stack<LayoutManager> lmStack,
Position restartPosition, LayoutManager restartLM) {
-
+
List<ListElement> childElements;
if (lmStack == null) {
childElements = childLM.getNextKnuthElements(childLC, alignment);
for (int i = thisStart; i < lastIndex; i++) {
char currentChar = foText.charAt(i);
-
+
//character width
int charWidth = font.getCharWidth(currentChar);
wordIPD = wordIPD.plus(charWidth);
int level = block.getBidiLevel();
if ( ( level == -1 ) || ( ( level & 1 ) == 0 ) ) {
- startx += block.getStartIndent() / 1000f;
+ startx += block.getStartIndent() / 1000f;
startx -= borderPaddingStart;
} else {
- startx += block.getEndIndent() / 1000f;
+ startx += block.getEndIndent() / 1000f;
startx -= borderPaddingEnd;
}
if ( parent != null ) {
int level = parent.getBidiLevel();
if ( ( level == -1 ) || ( ( level & 1 ) == 0 ) ) {
- currentIPPosition += parent.getStartIndent();
+ currentIPPosition += parent.getStartIndent();
} else {
- currentIPPosition += parent.getEndIndent();
+ currentIPPosition += parent.getEndIndent();
}
}
renderLineArea(line);
int bl = line.getBidiLevel();
if ( bl >= 0 ) {
if ( ( bl & 1 ) == 0 ) {
- currentIPPosition += line.getStartIndent();
+ currentIPPosition += line.getStartIndent();
} else {
- currentIPPosition += line.getEndIndent();
+ currentIPPosition += line.getEndIndent();
// if line's content overflows line area, then
// ensure that overflow is drawn (extends)
// outside of left side of line area
}
}
} else {
- currentIPPosition += line.getStartIndent();
+ currentIPPosition += line.getStartIndent();
}
for (int i = 0, l = children.size(); i < l; i++) {
InlineArea inline = (InlineArea) children.get(i);
// warn if link trait found but not allowed, else create link
if (linkTraitFound) {
- StructureTreeElement structElem
+ StructureTreeElement structElem
= (StructureTreeElement) ip.getTrait(Trait.STRUCTURE_TREE_ELEMENT);
action.setStructureTreeElement(structElem);
Link link = new Link(action, ipRect);
if (e instanceof RtfParagraphBreak) {
//If the element before was a paragraph break or a bookmark
//they will be hidden and are therefore not considered as visible
- if (!(aBefore instanceof RtfParagraphBreak)
+ if (!(aBefore instanceof RtfParagraphBreak)
&& !(aBefore instanceof RtfBookmark)) {
lastParagraphBreak = (RtfParagraphBreak)e;
}
//write all children
boolean bPrevPar = false;
- boolean bBookmark = false;
+ boolean bBookmark = false;
boolean bFirst = true;
for (Iterator it = getChildren().iterator(); it.hasNext();) {
final RtfElement e = (RtfElement)it.next();
0, -1 // all test sets
};
- // instrumentation
+ // instrumentation
private int includedSequences;
private int excludedSequences;
private int passedSequences;
private TTXFile findTTX ( String fid ) {
String pn = findTTXPath ( fid );
assertTrue ( pn != null );
- try {
+ try {
TTXFile tf = TTXFile.getFromCache ( pn );
return tf;
} catch ( Exception e ) {
private TTXFile findTTX ( String fid ) {
String pn = findTTXPath ( fid );
assertTrue ( pn != null );
- try {
+ try {
TTXFile tf = TTXFile.getFromCache ( pn );
return tf;
} catch ( Exception e ) {
private TTXFile findTTX ( String fid ) {
String pn = findTTXPath ( fid );
assertTrue ( pn != null );
- try {
+ try {
TTXFile tf = TTXFile.getFromCache ( pn );
return tf;
} catch ( Exception e ) {
Integer gid = glyphIds.get ( glyph );
if ( gid != null ) {
if ( gmap != null ) {
- Integer cid = gmap.get ( gid );
+ Integer cid = gmap.get ( gid );
if ( cid != null ) {
return cid.intValue();
}
static private String[][] formatRomanUpper =
{
-
+
{ "I" },
{ "0", "0" },
{ "1", "I" },
{ "999999", "bdwgm" },
{ "1000000", "bdwgn" },
};
-
+
static private String[][] formatAlphabeticLatinUpper =
{
{ "A" },
{ "999999", "BDWGM" },
{ "1000000", "BDWGN" },
};
-
+
static private String[][] formatAlphabeticArabicHijai =
{
{ "\u0627", null, null, "alphabetic" },
{ "999999", "\u0623\u0638\u0636\u0635\u062E" },
{ "1000000", "\u0623\u0638\u0636\u0635\u062F" },
};
-
+
static private String[][] formatAlphabeticArabicAbjadi =
{
{ "\u0627", null, null, "traditional" },
{ "999999", "\u0623\u0641\u0633\u0646\u0632" },
{ "1000000", "\u0623\u0641\u0633\u0646\u062D" },
};
-
+
static private String[][] formatNumeralArabicAbjadi =
{
{ "\u0623", null, null, "traditional" },
{ "1999", "\u063A\u0638\u0635\u0637" },
{ "2000", "2000" },
};
-
+
static private String[][] formatAlphabeticHebrew =
{
{ "\u05D0", null, null, "alphabetic" },
{ "999999", "\u05D0\u05DA\u05E9\u05E7\u05E5" },
{ "1000000", "\u05D0\u05DA\u05E9\u05E8\u05D0" },
};
-
+
static private String[][] formatNumeralHebrewGematria =
{
{ "\u05D0", null, null, "traditional" },
{ "1999", "\u05D0\u05F3\u05EA\u05EA\u05F4\u05E7\u05E6\u05D8" },
{ "2000", "2000" },
};
-
+
static private String[][] formatAlphabeticThai =
{
{ "\u0E01", null, null, "alphabetic" },
{ "999999", "\u0E0B\u0E20\u0E17\u0E0B" },
{ "1000000", "\u0E0B\u0E20\u0E17\u0E0C" },
};
-
+
static private String[][] formatWordEnglishLower =
{
{ "w", null, null, null, null, "eng" },
ResultCollector collector = ResultCollector.getInstance();
String propName = attlist.getValue("property");
- String expected = attlist.getValue("expected");
+ String expected = attlist.getValue("expected");
String component = null;
int dotIndex = propName.indexOf('.');
if (dotIndex >= 0) {
StringBuilder textBuffer = new StringBuilder();
String testString = "This is a test string, just some arbitrary data.";
textBuffer.append(testString);
-
+
PDFDocument.flushTextBuffer(textBuffer, out);
assertEquals(testString, out.toString());
-
+
// Should reset the textBuffer
assertEquals(0, textBuffer.length());
assertEquals("", textBuffer.toString());