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 [14/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/...
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfPageNumberCitation.java Tue May 7 16:23:13 2013
@@ -52,7 +52,7 @@ public class RtfPageNumberCitation exten
private String id = null;
/** Create an RTF page number citation as a child of given container with default attributes */
- RtfPageNumberCitation (RtfContainer parent, Writer w, String id)
+ RtfPageNumberCitation(RtfContainer parent, Writer w, String id)
throws IOException {
super(parent, w);
this.id = id;
@@ -60,7 +60,7 @@ public class RtfPageNumberCitation exten
/** Create an RTF page number citation as a child of given
* paragraph, copying its attributes */
- RtfPageNumberCitation (RtfParagraph parent, Writer w, String id)
+ RtfPageNumberCitation(RtfParagraph parent, Writer w, String id)
throws IOException {
// add the attributes ant text attributes of the parent paragraph
super((RtfContainer)parent, w, parent.attrib);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraphBreak.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraphBreak.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraphBreak.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfParagraphBreak.java Tue May 7 16:23:13 2013
@@ -57,7 +57,7 @@ public class RtfParagraphBreak extends R
* @return boolean
*/
public boolean canHide() {
- return this.controlWord.equals (DEFAULT_PARAGRAPH);
+ return this.controlWord.equals(DEFAULT_PARAGRAPH);
}
/**
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSection.java Tue May 7 16:23:13 2013
@@ -195,7 +195,7 @@ implements
protected void writeRtfSuffix() throws IOException {
// write suffix /sect only if this section is not last section (see bug #51484)
List siblings = parent.getChildren();
- if ((siblings.indexOf (this) + 1) < siblings.size()) {
+ if ((siblings.indexOf(this) + 1) < siblings.size()) {
writeControlWord("sect");
}
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java Tue May 7 16:23:13 2013
@@ -88,10 +88,10 @@ public final class RtfStyleSheetTable {
/**
* Constructor.
*/
- private RtfStyleSheetTable () {
- styles = new Hashtable ();
- attrTable = new Hashtable ();
- nameTable = new Vector ();
+ private RtfStyleSheetTable() {
+ styles = new Hashtable();
+ attrTable = new Hashtable();
+ nameTable = new Vector();
}
/**
@@ -99,9 +99,9 @@ public final class RtfStyleSheetTable {
*
* @return The instance of RtfStyleSheetTable
*/
- public static RtfStyleSheetTable getInstance () {
+ public static RtfStyleSheetTable getInstance() {
if (instance == null) {
- instance = new RtfStyleSheetTable ();
+ instance = new RtfStyleSheetTable();
}
return instance;
@@ -116,7 +116,7 @@ public final class RtfStyleSheetTable {
* Sets the default style.
* @param styleName Name of the default style, defined in the stylesheet
*/
- public void setDefaultStyle (String styleName) {
+ public void setDefaultStyle(String styleName) {
this.defaultStyleName = styleName;
}
@@ -124,12 +124,12 @@ public final class RtfStyleSheetTable {
* Gets the name of the default style.
* @return Default style name.
*/
- public String getDefaultStyleName () {
- if (attrTable.get (defaultStyleName) != null) {
+ public String getDefaultStyleName() {
+ if (attrTable.get(defaultStyleName) != null) {
return defaultStyleName;
}
- if (attrTable.get (STANDARD_STYLE) != null) {
+ if (attrTable.get(STANDARD_STYLE) != null) {
defaultStyleName = STANDARD_STYLE;
return defaultStyleName;
}
@@ -147,12 +147,12 @@ public final class RtfStyleSheetTable {
* @param name Name of style to add
* @param attrs Rtf attributes which defines the style
*/
- public void addStyle (String name, RtfAttributes attrs) {
- nameTable.addElement (name);
+ public void addStyle(String name, RtfAttributes attrs) {
+ nameTable.addElement(name);
if (attrs != null) {
- attrTable.put (name, attrs);
+ attrTable.put(name, attrs);
}
- styles.put (name, new Integer (nameTable.size () - 1 + startIndex));
+ styles.put(name, new Integer(nameTable.size() - 1 + startIndex));
}
/**
@@ -161,17 +161,17 @@ public final class RtfStyleSheetTable {
* @param attr Default rtf attributes
* @return Status value
*/
- public int addStyleToAttributes (String name, RtfAttributes attr) {
+ public int addStyleToAttributes(String name, RtfAttributes attr) {
// Sets status to ok
int status = STATUS_OK;
// Gets the style number from table
- Integer style = (Integer) styles.get (name);
+ Integer style = (Integer) styles.get(name);
- if (style == null && !name.equals (defaultStyleName)) {
+ if (style == null && !name.equals(defaultStyleName)) {
// If style not found, and style was not the default style, try the default style
name = defaultStyleName;
- style = (Integer) styles.get (name);
+ style = (Integer) styles.get(name);
// set status for default style setting
status = STATUS_DEFAULT;
}
@@ -182,20 +182,20 @@ public final class RtfStyleSheetTable {
}
// Adds the attributes to default attributes, if not available in default attributes
- attr.set ("cs", style.intValue ());
+ attr.set("cs", style.intValue());
- Object o = attrTable.get (name);
+ Object o = attrTable.get(name);
if (o != null) {
RtfAttributes rtfAttr = (RtfAttributes) o;
- for (Iterator names = rtfAttr.nameIterator (); names.hasNext ();) {
- String attrName = (String) names.next ();
- if (!attr.isSet (attrName)) {
- Integer i = (Integer) rtfAttr.getValue (attrName);
+ for (Iterator names = rtfAttr.nameIterator(); names.hasNext();) {
+ String attrName = (String) names.next();
+ if (!attr.isSet(attrName)) {
+ Integer i = (Integer) rtfAttr.getValue(attrName);
if (i == null) {
- attr.set (attrName);
+ attr.set(attrName);
} else {
- attr.set (attrName, i.intValue ());
+ attr.set(attrName, i.intValue());
}
}
}
@@ -208,29 +208,29 @@ public final class RtfStyleSheetTable {
* @param header Rtf header is the parent
* @throws IOException On write error
*/
- public void writeStyleSheet (RtfHeader header) throws IOException {
- if (styles == null || styles.size () == 0) {
+ public void writeStyleSheet(RtfHeader header) throws IOException {
+ if (styles == null || styles.size() == 0) {
return;
}
- header.writeGroupMark (true);
- header.writeControlWord ("stylesheet");
+ header.writeGroupMark(true);
+ header.writeControlWord("stylesheet");
- int number = nameTable.size ();
+ int number = nameTable.size();
for (int i = 0; i < number; i++) {
- String name = (String) nameTable.elementAt (i);
- header.writeGroupMark (true);
- header.writeControlWord ("*\\" + this.getRtfStyleReference (name));
+ String name = (String) nameTable.elementAt(i);
+ header.writeGroupMark(true);
+ header.writeControlWord("*\\" + this.getRtfStyleReference(name));
- Object o = attrTable.get (name);
+ Object o = attrTable.get(name);
if (o != null) {
- header.writeAttributes ((RtfAttributes) o, RtfText.ATTR_NAMES);
- header.writeAttributes ((RtfAttributes) o, RtfText.ALIGNMENT);
+ header.writeAttributes((RtfAttributes) o, RtfText.ATTR_NAMES);
+ header.writeAttributes((RtfAttributes) o, RtfText.ALIGNMENT);
}
- header.write (name + ";");
- header.writeGroupMark (false);
+ header.write(name + ";");
+ header.writeGroupMark(false);
}
- header.writeGroupMark (false);
+ header.writeGroupMark(false);
}
/**
@@ -238,7 +238,7 @@ public final class RtfStyleSheetTable {
* @param name Name of Style
* @return Rtf attribute of the style reference
*/
- private String getRtfStyleReference (String name) {
- return "cs" + styles.get (name).toString ();
+ private String getRtfStyleReference(String name) {
+ return "cs" + styles.get(name).toString();
}
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java Tue May 7 16:23:13 2013
@@ -94,11 +94,11 @@ public class RtfTable extends RtfContain
RtfAttributes attr = null;
if (attrib != null) {
try {
- attr = (RtfAttributes) attrib.clone ();
+ attr = (RtfAttributes) attrib.clone();
} catch (CloneNotSupportedException e) {
throw new FOPException(e);
}
- attr.set (attrs);
+ attr.set(attrs);
} else {
attr = attrs;
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java Tue May 7 16:23:13 2013
@@ -220,12 +220,12 @@ public class RtfTableCell
* Added by Boris POUDEROUS on 2002/06/26
*/
// Cell background color processing :
- writeAttributes (attrib, ITableAttributes.CELL_COLOR);
+ writeAttributes(attrib, ITableAttributes.CELL_COLOR);
/** - end - */
- writeAttributes (attrib, ITableAttributes.ATTRIB_CELL_PADDING);
- writeAttributes (attrib, ITableAttributes.CELL_BORDER);
- writeAttributes (attrib, IBorderAttributes.BORDERS);
+ writeAttributes(attrib, ITableAttributes.ATTRIB_CELL_PADDING);
+ writeAttributes(attrib, ITableAttributes.CELL_BORDER);
+ writeAttributes(attrib, IBorderAttributes.BORDERS);
// determine cell width
int iCurrentWidth = this.cellWidth;
@@ -270,7 +270,7 @@ public class RtfTableCell
} else {
writeControlWord("trql");
}
- writeAttributes (attrib, ITableAttributes.CELL_VERT_ALIGN);
+ writeAttributes(attrib, ITableAttributes.CELL_VERT_ALIGN);
writeControlWord("cellx" + xPos);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java Tue May 7 16:23:13 2013
@@ -96,7 +96,7 @@ public class RtfTableRow extends RtfCont
public RtfTableCell newTableCellMergedVertically(int cellWidth,
RtfAttributes attrs) throws IOException {
highestCell++;
- cell = new RtfTableCell (this, writer, cellWidth, attrs, highestCell);
+ cell = new RtfTableCell(this, writer, cellWidth, attrs, highestCell);
cell.setVMerge(RtfTableCell.MERGE_WITH_PREVIOUS);
return cell;
}
@@ -110,7 +110,7 @@ public class RtfTableRow extends RtfCont
* @throws IOException for I/O problems
* @throws FOPException if attributes cannot be cloned
*/
- public RtfTableCell newTableCellMergedHorizontally (int cellWidth,
+ public RtfTableCell newTableCellMergedHorizontally(int cellWidth,
RtfAttributes attrs) throws IOException, FOPException {
highestCell++;
// Added by Normand Masse
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java Tue May 7 16:23:13 2013
@@ -43,7 +43,7 @@ public final class RtfTemplate {
/**
* Constructor.
*/
- private RtfTemplate () {
+ private RtfTemplate() {
}
@@ -53,7 +53,7 @@ public final class RtfTemplate {
*
* @return The instance of RtfTemplate
*/
- public static RtfTemplate getInstance () {
+ public static RtfTemplate getInstance() {
if (instance == null) {
instance = new RtfTemplate();
}
@@ -81,19 +81,19 @@ public final class RtfTemplate {
* @param header Rtf header is the parent
* @throws IOException On write error
*/
- public void writeTemplate (RtfHeader header) throws IOException {
+ public void writeTemplate(RtfHeader header) throws IOException {
if (templateFilePath == null || templateFilePath.length() == 0) {
return;
}
- header.writeGroupMark (true);
- header.writeControlWord ("template");
+ header.writeGroupMark(true);
+ header.writeControlWord("template");
header.writeRtfString(this.templateFilePath);
- header.writeGroupMark (false);
+ header.writeGroupMark(false);
- header.writeGroupMark (true);
- header.writeControlWord ("linkstyles");
- header.writeGroupMark (false);
+ header.writeGroupMark(true);
+ header.writeControlWord("linkstyles");
+ header.writeGroupMark(false);
}
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java Tue May 7 16:23:13 2013
@@ -272,7 +272,7 @@ public class RtfText extends RtfElement
* @return true If m_text is null\n
* false m_text is set
*/
- public boolean isEmpty () {
+ public boolean isEmpty() {
return text == null || text.trim().length() == 0;
}
@@ -284,9 +284,9 @@ public class RtfText extends RtfElement
* @return true If m_text is character 160\n
* false m_text is not a nbsp
*/
- public boolean isNbsp () {
- if (!isEmpty ()) {
- if (text.trim ().length () == 1 && text.charAt (0) == CHAR_NBSP) {
+ public boolean isNbsp() {
+ if (!isEmpty()) {
+ if (text.trim().length() == 1 && text.charAt(0) == CHAR_NBSP) {
return true;
}
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java Tue May 7 16:23:13 2013
@@ -41,7 +41,7 @@ public final class ImageUtil {
/**
* Private constructor.
*/
- private ImageUtil () {
+ private ImageUtil() {
}
@@ -57,14 +57,14 @@ public final class ImageUtil {
* @return -1 There is no digit
* number The digits as integer
*/
- public static int getInt (String value) {
- String retString = new String ();
- StringBuffer s = new StringBuffer (value);
- int len = s.length ();
+ public static int getInt(String value) {
+ String retString = new String();
+ StringBuffer s = new StringBuffer(value);
+ int len = s.length();
for (int i = 0; i < len; i++) {
- if (Character.isDigit (s.charAt (i))) {
- retString += s.charAt (i);
+ if (Character.isDigit(s.charAt(i))) {
+ retString += s.charAt(i);
} else {
//for example "600.0pt" has to be exited,
//when the dot is reached.
@@ -72,10 +72,10 @@ public final class ImageUtil {
}
}
- if (retString.length () == 0) {
+ if (retString.length() == 0) {
return -1;
} else {
- return Integer.parseInt (retString);
+ return Integer.parseInt(retString);
}
}
@@ -87,8 +87,8 @@ public final class ImageUtil {
* @return true The string contains a % value
* false Other string
*/
- public static boolean isPercent (String value) {
- if (value.endsWith ("%")) {
+ public static boolean isPercent(String value) {
+ if (value.endsWith("%")) {
return true;
}
@@ -107,7 +107,7 @@ public final class ImageUtil {
* @return true If equal
* false If different
*/
- public static boolean compareHexValues (byte[] pattern, byte[] data, int searchAt,
+ public static boolean compareHexValues(byte[] pattern, byte[] data, int searchAt,
boolean searchForward) {
if (searchAt >= data.length) {
return false;
@@ -155,7 +155,7 @@ public final class ImageUtil {
*
* @return integer
*/
- public static int getIntFromByteArray (byte[] data, int startAt, int length,
+ public static int getIntFromByteArray(byte[] data, int startAt, int length,
boolean searchForward) {
int bit = 8;
int bitMoving = length * bit;
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/xml/XMLRenderer.java Tue May 7 16:23:13 2013
@@ -914,21 +914,21 @@ public class XMLRenderer extends Abstrac
return XML_MIME_TYPE;
}
- private void maybeAddLevelAttribute (Area a) {
+ private void maybeAddLevelAttribute(Area a) {
int level = a.getBidiLevel();
if (level >= 0) {
- addAttribute ("level", level);
+ addAttribute("level", level);
}
}
- private void maybeAddPositionAdjustAttribute (WordArea w) {
+ private void maybeAddPositionAdjustAttribute(WordArea w) {
int[][] adjustments = w.getGlyphPositionAdjustments();
if (adjustments != null) {
- addAttribute ("position-adjust", XMLUtil.encodePositionAdjustments (adjustments));
+ addAttribute("position-adjust", XMLUtil.encodePositionAdjustments(adjustments));
}
}
- private void maybeAddReversedAttribute (WordArea w, String text) {
+ private void maybeAddReversedAttribute(WordArea w, String text) {
if (w.isReversed() && (text.length() > 1)) {
addAttribute("reversed", "true");
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/AbstractFOPImageElementBridge.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/AbstractFOPImageElementBridge.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/AbstractFOPImageElementBridge.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/AbstractFOPImageElementBridge.java Tue May 7 16:23:13 2013
@@ -68,8 +68,8 @@ public abstract class AbstractFOPImageEl
* @return a new graphics node
*/
@Override
- protected GraphicsNode createImageGraphicsNode
- (BridgeContext ctx, Element imageElement, ParsedURL purl) {
+ protected GraphicsNode createImageGraphicsNode(
+ BridgeContext ctx, Element imageElement, ParsedURL purl) {
AbstractFOPBridgeContext bridgeCtx = (AbstractFOPBridgeContext)ctx;
ImageManager manager = bridgeCtx.getImageManager();
@@ -138,8 +138,8 @@ public abstract class AbstractFOPImageEl
* @return the newly created graphics node
* @see org.apache.batik.bridge.SVGImageElementBridge#createGraphicsNode(BridgeContext, Element)
*/
- protected GraphicsNode superCreateGraphicsNode
- (BridgeContext ctx, Element imageElement, ParsedURL purl) {
+ protected GraphicsNode superCreateGraphicsNode(
+ BridgeContext ctx, Element imageElement, ParsedURL purl) {
return super.createImageGraphicsNode(ctx, imageElement, purl);
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFGraphics2D.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFGraphics2D.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFGraphics2D.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFGraphics2D.java Tue May 7 16:23:13 2013
@@ -947,8 +947,8 @@ public class PDFGraphics2D extends Abstr
PDFDeviceColorSpace colSpace;
colSpace = new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_RGB);
- PDFPattern myPat = pdfDoc.getFactory().makeGradient
- (resourceContext, true, colSpace,
+ PDFPattern myPat = pdfDoc.getFactory().makeGradient(
+ resourceContext, true, colSpace,
someColors, theBounds, theCoords, theMatrix);
currentStream.write(myPat.getColorSpaceOut(fill));
@@ -1100,14 +1100,14 @@ public class PDFGraphics2D extends Abstr
int devH = devBounds.height;
ColorSpace rgbCS = ColorSpace.getInstance(ColorSpace.CS_sRGB);
- ColorModel rgbCM = new DirectColorModel
- (rgbCS, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
+ ColorModel rgbCM = new DirectColorModel(
+ rgbCS, 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000,
false, DataBuffer.TYPE_BYTE);
PaintContext pctx = paint.createContext(rgbCM, devBounds, usrBounds,
at, getRenderingHints());
- PDFXObject imageInfo = pdfDoc.getXObject
- ("TempImage:" + pctx.toString());
+ PDFXObject imageInfo = pdfDoc.getXObject(
+ "TempImage:" + pctx.toString());
if (imageInfo != null) {
resourceContext.getPDFResources().addXObject(imageInfo);
} else {
@@ -1116,8 +1116,8 @@ public class PDFGraphics2D extends Abstr
wr = wr.createWritableTranslatedChild(0, 0);
ColorModel pcm = pctx.getColorModel();
- BufferedImage bi = new BufferedImage
- (pcm, wr, pcm.isAlphaPremultiplied(), null);
+ BufferedImage bi = new BufferedImage(
+ pcm, wr, pcm.isAlphaPremultiplied(), null);
final byte[] rgb = new byte[devW * devH * 3];
final int[] line = new int[devW];
final byte[] mask;
@@ -1154,8 +1154,8 @@ public class PDFGraphics2D extends Abstr
String maskRef = null;
if (mask != null) {
- BitmapImage fopimg = new BitmapImage
- ("TempImageMask:" + pctx.toString(), devW, devH, mask, null);
+ BitmapImage fopimg = new BitmapImage(
+ "TempImageMask:" + pctx.toString(), devW, devH, mask, null);
fopimg.setColorSpace(new PDFDeviceColorSpace(PDFDeviceColorSpace.DEVICE_GRAY));
PDFImageXObject xobj = pdfDoc.addImage(resourceContext, fopimg);
maskRef = xobj.referencePDF();
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFTranscoder.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFTranscoder.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFTranscoder.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/svg/PDFTranscoder.java Tue May 7 16:23:13 2013
@@ -168,16 +168,16 @@ public class PDFTranscoder extends Abstr
graphics.setSVGDimension(width, height);
if (hints.containsKey(ImageTranscoder.KEY_BACKGROUND_COLOR)) {
- graphics.setBackgroundColor
- ((Color)hints.get(ImageTranscoder.KEY_BACKGROUND_COLOR));
+ graphics.setBackgroundColor(
+ (Color)hints.get(ImageTranscoder.KEY_BACKGROUND_COLOR));
}
- graphics.setGraphicContext
- (new org.apache.xmlgraphics.java2d.GraphicContext());
+ graphics.setGraphicContext(
+ new org.apache.xmlgraphics.java2d.GraphicContext());
graphics.preparePainting();
graphics.transform(curTxf);
- graphics.setRenderingHint
- (RenderingHintsKeyExt.KEY_TRANSCODING,
+ graphics.setRenderingHint(
+ RenderingHintsKeyExt.KEY_TRANSCODING,
RenderingHintsKeyExt.VALUE_TRANSCODING_VECTOR);
this.root.paint(graphics);
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingMode.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingMode.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingMode.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingMode.java Tue May 7 16:23:13 2013
@@ -55,7 +55,7 @@ public final class WritingMode extends T
* writing mode traits setter.
* @param wms a writing mode traits setter
*/
- public void assignWritingModeTraits (WritingModeTraitsSetter wms) {
+ public void assignWritingModeTraits(WritingModeTraitsSetter wms) {
Direction inlineProgressionDirection;
Direction blockProgressionDirection;
Direction columnProgressionDirection;
@@ -92,12 +92,12 @@ public final class WritingMode extends T
shiftDirection = Direction.BT;
break;
}
- wms.setInlineProgressionDirection (inlineProgressionDirection);
- wms.setBlockProgressionDirection (blockProgressionDirection);
- wms.setColumnProgressionDirection (columnProgressionDirection);
- wms.setRowProgressionDirection (rowProgressionDirection);
- wms.setShiftDirection (shiftDirection);
- wms.setWritingMode (this);
+ wms.setInlineProgressionDirection(inlineProgressionDirection);
+ wms.setBlockProgressionDirection(blockProgressionDirection);
+ wms.setColumnProgressionDirection(columnProgressionDirection);
+ wms.setRowProgressionDirection(rowProgressionDirection);
+ wms.setShiftDirection(shiftDirection);
+ wms.setWritingMode(this);
}
/**
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingModeTraits.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingModeTraits.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingModeTraits.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingModeTraits.java Tue May 7 16:23:13 2013
@@ -43,8 +43,8 @@ public class WritingModeTraits implement
* Construct writing mode traits using the specified writing mode.
* @param writingMode a writing mode traits object
*/
- public WritingModeTraits (WritingMode writingMode) {
- assignWritingModeTraits (writingMode);
+ public WritingModeTraits(WritingMode writingMode) {
+ assignWritingModeTraits(writingMode);
}
/**
@@ -57,7 +57,7 @@ public class WritingModeTraits implement
/**
* @param direction the "inline-progression-direction" trait.
*/
- public void setInlineProgressionDirection (Direction direction) {
+ public void setInlineProgressionDirection(Direction direction) {
this.inlineProgressionDirection = direction;
}
@@ -71,7 +71,7 @@ public class WritingModeTraits implement
/**
* @param direction the "block-progression-direction" trait.
*/
- public void setBlockProgressionDirection (Direction direction) {
+ public void setBlockProgressionDirection(Direction direction) {
this.blockProgressionDirection = direction;
}
@@ -85,7 +85,7 @@ public class WritingModeTraits implement
/**
* @param direction the "column-progression-direction" trait.
*/
- public void setColumnProgressionDirection (Direction direction) {
+ public void setColumnProgressionDirection(Direction direction) {
this.columnProgressionDirection = direction;
}
@@ -99,7 +99,7 @@ public class WritingModeTraits implement
/**
* @param direction the "row-progression-direction" trait.
*/
- public void setRowProgressionDirection (Direction direction) {
+ public void setRowProgressionDirection(Direction direction) {
this.rowProgressionDirection = direction;
}
@@ -113,7 +113,7 @@ public class WritingModeTraits implement
/**
* @param direction the "shift-direction" trait.
*/
- public void setShiftDirection (Direction direction) {
+ public void setShiftDirection(Direction direction) {
this.shiftDirection = direction;
}
@@ -127,15 +127,15 @@ public class WritingModeTraits implement
/**
* @param writingMode the "writing-mode" trait.
*/
- public void setWritingMode (WritingMode writingMode) {
+ public void setWritingMode(WritingMode writingMode) {
this.writingMode = writingMode;
}
/**
* @param writingMode the "writing-mode" trait.
*/
- public void assignWritingModeTraits (WritingMode writingMode) {
- writingMode.assignWritingModeTraits (this);
+ public void assignWritingModeTraits(WritingMode writingMode) {
+ writingMode.assignWritingModeTraits(this);
}
/**
@@ -145,7 +145,7 @@ public class WritingModeTraits implement
* @return the applicable writing mode traits getter, or null if none applies
*/
public static WritingModeTraitsGetter
- getWritingModeTraitsGetter (org.apache.fop.fo.FONode fn) {
+ getWritingModeTraitsGetter(org.apache.fop.fo.FONode fn) {
for (org.apache.fop.fo.FONode n = fn; n != null; n = n.getParent()) {
if (n instanceof WritingModeTraitsGetter) {
return (WritingModeTraitsGetter) n;
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingModeTraitsSetter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingModeTraitsSetter.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingModeTraitsSetter.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/traits/WritingModeTraitsSetter.java Tue May 7 16:23:13 2013
@@ -28,43 +28,43 @@ public interface WritingModeTraitsSetter
* Set value of inline-progression-direction trait.
* @param direction the "inline-progression-direction" trait
*/
- void setInlineProgressionDirection (Direction direction);
+ void setInlineProgressionDirection(Direction direction);
/**
* Set value of block-progression-direction trait.
* @param direction the "block-progression-direction" trait
*/
- void setBlockProgressionDirection (Direction direction);
+ void setBlockProgressionDirection(Direction direction);
/**
* Set value of column-progression-direction trait.
* @param direction the "column-progression-direction" trait
*/
- void setColumnProgressionDirection (Direction direction);
+ void setColumnProgressionDirection(Direction direction);
/**
* Set value of row-progression-direction trait.
* @param direction the "row-progression-direction" trait
*/
- void setRowProgressionDirection (Direction direction);
+ void setRowProgressionDirection(Direction direction);
/**
* Set value of shift-direction trait.
* @param direction the "shift-direction" trait
*/
- void setShiftDirection (Direction direction);
+ void setShiftDirection(Direction direction);
/**
* Set value of writing-mode trait.
* @param writingMode the "writing-mode" trait
*/
- void setWritingMode (WritingMode writingMode);
+ void setWritingMode(WritingMode writingMode);
/**
* Collectivelly assign values to all writing mode traits based upon a specific
* writing mode.
* @param writingMode the "writing-mode" trait
*/
- void assignWritingModeTraits (WritingMode writingMode);
+ void assignWritingModeTraits(WritingMode writingMode);
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/util/CharUtilities.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/util/CharUtilities.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/util/CharUtilities.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/util/CharUtilities.java Tue May 7 16:23:13 2013
@@ -118,7 +118,7 @@ public class CharUtilities {
* @param c character to inspect
* @return the determined character class
*/
- public static int classOf (int c) {
+ public static int classOf(int c) {
switch (c) {
case CODE_EOT:
return EOT;
@@ -141,7 +141,7 @@ public class CharUtilities {
* @param c character to inspect
* @return True if the character is a normal space
*/
- public static boolean isBreakableSpace (int c) {
+ public static boolean isBreakableSpace(int c) {
return (c == SPACE || isFixedWidthSpace(c));
}
@@ -150,7 +150,7 @@ public class CharUtilities {
* @param c the character to check
* @return true if the character is a zero-width space
*/
- public static boolean isZeroWidthSpace (int c) {
+ public static boolean isZeroWidthSpace(int c) {
return c == ZERO_WIDTH_SPACE // 200Bh
|| c == WORD_JOINER // 2060h
|| c == ZERO_WIDTH_NOBREAK_SPACE; // FEFFh (also used as BOM)
@@ -161,7 +161,7 @@ public class CharUtilities {
* @param c the character to check
* @return true if the character has a fixed-width
*/
- public static boolean isFixedWidthSpace (int c) {
+ public static boolean isFixedWidthSpace(int c) {
return (c >= '\u2000' && c <= '\u200B')
|| c == '\u3000';
// c == '\u2000' // en quad
@@ -185,7 +185,7 @@ public class CharUtilities {
* @param c character to check
* @return True if the character is a nbsp
*/
- public static boolean isNonBreakableSpace (int c) {
+ public static boolean isNonBreakableSpace(int c) {
return
(c == NBSPACE // no-break space
|| c == '\u202F' // narrow no-break space
@@ -200,7 +200,7 @@ public class CharUtilities {
* @param c character to check
* @return True if the character is adjustable
*/
- public static boolean isAdjustableSpace (int c) {
+ public static boolean isAdjustableSpace(int c) {
//TODO: are there other kinds of adjustable spaces?
return
(c == '\u0020' // normal space
@@ -212,7 +212,7 @@ public class CharUtilities {
* @param c character to check
* @return True if the character represents any kind of space
*/
- public static boolean isAnySpace (int c) {
+ public static boolean isAnySpace(int c) {
return (isBreakableSpace(c) || isNonBreakableSpace(c));
}
@@ -221,7 +221,7 @@ public class CharUtilities {
* @param c the character
* @return true if the character is "Alphabetic"
*/
- public static boolean isAlphabetic (int c) {
+ public static boolean isAlphabetic(int c) {
//http://www.unicode.org/Public/UNIDATA/UCD.html#Alphabetic
//Generated from: Other_Alphabetic + Lu + Ll + Lt + Lm + Lo + Nl
int generalCategory = Character.getType((char)c);
@@ -245,7 +245,7 @@ public class CharUtilities {
* @param c the character to check
* @return true if the character represents an explicit break
*/
- public static boolean isExplicitBreak (int c) {
+ public static boolean isExplicitBreak(int c) {
return (c == LINEFEED_CHAR
|| c == CARRIAGE_RETURN
|| c == NEXT_LINE
@@ -259,7 +259,7 @@ public class CharUtilities {
* @param c a unicode scalar value
* @return a string representing a numeric character reference
*/
- public static String charToNCRef (int c) {
+ public static String charToNCRef(int c) {
StringBuffer sb = new StringBuffer();
for (int i = 0, nDigits = (c > 0xFFFF) ? 6 : 4; i < nDigits; i++, c >>= 4) {
int d = c & 0xF;
@@ -269,7 +269,7 @@ public class CharUtilities {
} else {
hd = (char) ((int) 'A' + (d - 10));
}
- sb.append (hd);
+ sb.append(hd);
}
return "&#x" + sb.reverse() + ";";
}
@@ -280,23 +280,23 @@ public class CharUtilities {
* @return a string representing a sequence of numeric character reference or
* ASCII characters
*/
- public static String toNCRefs (String s) {
+ public static String toNCRefs(String s) {
StringBuffer sb = new StringBuffer();
if (s != null) {
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if ((c >= 32) && (c < 127)) {
if (c == '<') {
- sb.append ("<");
+ sb.append("<");
} else if (c == '>') {
- sb.append (">");
+ sb.append(">");
} else if (c == '&') {
- sb.append ("&");
+ sb.append("&");
} else {
- sb.append (c);
+ sb.append(c);
}
} else {
- sb.append (charToNCRef (c));
+ sb.append(charToNCRef(c));
}
}
}
@@ -310,12 +310,12 @@ public class CharUtilities {
* @param pad character to use for padding
* @return padded string
*/
- public static String padLeft (String s, int width, char pad) {
+ public static String padLeft(String s, int width, char pad) {
StringBuffer sb = new StringBuffer();
for (int i = s.length(); i < width; i++) {
sb.append(pad);
}
- sb.append (s);
+ sb.append(s);
return sb.toString();
}
@@ -325,9 +325,9 @@ public class CharUtilities {
* @param c character code
* @return formatted character string
*/
- public static String format (int c) {
+ public static String format(int c) {
if (c < 1114112) {
- return "0x" + padLeft (Integer.toString (c, 16), (c < 65536) ? 4 : 6, '0');
+ return "0x" + padLeft(Integer.toString(c, 16), (c < 65536) ? 4 : 6, '0');
} else {
return "!NOT A CHARACTER!";
}
@@ -339,7 +339,7 @@ public class CharUtilities {
* @param cs2 second character sequence
* @return true if both sequences have same length and same character sequence
*/
- public static boolean isSameSequence (CharSequence cs1, CharSequence cs2) {
+ public static boolean isSameSequence(CharSequence cs1, CharSequence cs2) {
assert cs1 != null;
assert cs2 != null;
if (cs1.length() != cs2.length()) {
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/util/XMLUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/util/XMLUtil.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/util/XMLUtil.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/util/XMLUtil.java Tue May 7 16:23:13 2013
@@ -186,19 +186,19 @@ public final class XMLUtil implements XM
* @param paCount the number of entries to encode from adjustments array
* @return the encoded value
*/
- public static String encodePositionAdjustments (int[][] dp, int paCount) {
+ public static String encodePositionAdjustments(int[][] dp, int paCount) {
assert dp != null;
StringBuffer sb = new StringBuffer();
int na = paCount;
int nz = 0;
- sb.append (na);
+ sb.append(na);
for (int i = 0; i < na; i++) {
int[] pa = dp [ i ];
if (pa != null) {
for (int k = 0; k < 4; k++) {
int a = pa [ k ];
if (a != 0) {
- encodeNextAdjustment (sb, nz, a);
+ encodeNextAdjustment(sb, nz, a);
nz = 0;
} else {
nz++;
@@ -208,7 +208,7 @@ public final class XMLUtil implements XM
nz += 4;
}
}
- encodeNextAdjustment (sb, nz, 0);
+ encodeNextAdjustment(sb, nz, 0);
return sb.toString();
}
@@ -223,32 +223,32 @@ public final class XMLUtil implements XM
* @param dp the adjustments array
* @return the encoded value
*/
- public static String encodePositionAdjustments (int[][] dp) {
+ public static String encodePositionAdjustments(int[][] dp) {
assert dp != null;
- return encodePositionAdjustments (dp, dp.length);
+ return encodePositionAdjustments(dp, dp.length);
}
- private static void encodeNextAdjustment (StringBuffer sb, int nz, int a) {
- encodeZeroes (sb, nz);
- encodeAdjustment (sb, a);
+ private static void encodeNextAdjustment(StringBuffer sb, int nz, int a) {
+ encodeZeroes(sb, nz);
+ encodeAdjustment(sb, a);
}
- private static void encodeZeroes (StringBuffer sb, int nz) {
+ private static void encodeZeroes(StringBuffer sb, int nz) {
if (nz > 0) {
- sb.append (' ');
+ sb.append(' ');
if (nz == 1) {
- sb.append ('0');
+ sb.append('0');
} else {
- sb.append ('Z');
- sb.append (nz);
+ sb.append('Z');
+ sb.append(nz);
}
}
}
- private static void encodeAdjustment (StringBuffer sb, int a) {
+ private static void encodeAdjustment(StringBuffer sb, int a) {
if (a != 0) {
- sb.append (' ');
- sb.append (a);
+ sb.append(' ');
+ sb.append(a);
}
}
@@ -258,21 +258,21 @@ public final class XMLUtil implements XM
* @param value the encoded value
* @return the position adjustments array
*/
- public static int[][] decodePositionAdjustments (String value) {
+ public static int[][] decodePositionAdjustments(String value) {
int[][] dp = null;
if (value != null) {
- String[] sa = value.split ("\\s");
+ String[] sa = value.split("\\s");
if (sa != null) {
if (sa.length > 0) {
- int na = Integer.parseInt (sa[0]);
+ int na = Integer.parseInt(sa[0]);
dp = new int [ na ] [ 4 ];
for (int i = 1, n = sa.length, k = 0; i < n; i++) {
String s = sa [ i ];
if (s.charAt(0) == 'Z') {
- int nz = Integer.parseInt (s.substring (1));
+ int nz = Integer.parseInt(s.substring(1));
k += nz;
} else {
- dp [ k / 4 ] [ k % 4 ] = Integer.parseInt (s);
+ dp [ k / 4 ] [ k % 4 ] = Integer.parseInt(s);
k += 1;
}
}
Modified: xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/mif/MIFHandler.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/mif/MIFHandler.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/mif/MIFHandler.java (original)
+++ xmlgraphics/fop/trunk/src/sandbox/org/apache/fop/render/mif/MIFHandler.java Tue May 7 16:23:13 2013
@@ -351,12 +351,12 @@ public class MIFHandler extends FOEventH
}
public void character(Character c) {
- appendCharacters (new String (new char[] {c.getCharacter()}));
+ appendCharacters(new String(new char[] {c.getCharacter()}));
}
/** {@inheritDoc} */
public void characters(FOText foText) {
- appendCharacters (foText.getCharSequence().toString());
+ appendCharacters(foText.getCharSequence().toString());
}
/** {@inheritDoc} */
@@ -367,7 +367,7 @@ public class MIFHandler extends FOEventH
public void endPageNumber(PageNumber pagenum) {
}
- private void appendCharacters (String str) {
+ private void appendCharacters(String str) {
if (para != null) {
str = str.trim();
// break into nice length chunks
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/bidi/BidiAlgorithmTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/bidi/BidiAlgorithmTestCase.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/bidi/BidiAlgorithmTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/bidi/BidiAlgorithmTestCase.java Tue May 7 16:23:13 2013
@@ -77,27 +77,27 @@ public class BidiAlgorithmTestCase {
String ldPfx = BidiTestData.LD_PFX;
int ldCount = BidiTestData.LD_CNT;
for (int i = 0; i < ldCount; i++) {
- int[] da = BidiTestData.readTestData (ldPfx, i);
+ int[] da = BidiTestData.readTestData(ldPfx, i);
if (da != null) {
- testBidiAlgorithm (i, da);
+ testBidiAlgorithm(i, da);
} else {
- fail ("unable to read bidi test data for resource at index " + i);
+ fail("unable to read bidi test data for resource at index " + i);
}
}
// ensure we passed all test sequences
- assertEquals ("did not pass all test sequences", BidiTestData.NUM_TEST_SEQUENCES, passedSequences);
+ assertEquals("did not pass all test sequences", BidiTestData.NUM_TEST_SEQUENCES, passedSequences);
if (log.isDebugEnabled()) {
- log.debug ("Included Sequences : " + includedSequences);
- log.debug ("Excluded Sequences : " + excludedSequences);
+ log.debug("Included Sequences : " + includedSequences);
+ log.debug("Excluded Sequences : " + excludedSequences);
log.debug("Passed Sequences : " + passedSequences);
}
}
- private void testBidiAlgorithm (int testSet, int[] da) throws Exception {
+ private void testBidiAlgorithm(int testSet, int[] da) throws Exception {
if (da.length < 1) {
- fail ("test data is empty");
+ fail("test data is empty");
} else if (da.length < ((da[0] * 2) + 1)) {
- fail ("test data is truncated");
+ fail("test data is truncated");
} else {
int k = 0;
// extract level count
@@ -120,10 +120,10 @@ public class BidiAlgorithmTestCase {
for (int i = 0; i < n; i++) {
ta[i] = da[k++];
}
- if (includeSequence (testSet, testSequence)) {
+ if (includeSequence(testSet, testSequence)) {
includedSequences++;
- if (! excludeSequence (testSet, testSequence)) {
- if (testBidiAlgorithm (testSet, testSequence, la, ra, ta, bs)) {
+ if (! excludeSequence(testSet, testSequence)) {
+ if (testBidiAlgorithm(testSet, testSequence, la, ra, ta, bs)) {
passedSequences++;
}
} else {
@@ -133,11 +133,11 @@ public class BidiAlgorithmTestCase {
testSequence++;
}
// ensure we exhausted test data
- assertEquals ("extraneous test data", da.length, k);
+ assertEquals("extraneous test data", da.length, k);
}
}
- private boolean includeTestSet (int testSet) {
+ private boolean includeTestSet(int testSet) {
for (int i = 0, n = TEST_SET_RANGES.length / 2; i < n; i++) {
int s = TEST_SET_RANGES [ (i * 2) + 0 ];
int e = TEST_SET_RANGES [ (i * 2) + 1 ];
@@ -150,8 +150,8 @@ public class BidiAlgorithmTestCase {
return false;
}
- private boolean includeSequence (int testSet, int testSequence) {
- if (! includeTestSet (testSet)) {
+ private boolean includeSequence(int testSet, int testSequence) {
+ if (! includeTestSet(testSet)) {
return false;
} else {
for (int i = 0, n = INCLUSIONS.length / 2; i < n; i++) {
@@ -175,7 +175,7 @@ public class BidiAlgorithmTestCase {
}
}
- private boolean excludeSequence (int testSet, int testSequence) {
+ private boolean excludeSequence(int testSet, int testSequence) {
for (int i = 0, n = EXCLUSIONS.length / 2; i < n; i++) {
int setno = EXCLUSIONS [ (i * 2) + 0 ];
int seqno = EXCLUSIONS [ (i * 2) + 1 ];
@@ -196,13 +196,13 @@ public class BidiAlgorithmTestCase {
return false;
}
- private boolean testBidiAlgorithm (int testSet, int testSequence, int[] la, int[] ra, int[] ta, int bs) throws Exception {
+ private boolean testBidiAlgorithm(int testSet, int testSequence, int[] la, int[] ra, int[] ta, int bs) throws Exception {
boolean passed = true;
int n = la.length;
if (ra.length != n) {
- fail ("bad reorder array length, expected " + n + ", got " + ra.length);
+ fail("bad reorder array length, expected " + n + ", got " + ra.length);
} else if (ta.length != n) {
- fail ("bad test array length, expected " + n + ", got " + ta.length);
+ fail("bad test array length, expected " + n + ", got " + ta.length);
} else {
// auto-LTR
if ((bs & 1) != 0) {
@@ -210,15 +210,15 @@ public class BidiAlgorithmTestCase {
}
// LTR
if ((bs & 2) != 0) {
- int[] levels = UnicodeBidiAlgorithm.resolveLevels (null, ta, 0, new int [ n ], true);
- if (! verifyResults (la, levels, ta, 0, testSet, testSequence)) {
+ int[] levels = UnicodeBidiAlgorithm.resolveLevels(null, ta, 0, new int [ n ], true);
+ if (! verifyResults(la, levels, ta, 0, testSet, testSequence)) {
passed = false;
}
}
// RTL
if ((bs & 4) != 0) {
- int[] levels = UnicodeBidiAlgorithm.resolveLevels (null, ta, 1, new int [ n ], true);
- if (! verifyResults (la, levels, ta, 1, testSet, testSequence)) {
+ int[] levels = UnicodeBidiAlgorithm.resolveLevels(null, ta, 1, new int [ n ], true);
+ if (! verifyResults(la, levels, ta, 1, testSet, testSequence)) {
passed = false;
}
}
@@ -226,9 +226,9 @@ public class BidiAlgorithmTestCase {
return passed;
}
- private boolean verifyResults (int[] laExp, int[] laOut, int[] ta, int dl, int testSet, int testSequence) {
+ private boolean verifyResults(int[] laExp, int[] laOut, int[] ta, int dl, int testSet, int testSequence) {
if (laOut.length != laExp.length) {
- fail ("output levels array length mismatch, expected " + laExp.length + ", got " + laOut.length);
+ fail("output levels array length mismatch, expected " + laExp.length + ", got " + laOut.length);
return false;
} else {
int numMatch = 0;
@@ -237,7 +237,7 @@ public class BidiAlgorithmTestCase {
int lo = laOut[i];
int le = laExp[i];
if (lo != le) {
- assertEquals (getMismatchMessage (testSet, testSequence, i, dl), le, lo);
+ assertEquals(getMismatchMessage(testSet, testSequence, i, dl), le, lo);
} else {
numMatch++;
}
@@ -249,16 +249,16 @@ public class BidiAlgorithmTestCase {
}
}
- private String getMismatchMessage (int testSet, int testSequence, int seqIndex, int defaultLevel) {
+ private String getMismatchMessage(int testSet, int testSequence, int seqIndex, int defaultLevel) {
StringBuffer sb = new StringBuffer();
- sb.append ("level mismatch for default level ");
- sb.append (defaultLevel);
- sb.append (" at sequence index ");
- sb.append (seqIndex);
- sb.append (" in test sequence ");
- sb.append (testSequence);
- sb.append (" of test set ");
- sb.append (testSet);
+ sb.append("level mismatch for default level ");
+ sb.append(defaultLevel);
+ sb.append(" at sequence index ");
+ sb.append(seqIndex);
+ sb.append(" in test sequence ");
+ sb.append(testSequence);
+ sb.append(" of test set ");
+ sb.append(testSet);
return sb.toString();
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/bidi/BidiClassTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/bidi/BidiClassTestCase.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/bidi/BidiClassTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/bidi/BidiClassTestCase.java Tue May 7 16:23:13 2013
@@ -34,23 +34,23 @@ public class BidiClassTestCase {
String tdPfx = BidiTestData.TD_PFX;
int tdCount = BidiTestData.TD_CNT;
for (int i = 0; i < tdCount; i++) {
- int[] da = BidiTestData.readTestData (tdPfx, i);
+ int[] da = BidiTestData.readTestData(tdPfx, i);
if (da != null) {
- testBidiClass (da);
+ testBidiClass(da);
} else {
- fail ("unable to read bidi test data for resource at index " + i);
+ fail("unable to read bidi test data for resource at index " + i);
}
}
}
- private void testBidiClass (int[] da) throws Exception {
+ private void testBidiClass(int[] da) throws Exception {
int bc = da[0];
for (int i = 1, n = da.length; i < n; i += 2) {
int s = da[i+0];
int e = da[i+1];
for (int c = s; c < e; c++) {
- int cbc = BidiClass.getBidiClass (c);
- assertEquals ("bad bidi class for CH(" + CharUtilities.format (c) + ")", bc, cbc);
+ int cbc = BidiClass.getBidiClass(c);
+ assertEquals("bad bidi class for CH(" + CharUtilities.format(c) + ")", bc, cbc);
}
}
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/bidi/BidiTestData.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/bidi/BidiTestData.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/bidi/BidiTestData.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/bidi/BidiTestData.java Tue May 7 16:23:13 2013
@@ -49,14 +49,14 @@ public final class BidiTestData {
public static final int NUM_TEST_SEQUENCES = 216357;
- public static int[] readTestData (String prefix, int index) {
+ public static int[] readTestData(String prefix, int index) {
int[] data = null;
InputStream is = null;
Class btc = BidiTestData.class;
String name = btc.getSimpleName() + "$" + prefix + index + ".ser";
try {
- if ((is = btc.getResourceAsStream (name)) != null) {
- ObjectInputStream ois = new ObjectInputStream (is);
+ if ((is = btc.getResourceAsStream(name)) != null) {
+ ObjectInputStream ois = new ObjectInputStream(is);
data = (int[]) ois.readObject();
ois.close();
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/GDEFTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/GDEFTestCase.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/GDEFTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/GDEFTestCase.java Tue May 7 16:23:13 2013
@@ -3056,33 +3056,33 @@ public class GDEFTestCase {
@Test
public void testGDEFGlyphClass() throws Exception {
- performLookups (ltGlyphClass);
+ performLookups(ltGlyphClass);
}
@Test
public void testGDEFAttachmentPoint() throws Exception {
- performLookups (ltAttachmentPoint);
+ performLookups(ltAttachmentPoint);
}
@Test
public void testGDEFLigatureCaret() throws Exception {
- performLookups (ltLigatureCaret);
+ performLookups(ltLigatureCaret);
}
@Test
public void testGDEFMarkAttachment() throws Exception {
- performLookups (ltMarkAttachment);
+ performLookups(ltMarkAttachment);
}
/**
* Perform lookups on all test data in test specification TS.
* @param ts test specification
*/
- private void performLookups (Object[][] ts) {
+ private void performLookups(Object[][] ts) {
assert ts.length > 0;
Object[] tp = ts[0];
for (int i = 1; i < ts.length; i++) {
- performLookups (tp, ts[i]);
+ performLookups(tp, ts[i]);
}
}
@@ -3091,37 +3091,37 @@ public class GDEFTestCase {
* @param tp test parameters
* @param td test data
*/
- private void performLookups (Object[] tp, Object[] td) {
+ private void performLookups(Object[] tp, Object[] td) {
assert tp.length > 0;
if (td.length > 1) {
String fid = (String) td[0];
String lid = (String) td[1];
- TTXFile tf = findTTX (fid);
- assertTrue (tf != null);
+ TTXFile tf = findTTX(fid);
+ assertTrue(tf != null);
GlyphDefinitionTable gdef = tf.getGDEF();
- assertTrue (gdef != null);
+ assertTrue(gdef != null);
String[][] tia = (String[][]) td[2];
switch ((int) ((Integer) tp[0])) {
case GlyphDefinitionTable.GDEF_LOOKUP_TYPE_GLYPH_CLASS:
- performGlyphClassLookups (tf, lid, tia);
+ performGlyphClassLookups(tf, lid, tia);
break;
case GlyphDefinitionTable.GDEF_LOOKUP_TYPE_ATTACHMENT_POINT:
- performAttachmentPointLookups (tf, lid, tia);
+ performAttachmentPointLookups(tf, lid, tia);
break;
case GlyphDefinitionTable.GDEF_LOOKUP_TYPE_LIGATURE_CARET:
- performLigatureCaretLookups (tf, lid, tia);
+ performLigatureCaretLookups(tf, lid, tia);
break;
case GlyphDefinitionTable.GDEF_LOOKUP_TYPE_MARK_ATTACHMENT:
- performMarkAttachmentLookups (tf, lid, tia);
+ performMarkAttachmentLookups(tf, lid, tia);
break;
default:
- assertTrue ("bad lookup type", false);
+ assertTrue("bad lookup type", false);
break;
}
}
}
- private void performGlyphClassLookups (TTXFile tf, String lid, String[][] tia) {
+ private void performGlyphClassLookups(TTXFile tf, String lid, String[][] tia) {
GlyphDefinitionTable gdef = tf.getGDEF();
assert gdef != null;
for (String[] ti : tia) {
@@ -3131,30 +3131,30 @@ public class GDEFTestCase {
assert gn != null;
String cn = ti[1];
assert cn != null;
- int g = tf.getGlyph (gn);
- assertTrue (g >= 0);
- int oc = Integer.parseInt (cn);
- int tc = gdef.getGlyphClass (g);
- assertEquals ("bad glyph class for glyph \'" + gn + "\', gid(" + g + ")", oc, tc);
+ int g = tf.getGlyph(gn);
+ assertTrue(g >= 0);
+ int oc = Integer.parseInt(cn);
+ int tc = gdef.getGlyphClass(g);
+ assertEquals("bad glyph class for glyph \'" + gn + "\', gid(" + g + ")", oc, tc);
}
}
- private void performAttachmentPointLookups (TTXFile tf, String lid, String[][] tia) {
+ private void performAttachmentPointLookups(TTXFile tf, String lid, String[][] tia) {
// not yet supported by GDEF or test TTX files
}
- private void performLigatureCaretLookups (TTXFile tf, String lid, String[][] tia) {
+ private void performLigatureCaretLookups(TTXFile tf, String lid, String[][] tia) {
// not yet supported by GDEF or test TTX files
}
- private void performMarkAttachmentLookups (TTXFile tf, String lid, String[][] tia) {
+ private void performMarkAttachmentLookups(TTXFile tf, String lid, String[][] tia) {
// not yet supported by GDEF or test TTX files
}
- private String findTTXPath (String fid) {
+ private String findTTXPath(String fid) {
for (String[] fs : ttxFonts) {
if ((fs != null) && (fs.length > 1)) {
- if (fs[0].equals (fid)) {
+ if (fs[0].equals(fid)) {
return ttxFilesRoot + File.separator + fs[1];
}
}
@@ -3162,14 +3162,14 @@ public class GDEFTestCase {
return null;
}
- private TTXFile findTTX (String fid) {
- String pn = findTTXPath (fid);
- assertTrue (pn != null);
+ private TTXFile findTTX(String fid) {
+ String pn = findTTXPath(fid);
+ assertTrue(pn != null);
try {
- TTXFile tf = TTXFile.getFromCache (pn);
+ TTXFile tf = TTXFile.getFromCache(pn);
return tf;
} catch (Exception e) {
- fail (e.getMessage());
+ fail(e.getMessage());
return null;
}
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/GPOSTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/GPOSTestCase.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/GPOSTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/GPOSTestCase.java Tue May 7 16:23:13 2013
@@ -319,53 +319,53 @@ public class GPOSTestCase implements Scr
@Test
public void testGPOSSingle() throws Exception {
- performPositioning (ltSingle);
+ performPositioning(ltSingle);
}
@Test
public void testGPOSPair() throws Exception {
- performPositioning (ltPair);
+ performPositioning(ltPair);
}
@Test
public void testGPOSCursive() throws Exception {
- performPositioning (ltCursive);
+ performPositioning(ltCursive);
}
@Test
public void testGPOSMarkToBase() throws Exception {
- performPositioning (ltMarkToBase);
+ performPositioning(ltMarkToBase);
}
@Test
public void testGPOSMarkToLigature() throws Exception {
- performPositioning (ltMarkToLigature);
+ performPositioning(ltMarkToLigature);
}
@Test
public void testGPOSMarkToMark() throws Exception {
- performPositioning (ltMarkToMark);
+ performPositioning(ltMarkToMark);
}
@Test
public void testGPOSContextual() throws Exception {
- performPositioning (ltContextual);
+ performPositioning(ltContextual);
}
@Test
public void testGPOSChainedContextual() throws Exception {
- performPositioning (ltChainedContextual);
+ performPositioning(ltChainedContextual);
}
/**
* Perform positioning on all test data in test specification TS.
* @param ts test specification
*/
- private void performPositioning (Object[][] ts) {
+ private void performPositioning(Object[][] ts) {
assert ts.length > 0;
Object[] tp = ts[0];
for (int i = 1; i < ts.length; i++) {
- performPositioning (tp, ts[i]);
+ performPositioning(tp, ts[i]);
}
}
@@ -374,7 +374,7 @@ public class GPOSTestCase implements Scr
* @param tp test parameters
* @param td test data
*/
- private void performPositioning (Object[] tp, Object[] td) {
+ private void performPositioning(Object[] tp, Object[] td) {
assert tp.length > 0;
if (td.length > 5) {
String fid = (String) td[0];
@@ -382,36 +382,36 @@ public class GPOSTestCase implements Scr
String script = (String) td[2];
String language = (String) td[3];
String feature = (String) td[4];
- TTXFile tf = findTTX (fid);
- assertTrue (tf != null);
+ TTXFile tf = findTTX(fid);
+ assertTrue(tf != null);
GlyphPositioningTable gpos = tf.getGPOS();
- assertTrue (gpos != null);
- GlyphPositioningSubtable[] sta = findGPOSSubtables (gpos, script, language, feature, lid);
- assertTrue (sta != null);
- assertTrue (sta.length > 0);
- ScriptContextTester sct = findScriptContextTester (script, language, feature);
+ assertTrue(gpos != null);
+ GlyphPositioningSubtable[] sta = findGPOSSubtables(gpos, script, language, feature, lid);
+ assertTrue(sta != null);
+ assertTrue(sta.length > 0);
+ ScriptContextTester sct = findScriptContextTester(script, language, feature);
Object[][] tia = (Object[][]) td[5]; // test instance array
for (Object[] ti : tia) { // test instance
if (ti != null) {
if (ti.length > 0) { // must have at least input glyphs
String[] igia = (String[]) ti[0]; // input glyph id array
int[][] ogpa = (int[][]) ti[1]; // output glyph positioning array
- GlyphSequence igs = tf.getGlyphSequence (igia);
+ GlyphSequence igs = tf.getGlyphSequence(igia);
int[] widths = tf.getWidths();
int[][] tgpa = new int [ igia.length ] [ 4 ];
- boolean adjusted = GlyphPositioningSubtable.position (igs, script, language, feature, 1000, sta, widths, tgpa, sct);
- assertTrue (adjusted);
- assertSamePositions (ogpa, tgpa);
+ boolean adjusted = GlyphPositioningSubtable.position(igs, script, language, feature, 1000, sta, widths, tgpa, sct);
+ assertTrue(adjusted);
+ assertSamePositions(ogpa, tgpa);
}
}
}
}
}
- private String findTTXPath (String fid) {
+ private String findTTXPath(String fid) {
for (String[] fs : ttxFonts) {
if ((fs != null) && (fs.length > 1)) {
- if (fs[0].equals (fid)) {
+ if (fs[0].equals(fid)) {
return ttxFilesRoot + File.separator + fs[1];
}
}
@@ -419,20 +419,20 @@ public class GPOSTestCase implements Scr
return null;
}
- private TTXFile findTTX (String fid) {
- String pn = findTTXPath (fid);
- assertTrue (pn != null);
+ private TTXFile findTTX(String fid) {
+ String pn = findTTXPath(fid);
+ assertTrue(pn != null);
try {
- TTXFile tf = TTXFile.getFromCache (pn);
+ TTXFile tf = TTXFile.getFromCache(pn);
return tf;
} catch (Exception e) {
- fail (e.getMessage());
+ fail(e.getMessage());
return null;
}
}
- private GlyphPositioningSubtable[] findGPOSSubtables (GlyphPositioningTable gpos, String script, String language, String feature, String lid) {
- LookupTable lt = gpos.getLookupTable (lid);
+ private GlyphPositioningSubtable[] findGPOSSubtables(GlyphPositioningTable gpos, String script, String language, String feature, String lid) {
+ LookupTable lt = gpos.getLookupTable(lid);
if (lt != null) {
return (GlyphPositioningSubtable[]) lt.getSubtables();
} else {
@@ -440,33 +440,33 @@ public class GPOSTestCase implements Scr
}
}
- private ScriptContextTester findScriptContextTester (String script, String language, String feature) {
+ private ScriptContextTester findScriptContextTester(String script, String language, String feature) {
return this;
}
- public GlyphContextTester getTester (String feature) {
+ public GlyphContextTester getTester(String feature) {
return this;
}
- public boolean test (String script, String language, String feature, GlyphSequence gs, int index, int flags) {
+ public boolean test(String script, String language, String feature, GlyphSequence gs, int index, int flags) {
return true;
}
- private void assertSamePositions (int[][] pa1, int[][] pa2) {
- assertNotNull (pa1);
- assertNotNull (pa2);
- assertEquals ("unequal adjustment count", pa1.length, pa2.length);
+ private void assertSamePositions(int[][] pa1, int[][] pa2) {
+ assertNotNull(pa1);
+ assertNotNull(pa2);
+ assertEquals("unequal adjustment count", pa1.length, pa2.length);
for (int i = 0; i < pa1.length; i++) {
int[] a1 = pa1 [ i ];
int[] a2 = pa2 [ i ];
- assertNotNull (a1);
- assertNotNull (a2);
- assertEquals ("bad adjustment array length", 4, a1.length);
- assertEquals ("bad adjustment array length", 4, a2.length);
+ assertNotNull(a1);
+ assertNotNull(a2);
+ assertEquals("bad adjustment array length", 4, a1.length);
+ assertEquals("bad adjustment array length", 4, a2.length);
for (int k = 0; k < a1.length; k++) {
int p1 = a1[k];
int p2 = a2[k];
- assertEquals ("bad adjustment", p1, p2);
+ assertEquals("bad adjustment", p1, p2);
}
}
}
Modified: xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/GSUBTestCase.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/GSUBTestCase.java?rev=1479969&r1=1479968&r2=1479969&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/GSUBTestCase.java (original)
+++ xmlgraphics/fop/trunk/test/java/org/apache/fop/complexscripts/fonts/GSUBTestCase.java Tue May 7 16:23:13 2013
@@ -2129,43 +2129,43 @@ public class GSUBTestCase implements Scr
@Test
public void testGSUBSingle() throws Exception {
- performSubstitutions (ltSingle);
+ performSubstitutions(ltSingle);
}
@Test
public void testGSUBMultiple() throws Exception {
- performSubstitutions (ltMultiple);
+ performSubstitutions(ltMultiple);
}
@Test
public void testGSUBAlternate() throws Exception {
- performSubstitutions (ltAlternate);
+ performSubstitutions(ltAlternate);
}
@Test
public void testGSUBLigature() throws Exception {
- performSubstitutions (ltLigature);
+ performSubstitutions(ltLigature);
}
@Test
public void testGSUBContextual() throws Exception {
- performSubstitutions (ltContextual);
+ performSubstitutions(ltContextual);
}
@Test
public void testGSUBChainedContextual() throws Exception {
- performSubstitutions (ltChainedContextual);
+ performSubstitutions(ltChainedContextual);
}
/**
* Perform substitutions on all test data in test specification TS.
* @param ts test specification
*/
- private void performSubstitutions (Object[][] ts) {
+ private void performSubstitutions(Object[][] ts) {
assert ts.length > 0;
Object[] tp = ts[0];
for (int i = 1; i < ts.length; i++) {
- performSubstitutions (tp, ts[i]);
+ performSubstitutions(tp, ts[i]);
}
}
@@ -2174,7 +2174,7 @@ public class GSUBTestCase implements Scr
* @param tp test parameters
* @param td test data
*/
- private void performSubstitutions (Object[] tp, Object[] td) {
+ private void performSubstitutions(Object[] tp, Object[] td) {
assert tp.length > 0;
if (td.length > 5) {
String fid = (String) td[0];
@@ -2182,34 +2182,34 @@ public class GSUBTestCase implements Scr
String script = (String) td[2];
String language = (String) td[3];
String feature = (String) td[4];
- TTXFile tf = findTTX (fid);
- assertTrue (tf != null);
+ TTXFile tf = findTTX(fid);
+ assertTrue(tf != null);
GlyphSubstitutionTable gsub = tf.getGSUB();
- assertTrue (gsub != null);
- GlyphSubstitutionSubtable[] sta = findGSUBSubtables (gsub, script, language, feature, lid);
- assertTrue (sta != null);
- assertTrue (sta.length > 0);
- ScriptContextTester sct = findScriptContextTester (script, language, feature);
+ assertTrue(gsub != null);
+ GlyphSubstitutionSubtable[] sta = findGSUBSubtables(gsub, script, language, feature, lid);
+ assertTrue(sta != null);
+ assertTrue(sta.length > 0);
+ ScriptContextTester sct = findScriptContextTester(script, language, feature);
String[][][] tia = (String[][][]) td[5]; // test instance array
for (String[][] ti : tia) { // test instance
if (ti != null) {
if (ti.length > 1) { // must have at least input and output glyph id arrays
String[] igia = ti[0]; // input glyph id array
String[] ogia = ti[1]; // output glyph id array
- GlyphSequence igs = tf.getGlyphSequence (igia);
- GlyphSequence ogs = tf.getGlyphSequence (ogia);
- GlyphSequence tgs = GlyphSubstitutionSubtable.substitute (igs, script, language, feature, sta, sct);
- assertSameGlyphs (ogs, tgs);
+ GlyphSequence igs = tf.getGlyphSequence(igia);
+ GlyphSequence ogs = tf.getGlyphSequence(ogia);
+ GlyphSequence tgs = GlyphSubstitutionSubtable.substitute(igs, script, language, feature, sta, sct);
+ assertSameGlyphs(ogs, tgs);
}
}
}
}
}
- private String findTTXPath (String fid) {
+ private String findTTXPath(String fid) {
for (String[] fs : ttxFonts) {
if ((fs != null) && (fs.length > 1)) {
- if (fs[0].equals (fid)) {
+ if (fs[0].equals(fid)) {
return ttxFilesRoot + File.separator + fs[1];
}
}
@@ -2217,20 +2217,20 @@ public class GSUBTestCase implements Scr
return null;
}
- private TTXFile findTTX (String fid) {
- String pn = findTTXPath (fid);
- assertTrue (pn != null);
+ private TTXFile findTTX(String fid) {
+ String pn = findTTXPath(fid);
+ assertTrue(pn != null);
try {
- TTXFile tf = TTXFile.getFromCache (pn);
+ TTXFile tf = TTXFile.getFromCache(pn);
return tf;
} catch (Exception e) {
- fail (e.getMessage());
+ fail(e.getMessage());
return null;
}
}
- private GlyphSubstitutionSubtable[] findGSUBSubtables (GlyphSubstitutionTable gsub, String script, String language, String feature, String lid) {
- LookupTable lt = gsub.getLookupTable (lid);
+ private GlyphSubstitutionSubtable[] findGSUBSubtables(GlyphSubstitutionTable gsub, String script, String language, String feature, String lid) {
+ LookupTable lt = gsub.getLookupTable(lid);
if (lt != null) {
return (GlyphSubstitutionSubtable[]) lt.getSubtables();
} else {
@@ -2238,28 +2238,28 @@ public class GSUBTestCase implements Scr
}
}
- private ScriptContextTester findScriptContextTester (String script, String language, String feature) {
+ private ScriptContextTester findScriptContextTester(String script, String language, String feature) {
return this;
}
- public GlyphContextTester getTester (String feature) {
+ public GlyphContextTester getTester(String feature) {
return this;
}
- public boolean test (String script, String language, String feature, GlyphSequence gs, int index, int flags) {
+ public boolean test(String script, String language, String feature, GlyphSequence gs, int index, int flags) {
return true;
}
- private void assertSameGlyphs (GlyphSequence gs1, GlyphSequence gs2) {
- assertNotNull (gs1);
- assertNotNull (gs2);
+ private void assertSameGlyphs(GlyphSequence gs1, GlyphSequence gs2) {
+ assertNotNull(gs1);
+ assertNotNull(gs2);
IntBuffer gb1 = gs1.getGlyphs();
IntBuffer gb2 = gs2.getGlyphs();
- assertEquals ("unequal glyph count", gb1.limit(), gb2.limit());
+ assertEquals("unequal glyph count", gb1.limit(), gb2.limit());
for (int i = 0; i < gb1.limit(); i++) {
int g1 = gb1.get(i);
int g2 = gb2.get(i);
- assertEquals ("unequal glyph code", g1, g2);
+ assertEquals("unequal glyph code", g1, g2);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org