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 2008/05/09 14:30:42 UTC
svn commit: r654783 [2/3] - in /xmlgraphics/fop/trunk:
src/java/org/apache/fop/apps/ src/java/org/apache/fop/fonts/
src/java/org/apache/fop/fonts/autodetect/
src/java/org/apache/fop/fonts/base14/
src/java/org/apache/fop/fonts/substitute/ src/java/org/a...
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/base14/Base14FontCollection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/base14/Base14FontCollection.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/AttributeValue.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/AttributeValue.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/AttributeValue.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/AttributeValue.java Fri May 9 05:30:40 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.fonts.substitute;
@@ -25,7 +25,7 @@
* Encapsulates a font attribute value
*/
public class AttributeValue extends java.util.ArrayList {
-
+
private static final long serialVersionUID = 748610847500940557L;
/**
@@ -38,15 +38,15 @@
*/
public static AttributeValue valueOf(String valuesString) {
AttributeValue attribute = new AttributeValue();
- StringTokenizer stringTokenzier = new StringTokenizer(valuesString, ",");
- if (stringTokenzier.countTokens() > 1) {
- while (stringTokenzier.hasMoreTokens()) {
- String token = stringTokenzier.nextToken().trim();
+ StringTokenizer stringTokenizer = new StringTokenizer(valuesString, ",");
+ if (stringTokenizer.countTokens() > 1) {
+ while (stringTokenizer.hasMoreTokens()) {
+ String token = stringTokenizer.nextToken().trim();
AttributeValue tokenAttribute = AttributeValue.valueOf(token);
attribute.addAll(tokenAttribute);
}
} else {
- String token = stringTokenzier.nextToken().trim();
+ String token = stringTokenizer.nextToken().trim();
Object value = null;
try {
value = Integer.valueOf(token);
@@ -60,6 +60,6 @@
attribute.add(value);
}
}
- return attribute;
+ return attribute;
}
}
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/AttributeValue.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/AttributeValue.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontQualifier.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontQualifier.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontQualifier.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontQualifier.java Fri May 9 05:30:40 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.fonts.substitute;
@@ -32,7 +32,7 @@
import org.apache.fop.fonts.FontUtil;
/**
- * Encapsulates a font substitution qualifier
+ * Encapsulates a font substitution qualifier
*/
public class FontQualifier {
@@ -47,15 +47,15 @@
/** font weight attribute value */
private AttributeValue fontWeightAttributeValue = null;
-
+
/**
* Default constructor
*/
public FontQualifier() {
}
-
+
/**
- * Sets the font family
+ * Sets the font family
* @param fontFamily the font family
*/
public void setFontFamily(String fontFamily) {
@@ -66,20 +66,20 @@
}
this.fontFamilyAttributeValue = fontFamilyAttribute;
}
-
+
/**
- * Sets the font style
+ * Sets the font style
* @param fontStyle the font style
*/
public void setFontStyle(String fontStyle) {
AttributeValue fontStyleAttribute = AttributeValue.valueOf(fontStyle);
if (fontStyleAttribute != null) {
- this.fontStyleAttributeValue = fontStyleAttribute;
+ this.fontStyleAttributeValue = fontStyleAttribute;
}
}
/**
- * Sets the font weight
+ * Sets the font weight
* @param fontWeight the font weight
*/
public void setFontWeight(String fontWeight) {
@@ -100,7 +100,7 @@
this.fontWeightAttributeValue = fontWeightAttribute;
}
}
-
+
/**
* @return the font family attribute
*/
@@ -117,7 +117,7 @@
}
return this.fontStyleAttributeValue;
}
-
+
/**
* @return the font weight attribute
*/
@@ -141,7 +141,7 @@
public boolean hasFontStyle() {
return this.fontStyleAttributeValue != null;
}
-
+
/**
* Returns a list of matching font triplet found in a given font info
*
@@ -154,7 +154,7 @@
AttributeValue styleValue = getFontStyle();
List/*<FontTriplet>*/ matchingTriplets = new java.util.ArrayList/*<FontTriplet>*/();
-
+
// try to find matching destination font triplet
for (Iterator attrIt = fontFamilyValue.iterator(); attrIt.hasNext();) {
String fontFamilyString = (String)attrIt.next();
@@ -165,7 +165,7 @@
tripletIt.hasNext();) {
FontTriplet triplet = (FontTriplet)tripletIt.next();
String fontName = triplet.getName();
-
+
// matched font family name
if (fontFamilyString.toLowerCase().equals(fontName.toLowerCase())) {
@@ -194,7 +194,7 @@
}
}
}
-
+
// try and match font style
boolean styleMatched = false;
String fontStyleString = triplet.getStyle();
@@ -204,17 +204,17 @@
styleMatched = true;
}
}
-
+
if (weightMatched && styleMatched) {
matchingTriplets.add(triplet);
}
}
}
- }
+ }
}
return matchingTriplets;
}
-
+
/**
* Returns the highest priority matching font triplet found in a given font info
* @param fontInfo the font info
@@ -240,25 +240,25 @@
}
return bestTriplet;
}
-
+
/**
* @return a list of font triplets matching this qualifier
*/
public List/*<FontTriplet>*/ getTriplets() {
List/*<FontTriplet>*/ triplets = new java.util.ArrayList/*<FontTriplet>*/();
-
+
AttributeValue fontFamilyValue = getFontFamily();
for (Iterator fontFamilyIt = fontFamilyValue.iterator(); fontFamilyIt.hasNext();) {
String name = (String)fontFamilyIt.next();
-
+
AttributeValue styleValue = getFontStyle();
for (Iterator styleIt = styleValue.iterator(); styleIt.hasNext();) {
String style = (String)styleIt.next();
-
+
AttributeValue weightValue = getFontWeight();
for (Iterator weightIt = weightValue.iterator(); weightIt.hasNext();) {
Object weightObj = weightIt.next();
-
+
if (weightObj instanceof FontWeightRange) {
FontWeightRange fontWeightRange = (FontWeightRange)weightObj;
int[] weightRange = fontWeightRange.toArray();
@@ -292,14 +292,14 @@
if (str.length() > 0) {
str += ", ";
}
- str += "font-style=" + fontStyleAttributeValue;
+ str += "font-style=" + fontStyleAttributeValue;
}
if (fontWeightAttributeValue != null) {
if (str.length() > 0) {
str += ", ";
}
- str += "font-weight=" + fontWeightAttributeValue;
+ str += "font-weight=" + fontWeightAttributeValue;
}
return str;
}
-}
\ No newline at end of file
+}
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontQualifier.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontQualifier.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitution.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitution.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitution.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitution.java Fri May 9 05:30:40 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.fonts.substitute;
@@ -23,7 +23,7 @@
* Encapsulates a pair of substitution qualifiers
*/
public class FontSubstitution {
-
+
private FontQualifier fromQualifier;
private FontQualifier toQualifier;
@@ -51,11 +51,11 @@
public FontQualifier getToQualifier() {
return toQualifier;
}
-
+
/**
* {@inheritDoc}
*/
public String toString() {
return "from=" + fromQualifier + ", to=" + toQualifier;
}
-}
\ No newline at end of file
+}
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitution.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitution.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java Fri May 9 05:30:40 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.fonts.substitute;
@@ -44,9 +44,9 @@
public void adjustFontInfo(FontInfo fontInfo) {
for (Iterator/*<FontSubstitution>*/ subsIt = super.iterator(); subsIt.hasNext();) {
FontSubstitution substitution = (FontSubstitution)subsIt.next();
-
+
// find the best matching font triplet
- FontQualifier toQualifier = substitution.getToQualifier();
+ FontQualifier toQualifier = substitution.getToQualifier();
FontTriplet fontTriplet = toQualifier.bestMatch(fontInfo);
if (fontTriplet == null) {
log.error("Unable to match font substitution for destination qualifier "
@@ -54,7 +54,7 @@
continue;
}
String internalFontKey = fontInfo.getInternalFontKey(fontTriplet);
-
+
FontQualifier fromQualifier = substitution.getFromQualifier();
List/*<FontTriplet>*/ tripletList = fromQualifier.getTriplets();
for (Iterator tripletit = tripletList.iterator(); tripletit.hasNext();) {
@@ -62,5 +62,5 @@
fontInfo.addFontProperties(internalFontKey, triplet);
}
}
- }
+ }
}
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java Fri May 9 05:30:40 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.fonts.substitute;
@@ -37,7 +37,7 @@
public FontSubstitutionsConfigurator(Configuration cfg) {
this.cfg = cfg;
}
-
+
private static FontQualifier getQualfierFromConfiguration(Configuration cfg)
throws FOPException {
String fontFamily = cfg.getAttribute("font-family", null);
@@ -56,7 +56,7 @@
}
return qualifier;
}
-
+
/**
* Configures a font substitution catalog
*
@@ -74,7 +74,7 @@
if (fromCfg == null) {
throw new FOPException("'substitution' element without child 'to' element");
}
- FontQualifier fromQualifier = getQualfierFromConfiguration(fromCfg);
+ FontQualifier fromQualifier = getQualfierFromConfiguration(fromCfg);
FontQualifier toQualifier = getQualfierFromConfiguration(toCfg);
FontSubstitution substitution = new FontSubstitution(fromQualifier, toQualifier);
substitutions.add(substitution);
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java Fri May 9 05:30:40 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.fonts.substitute;
@@ -23,13 +23,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.apache.fop.fonts.FontUtil;
/**
* Encapsulates a range of font weight values
*/
public class FontWeightRange {
-
+
/** logging instance */
protected static Log log = LogFactory.getLog("org.apache.fop.render.fonts");
@@ -68,7 +67,7 @@
/** the start range */
private int start;
-
+
/** the end range */
private int end;
@@ -81,7 +80,7 @@
this.start = start;
this.end = end;
}
-
+
/**
* Returns true if the given integer value is within this integer range
* @param value the integer value
@@ -90,7 +89,7 @@
public boolean isWithinRange(int value) {
return (value >= start && value <= end);
}
-
+
/**
* {@inheritDoc}
*/
@@ -111,5 +110,5 @@
range[i] = start + (i * 100);
}
return range;
- }
+ }
}
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java Fri May 9 05:30:40 2008
@@ -38,7 +38,7 @@
/**
* The base class for most LayoutManagers.
*/
-public abstract class AbstractLayoutManager extends AbstractBaseLayoutManager
+public abstract class AbstractLayoutManager extends AbstractBaseLayoutManager
implements Constants {
/**
@@ -57,13 +57,13 @@
/** True if this LayoutManager has handled all of its content. */
private boolean bFinished = false;
-
+
/** child LM during getNextKnuthElement phase */
protected LayoutManager curChildLM = null;
-
+
/** child LM iterator during getNextKnuthElement phase */
protected ListIterator childLMiter = null;
-
+
private int lastGeneratedPosition = -1;
private int smallestPosNumberChecked = Integer.MAX_VALUE;
@@ -154,7 +154,7 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public LinkedList getNextKnuthElements(LayoutContext context,
int alignment) {
@@ -164,7 +164,7 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public LinkedList getChangedKnuthElements(List oldList,
int alignment) {
@@ -229,20 +229,20 @@
public PageSequenceLayoutManager getPSLM() {
return parentLM.getPSLM();
}
-
+
/**
* @see PageSequenceLayoutManager#getCurrentPage()
* @return the {@link Page} instance corresponding to the current page
*/
public Page getCurrentPage() {
return getPSLM().getCurrentPage();
- }
-
+ }
+
/** @return the current page viewport */
public PageViewport getCurrentPV() {
return getPSLM().getCurrentPage().getPageViewport();
- }
-
+ }
+
/**
* {@inheritDoc}
*/
@@ -306,7 +306,7 @@
pos.setIndex(lastGeneratedPosition);
return pos;
}
-
+
/**
* Indicates whether the given Position is the first area-generating Position of this LM.
* @param pos the Position (must be one with a position index)
@@ -326,7 +326,7 @@
return false;
}
}
-
+
/**
* Indicates whether the given Position is the last area-generating Position of this LM.
* @param pos the Position (must be one with a position index)
@@ -349,7 +349,7 @@
Map atts = fobj.getForeignAttributes();
targetArea.setForeignAttributes(atts);
}
-
+
/**
* Registers the FO's markers on the current PageViewport
*
@@ -360,9 +360,9 @@
protected void addMarkersToPage(boolean isStarting, boolean isFirst, boolean isLast) {
if (this.markers != null) {
getCurrentPV().addMarkers(
- this.markers,
- isStarting,
- isFirst,
+ this.markers,
+ isStarting,
+ isFirst,
isLast);
}
}
@@ -390,5 +390,5 @@
public String toString() {
return (super.toString() + (fobj != null ? "[fobj=" + fobj.toString() + "]" : ""));
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/AbstractRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/AbstractRendererConfigurator.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/AbstractRendererConfigurator.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/AbstractRendererConfigurator.java Fri May 9 05:30:40 2008
@@ -36,7 +36,7 @@
/** fop factory configuration */
protected FOUserAgent userAgent = null;
-
+
/**
* Default constructor
* @param userAgent user agent
@@ -45,7 +45,7 @@
super();
this.userAgent = userAgent;
}
-
+
/**
* Returns the configuration subtree for a specific renderer.
* @param renderer the renderer
@@ -59,7 +59,7 @@
}
return null;
}
-
+
return getRendererConfig(mimeType);
}
@@ -74,11 +74,11 @@
if (log.isDebugEnabled()) {
log.debug("userconfig is null");
}
- return null;
+ return null;
}
-
+
Configuration userRendererConfig = null;
-
+
Configuration[] cfgs
= cfg.getChild("renderers").getChildren("renderer");
for (int i = 0; i < cfgs.length; ++i) {
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/PrintRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/PrintRenderer.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/PrintRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/PrintRenderer.java Fri May 9 05:30:40 2008
@@ -45,7 +45,7 @@
/** list of fonts */
protected List/*<EmbedFontInfo>*/ embedFontInfoList = null;
-
+
/**
* Adds a font list to current list of fonts
* @param fontList a font info list
@@ -57,7 +57,7 @@
fontList.addAll(fontList);
}
}
-
+
/**
* @param embedFontInfoList list of available fonts
*/
@@ -91,7 +91,7 @@
FontTriplet triplet = (FontTriplet)area.getTrait(Trait.FONT);
return fontInfo.getInternalFontKey(triplet);
}
-
+
/**
* Returns a Font object constructed based on the font traits in an area
* @param area the area from which to retrieve the font triplet information
@@ -102,7 +102,7 @@
int size = ((Integer)area.getTrait(Trait.FONT_SIZE)).intValue();
return fontInfo.getFontInstance(triplet, size);
}
-
+
/**
* Lightens up a color for groove, ridge, inset and outset border effects.
* @param col the color to lighten up
@@ -135,7 +135,7 @@
* @param foreignAttributes a Map or foreign attributes, may be null
* @return the RendererContext
*/
- protected RendererContext createRendererContext(int x, int y, int width, int height,
+ protected RendererContext createRendererContext(int x, int y, int width, int height,
Map foreignAttributes) {
RendererContext context;
context = new RendererContext(this, getMimeType());
@@ -149,7 +149,7 @@
new Integer(x));
context.setProperty(RendererContextConstants.YPOS,
new Integer(y));
- context.setProperty(RendererContextConstants.PAGE_VIEWPORT,
+ context.setProperty(RendererContextConstants.PAGE_VIEWPORT,
getCurrentPageViewport());
if (foreignAttributes != null) {
context.setProperty(RendererContextConstants.FOREIGN_ATTRIBUTES, foreignAttributes);
@@ -165,12 +165,12 @@
* @param foreignAttributes the foreign attributes containing rendering hints, or null
*/
public void renderDocument(Document doc, String ns, Rectangle2D pos, Map foreignAttributes) {
- int x = currentIPPosition + (int) pos.getX();
+ int x = currentIPPosition + (int) pos.getX();
int y = currentBPPosition + (int) pos.getY();
int width = (int)pos.getWidth();
int height = (int)pos.getHeight();
RendererContext context = createRendererContext(x, y, width, height, foreignAttributes);
-
+
renderXML(context, doc, ns);
}
@@ -185,7 +185,7 @@
}
return this.fontResolver;
}
-
+
/**
* @return the font info
*/
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/PrintRendererConfigurator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/PrintRendererConfigurator.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/PrintRendererConfigurator.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/PrintRendererConfigurator.java Fri May 9 05:30:40 2008
@@ -55,7 +55,7 @@
/**
* Base Print renderer configurator (mostly handles font configuration)
*/
-public class PrintRendererConfigurator extends AbstractRendererConfigurator
+public class PrintRendererConfigurator extends AbstractRendererConfigurator
implements RendererConfigurator {
/** logger instance */
@@ -94,9 +94,9 @@
boolean strict = factory.validateUserConfigStrictly();
FontCache fontCache = fontManager.getFontCache();
- List/*<EmbedFontInfo>*/ embedFontInfoList = buildFontListFromConfiguration(cfg,
+ List/*<EmbedFontInfo>*/ embedFontInfoList = buildFontListFromConfiguration(cfg,
fontResolver, strict, fontManager);
-
+
if (fontCache != null && fontCache.hasChanged()) {
fontCache.save();
}
@@ -113,13 +113,13 @@
* @return a List of EmbedFontInfo objects.
* @throws FOPException If an error occurs while processing the configuration
*/
- public static List/*<EmbedFontInfo>*/ buildFontListFromConfiguration(Configuration cfg,
- FontResolver fontResolver,
+ public static List/*<EmbedFontInfo>*/ buildFontListFromConfiguration(Configuration cfg,
+ FontResolver fontResolver,
boolean strict, FontManager fontManager) throws FOPException {
FontCache fontCache = fontManager.getFontCache();
String fontBaseURL = fontManager.getFontBaseURL();
List/*<EmbedFontInfo>*/ fontInfoList
- = new java.util.ArrayList/*<EmbedFontInfo>*/();
+ = new java.util.ArrayList/*<EmbedFontInfo>*/();
Configuration fonts = cfg.getChild("fonts", false);
if (fonts != null) {
@@ -128,7 +128,7 @@
log.debug("Starting font configuration...");
start = System.currentTimeMillis();
}
-
+
// native o/s search (autodetect) configuration
boolean autodetectFonts = (fonts.getChild("auto-detect", false) != null);
if (autodetectFonts) {
@@ -203,7 +203,7 @@
LogUtil.handleException(log, e, strict);
}
}
-
+
// font file (singular) configuration
Configuration[] font = fonts.getChildren("font");
for (int i = 0; i < font.length; i++) {
@@ -216,9 +216,9 @@
// Update referenced fonts (fonts which are not to be embedded)
updateReferencedFonts(fontInfoList, fontManager.getReferencedFontsMatcher());
-
+
if (log.isDebugEnabled()) {
- log.debug("Finished font configuration in "
+ log.debug("Finished font configuration in "
+ (System.currentTimeMillis() - start) + "ms");
}
}
@@ -243,7 +243,7 @@
}
}
-
+
/**
* Iterates over font file list adding font info to list
* @param fontFileList font file list
@@ -258,7 +258,7 @@
// parse font to ascertain font info
FontInfoFinder finder = new FontInfoFinder();
//EmbedFontInfo fontInfo = finder.find(fontUrl, resolver, fontCache);
-
+
//List<EmbedFontInfo> embedFontInfoList = finder.find(fontUrl, resolver, fontCache);
EmbedFontInfo[] embedFontInfos = finder.find(fontUrl, resolver, fontCache);
@@ -299,14 +299,14 @@
LogUtil.handleError(log, "font-triplet without name", strict);
return null;
}
-
+
String weightStr = tripletCfg.getAttribute("weight");
if (weightStr == null) {
LogUtil.handleError(log, "font-triplet without weight", strict);
return null;
}
int weight = FontUtil.parseCSS2FontWeight(FontUtil.stripWhiteSpace(weightStr));
-
+
String style = tripletCfg.getAttribute("style");
if (style == null) {
LogUtil.handleError(log, "font-triplet without style", strict);
@@ -320,7 +320,7 @@
}
return null;
}
-
+
/**
* Returns a font info from a font node Configuration definition
*
@@ -337,7 +337,7 @@
String metricsUrl = fontCfg.getAttribute("metrics-url", null);
String embedUrl = fontCfg.getAttribute("embed-url", null);
String subFont = fontCfg.getAttribute("sub-font", null);
-
+
if (metricsUrl == null && embedUrl == null) {
LogUtil.handleError(log,
"Font configuration without metric-url or embed-url attribute",
@@ -366,13 +366,13 @@
}
}
}
-
+
Configuration[] tripletCfg = fontCfg.getChildren("font-triplet");
-
+
// no font triplet info
if (tripletCfg.length == 0) {
LogUtil.handleError(log, "font without font-triplet", strict);
-
+
File fontFile = FontCache.getFileFromUrls(new String[] {embedUrl, metricsUrl});
URL fontUrl;
try {
@@ -384,28 +384,28 @@
}
if (fontFile != null) {
FontInfoFinder finder = new FontInfoFinder();
- EmbedFontInfo[] infos = finder.find(fontUrl, fontResolver, fontCache);
+ EmbedFontInfo[] infos = finder.find(fontUrl, fontResolver, fontCache);
return infos[0]; //When subFont is set, only one font is returned
} else {
return null;
}
}
-
+
List/*<FontTriplet>*/ tripletList = new java.util.ArrayList/*<FontTriplet>*/();
for (int j = 0; j < tripletCfg.length; j++) {
FontTriplet fontTriplet = getFontTripletFromConfiguration(tripletCfg[j], strict);
tripletList.add(fontTriplet);
}
-
+
boolean useKerning = fontCfg.getAttributeAsBoolean("kerning", true);
EmbedFontInfo embedFontInfo
- = new EmbedFontInfo(metricsUrl, useKerning, tripletList, embedUrl, subFont);
+ = new EmbedFontInfo(metricsUrl, useKerning, tripletList, embedUrl, subFont);
if (fontCache != null) {
if (!fontCache.containsFont(embedFontInfo)) {
- fontCache.addFont(embedFontInfo);
+ fontCache.addFont(embedFontInfo);
}
}
-
+
if (log.isDebugEnabled()) {
String embedFile = embedFontInfo.getEmbedFile();
log.debug("Adding font " + (embedFile != null ? embedFile + ", " : "")
@@ -417,8 +417,8 @@
+ triplet.getStyle() + ", "
+ triplet.getWeight());
}
- }
+ }
return embedFontInfo;
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPRenderer.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/afp/AFPRenderer.java Fri May 9 05:30:40 2008
@@ -497,7 +497,7 @@
AffineTransform positionTransform = new AffineTransform();
positionTransform.translate(bv.getXOffset(), bv.getYOffset());
-
+
//"left/"top" (bv.getX/YOffset()) specify the position of the content rectangle
positionTransform.translate(-borderPaddingStart, -borderPaddingBefore);
@@ -506,7 +506,7 @@
//saveGraphicsState();
//Viewport position
//concatenateTransformationMatrix(mptToPt(positionTransform));
-
+
//Background and borders
float bpwidth = (borderPaddingStart + bv.getBorderAndPaddingWidthEnd()) / 1000f;
float bpheight = (borderPaddingBefore + bv.getBorderAndPaddingWidthAfter()) / 1000f;
@@ -537,7 +537,7 @@
//concatenateTransformationMatrix(mptToPt(contentTransform));
contentRect = new Rectangle2D.Double(0, 0, 1000 * width, 1000 * height);
pushViewPortPos(new ViewPortPos(contentRect, new CTM(contentTransform)));
-
+
currentIPPosition = 0;
currentBPPosition = 0;
renderBlocks(bv, children);
@@ -595,7 +595,7 @@
//Not used here since AFPRenderer defines its own renderBlockViewport() method.
throw new UnsupportedOperationException("NYI");
}
-
+
/**
* {@inheritDoc}
*/
@@ -919,7 +919,7 @@
private static final ImageFlavor[] FLAVORS = new ImageFlavor[]
{ImageFlavor.RAW_CCITTFAX,
ImageFlavor.GRAPHICS2D,
- ImageFlavor.BUFFERED_IMAGE,
+ ImageFlavor.BUFFERED_IMAGE,
ImageFlavor.RENDERED_IMAGE,
ImageFlavor.XML_DOM};
@@ -947,12 +947,12 @@
try {
ImageSessionContext sessionContext = getUserAgent().getImageSessionContext();
info = manager.getImageInfo(uri, sessionContext);
-
+
//Only now fully load/prepare the image
Map hints = ImageUtil.getDefaultHints(sessionContext);
org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
info, FLAVORS, hints, sessionContext);
-
+
//...and process the image
if (img instanceof ImageGraphics2D) {
ImageGraphics2D imageG2D = (ImageGraphics2D)img;
@@ -966,7 +966,7 @@
} else if (img instanceof ImageRendered) {
ImageRendered imgRend = (ImageRendered)img;
RenderedImage ri = imgRend.getRenderedImage();
-
+
drawBufferedImage(ri, getResolution(),
posInt.x + currentIPPosition,
posInt.y + currentBPPosition,
@@ -1029,7 +1029,7 @@
getUserAgent().getEventBroadcaster());
eventProducer.imageIOError(this, (info != null ? info.toString() : uri), ioe, null);
}
-
+
/*
ImageFactory fact = userAgent.getFactory().getImageFactory();
FopImage fopimage = fact.getImage(url, userAgent);
@@ -1102,7 +1102,7 @@
if (!fopimage.load(FopImage.BITMAP)) {
return;
}
- convertToGrayScaleImage(io, fopimage.getBitmaps(),
+ convertToGrayScaleImage(io, fopimage.getBitmaps(),
fopimage.getWidth(), fopimage.getHeight());
}
} else {
@@ -1413,9 +1413,9 @@
*/
// UNUSED
// public void setOptions(Map options) {
-//
+//
// this.afpOptions = options;
-//
+//
// }
/**
* Determines the orientation from the string representation, this method
@@ -1482,7 +1482,7 @@
/**
* Sets the rotation to be used for landsacpe pages, valid values are 0, 90,
* 180, 270 (default).
- *
+ *
* @param rotation
* The rotation in degrees.
*/
@@ -1649,7 +1649,7 @@
io.setImageIDESize((byte) bitsPerPixel);
io.setImageData(bw);
}
-
+
private final class ViewPortPos {
private int x = 0;
@@ -1805,7 +1805,7 @@
}
this.resolution = resolution;
}
-
+
/**
* Returns the output/device resolution.
* @return the resolution in dpi
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Base14FontCollection.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Base14FontCollection.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Base14FontCollection.java Fri May 9 05:30:40 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.render.java2d;
@@ -31,7 +31,7 @@
public class Base14FontCollection implements FontCollection {
private Graphics2D graphics2d = null;
-
+
/**
* Main constructor
* @param graphics2d a graphics 2D
@@ -39,7 +39,7 @@
public Base14FontCollection(Graphics2D graphics2d) {
this.graphics2d = graphics2d;
}
-
+
/**
* {@inheritDoc}
*/
@@ -175,7 +175,7 @@
fontInfo.addFontProperties("F8", "Times Roman", Font.STYLE_ITALIC, Font.WEIGHT_BOLD);
fontInfo.addFontProperties("F9", "Computer-Modern-Typewriter",
"normal", Font.WEIGHT_NORMAL);
-
+
return 15;
}
}
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java Fri May 9 05:30:40 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.render.java2d;
@@ -54,7 +54,7 @@
public ConfiguredFontCollection(PrintRenderer renderer) {
this.renderer = renderer;
}
-
+
/**
* {@inheritDoc}
*/
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/ConfiguredFontCollection.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java Fri May 9 05:30:40 2008
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-/* $Id: $ */
+/* $Id$ */
package org.apache.fop.render.java2d;
@@ -67,7 +67,7 @@
public InstalledFontCollection(Graphics2D graphics2D) {
this.graphics2D = graphics2D;
}
-
+
/**
* {@inheritDoc}
*/
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
------------------------------------------------------------------------------
svn:keywords = Id
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Java2DRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Java2DRenderer.java?rev=654783&r1=654782&r2=654783&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Java2DRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/java2d/Java2DRenderer.java Fri May 9 05:30:40 2008
@@ -129,17 +129,17 @@
/** false: paints a non-transparent white background, true: for a transparent background */
protected boolean transparentPageBackground = false;
-
+
/** The current state, holds a Graphics2D and its context */
protected Java2DGraphicsState state;
-
+
private Stack stateStack = new Stack();
/** true if the renderer has finished rendering all the pages */
private boolean renderingDone;
private GeneralPath currentPath = null;
-
+
/** Default constructor */
public Java2DRenderer() {
}
@@ -150,7 +150,7 @@
public void setUserAgent(FOUserAgent foUserAgent) {
super.setUserAgent(foUserAgent);
userAgent.setRendererOverride(this); // for document regeneration
-
+
String s = (String)userAgent.getRendererOptions().get(JAVA2D_TRANSPARENT_PAGE_BACKGROUND);
if (s != null) {
this.transparentPageBackground = "true".equalsIgnoreCase(s);
@@ -173,9 +173,9 @@
BufferedImage.TYPE_INT_RGB);
Graphics2D graphics2D = fontImage.createGraphics();
//The next line is important to get accurate font metrics!
- graphics2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
+ graphics2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);
-
+
userAgent.getFactory().getFontManager().setupRenderer(this, graphics2D);
}
@@ -218,7 +218,7 @@
public boolean isRenderingDone() {
return this.renderingDone;
}
-
+
/**
* @return The 0-based current page number
*/
@@ -279,7 +279,7 @@
assert pageViewport.getPageIndex() >= 0;
pageViewportList.add(pageViewport);
}
-
+
/**
* Generates a desired page from the renderer's page viewport list.
*
@@ -300,18 +300,18 @@
+ " (pageWidth " + pageWidth + ", pageHeight "
+ pageHeight + ")");
- double scaleX = scaleFactor
- * (25.4 / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION)
+ double scaleX = scaleFactor
+ * (25.4 / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION)
/ userAgent.getTargetPixelUnitToMillimeter();
double scaleY = scaleFactor
* (25.4 / FopFactoryConfigurator.DEFAULT_TARGET_RESOLUTION)
/ userAgent.getTargetPixelUnitToMillimeter();
int bitmapWidth = (int) ((pageWidth * scaleX) + 0.5);
int bitmapHeight = (int) ((pageHeight * scaleY) + 0.5);
-
-
+
+
BufferedImage currentPageImage = getBufferedImage(bitmapWidth, bitmapHeight);
-
+
Graphics2D graphics = currentPageImage.createGraphics();
graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,
RenderingHints.VALUE_FRACTIONALMETRICS_ON);
@@ -374,7 +374,7 @@
return new BufferedImage(
bitmapWidth, bitmapHeight, BufferedImage.TYPE_INT_ARGB);
}
-
+
/**
* Returns a page viewport.
* @param pageIndex the page index (zero-based)
@@ -414,21 +414,21 @@
state.dispose();
state = (Java2DGraphicsState)stateStack.pop();
}
-
+
/** {@inheritDoc} */
protected void concatenateTransformationMatrix(AffineTransform at) {
state.transform(at);
}
-
+
/** {@inheritDoc} */
protected void startVParea(CTM ctm, Rectangle2D clippingRect) {
saveGraphicsState();
if (clippingRect != null) {
- clipRect((float)clippingRect.getX() / 1000f,
- (float)clippingRect.getY() / 1000f,
- (float)clippingRect.getWidth() / 1000f,
+ clipRect((float)clippingRect.getX() / 1000f,
+ (float)clippingRect.getY() / 1000f,
+ (float)clippingRect.getWidth() / 1000f,
(float)clippingRect.getHeight() / 1000f);
}
@@ -465,7 +465,7 @@
*/
protected void restoreStateStackAfterBreakOut(List breakOutList) {
log.debug("Block.FIXED --> restoring context after break-out");
-
+
Iterator i = breakOutList.iterator();
while (i.hasNext()) {
Java2DGraphicsState s = (Java2DGraphicsState)i.next();
@@ -475,7 +475,7 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected void updateColor(Color col, boolean fill) {
state.updateColor(col);
@@ -500,7 +500,7 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected void lineTo(float x, float y) {
if (currentPath == null) {
@@ -510,7 +510,7 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected void moveTo(float x, float y) {
if (currentPath == null) {
@@ -520,26 +520,26 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected void clipRect(float x, float y, float width, float height) {
state.updateClip(new Rectangle2D.Float(x, y, width, height));
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected void fillRect(float x, float y, float width, float height) {
state.getGraph().fill(new Rectangle2D.Float(x, y, width, height));
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
- protected void drawBorderLine(float x1, float y1, float x2, float y2,
+ protected void drawBorderLine(float x1, float y1, float x2, float y2,
boolean horz, boolean startOrBefore, int style, Color col) {
Graphics2D g2d = state.getGraph();
- drawBorderLine(new Rectangle2D.Float(x1, y1, x2 - x1, y2 - y1),
+ drawBorderLine(new Rectangle2D.Float(x1, y1, x2 - x1, y2 - y1),
horz, startOrBefore, style, col, g2d);
}
@@ -547,13 +547,13 @@
* Draw a border segment of an XSL-FO style border.
* @param lineRect the line defined by its bounding rectangle
* @param horz true for horizontal border segments, false for vertical border segments
- * @param startOrBefore true for border segments on the start or before edge,
+ * @param startOrBefore true for border segments on the start or before edge,
* false for end or after.
* @param style the border style (one of Constants.EN_DASHED etc.)
* @param col the color for the border segment
* @param g2d the Graphics2D instance to paint to
*/
- public static void drawBorderLine(Rectangle2D.Float lineRect,
+ public static void drawBorderLine(Rectangle2D.Float lineRect,
boolean horz, boolean startOrBefore, int style, Color col, Graphics2D g2d) {
float x1 = lineRect.x;
float y1 = lineRect.y;
@@ -566,7 +566,7 @@
return;
}
switch (style) {
- case Constants.EN_DASHED:
+ case Constants.EN_DASHED:
g2d.setColor(col);
if (horz) {
float unit = Math.abs(2 * h);
@@ -576,7 +576,7 @@
}
unit = w / rep;
float ym = y1 + (h / 2);
- BasicStroke s = new BasicStroke(h, BasicStroke.CAP_BUTT,
+ BasicStroke s = new BasicStroke(h, BasicStroke.CAP_BUTT,
BasicStroke.JOIN_MITER, 10.0f, new float[] {unit}, 0);
g2d.setStroke(s);
g2d.draw(new Line2D.Float(x1, ym, x2, ym));
@@ -588,7 +588,7 @@
}
unit = h / rep;
float xm = x1 + (w / 2);
- BasicStroke s = new BasicStroke(w, BasicStroke.CAP_BUTT,
+ BasicStroke s = new BasicStroke(w, BasicStroke.CAP_BUTT,
BasicStroke.JOIN_MITER, 10.0f, new float[] {unit}, 0);
g2d.setStroke(s);
g2d.draw(new Line2D.Float(xm, y1, xm, y2));
@@ -604,7 +604,7 @@
}
unit = w / rep;
float ym = y1 + (h / 2);
- BasicStroke s = new BasicStroke(h, BasicStroke.CAP_ROUND,
+ BasicStroke s = new BasicStroke(h, BasicStroke.CAP_ROUND,
BasicStroke.JOIN_MITER, 10.0f, new float[] {0, unit}, 0);
g2d.setStroke(s);
g2d.draw(new Line2D.Float(x1, ym, x2, ym));
@@ -616,7 +616,7 @@
}
unit = h / rep;
float xm = x1 + (w / 2);
- BasicStroke s = new BasicStroke(w, BasicStroke.CAP_ROUND,
+ BasicStroke s = new BasicStroke(w, BasicStroke.CAP_ROUND,
BasicStroke.JOIN_MITER, 10.0f, new float[] {0, unit}, 0);
g2d.setStroke(s);
g2d.draw(new Line2D.Float(xm, y1, xm, y2));
@@ -722,7 +722,7 @@
state.transform(at);
renderText(text, state.getGraph(), font);
restoreGraphicsState();
-
+
currentIPPosition = saveIP + text.getAllocIPD();
//super.renderText(text);
@@ -755,8 +755,8 @@
int[] letterAdjust = word.getLetterAdjustArray();
GlyphVector gv = g2d.getFont().createGlyphVector(g2d.getFontRenderContext(), s);
double additionalWidth = 0.0;
- if (letterAdjust == null
- && text.getTextLetterSpaceAdjust() == 0
+ if (letterAdjust == null
+ && text.getTextLetterSpaceAdjust() == 0
&& text.getTextWordSpaceAdjust() == 0) {
//nop
} else {
@@ -776,8 +776,8 @@
SpaceArea space = (SpaceArea)child;
String s = space.getSpace();
char sp = s.charAt(0);
- int tws = (space.isAdjustable()
- ? text.getTextWordSpaceAdjust()
+ int tws = (space.isAdjustable()
+ ? text.getTextWordSpaceAdjust()
+ 2 * text.getTextLetterSpaceAdjust()
: 0);
@@ -787,8 +787,8 @@
}
}
}
-
- private static int[] getGlyphOffsets(String s, Font font, TextArea text,
+
+ private static int[] getGlyphOffsets(String s, Font font, TextArea text,
int[] letterAdjust) {
int textLen = s.length();
int[] offsets = new int[textLen];
@@ -804,11 +804,11 @@
}
int cw = font.getWidth(mapped);
int ladj = (letterAdjust != null && i < textLen - 1 ? letterAdjust[i + 1] : 0);
- int tls = (i < textLen - 1 ? text.getTextLetterSpaceAdjust() : 0);
+ int tls = (i < textLen - 1 ? text.getTextLetterSpaceAdjust() : 0);
offsets[i] = cw + ladj + tls + wordSpace;
}
return offsets;
- }
+ }
/**
* Render leader area. This renders a leader area which is an area with a
@@ -824,7 +824,7 @@
float startx = (currentIPPosition + area.getBorderAndPaddingWidthStart()) / 1000f;
float starty = ((currentBPPosition + area.getOffset()) / 1000f);
- float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
+ float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
+ area.getIPD()) / 1000f;
Color col = (Color) area.getTrait(Trait.COLOR);
@@ -839,7 +839,7 @@
case EN_SOLID:
case EN_DASHED:
case EN_DOUBLE:
- drawBorderLine(startx, starty, endx, starty + ruleThickness,
+ drawBorderLine(startx, starty, endx, starty + ruleThickness,
true, true, style, col);
break;
case EN_DOTTED:
@@ -905,7 +905,7 @@
int x = currentIPPosition + (int)Math.round(pos.getX());
int y = currentBPPosition + (int)Math.round(pos.getY());
uri = URISpecification.getURL(uri);
-
+
ImageManager manager = getUserAgent().getFactory().getImageManager();
ImageInfo info = null;
try {
@@ -913,8 +913,8 @@
info = manager.getImageInfo(uri, sessionContext);
final ImageFlavor[] flavors = new ImageFlavor[]
{ImageFlavor.GRAPHICS2D,
- ImageFlavor.BUFFERED_IMAGE,
- ImageFlavor.RENDERED_IMAGE,
+ ImageFlavor.BUFFERED_IMAGE,
+ ImageFlavor.RENDERED_IMAGE,
ImageFlavor.XML_DOM};
Map hints = ImageUtil.getDefaultHints(sessionContext);
org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
@@ -958,7 +958,7 @@
}
/** {@inheritDoc} */
- protected RendererContext createRendererContext(int x, int y, int width, int height,
+ protected RendererContext createRendererContext(int x, int y, int width, int height,
Map foreignAttributes) {
RendererContext context = super.createRendererContext(
x, y, width, height, foreignAttributes);
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org