aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/java2d
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/org/apache/fop/render/java2d')
-rw-r--r--src/java/org/apache/fop/render/java2d/Base14FontCollection.java4
-rw-r--r--src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java4
-rw-r--r--src/java/org/apache/fop/render/java2d/FontMetricsMapper.java6
-rw-r--r--src/java/org/apache/fop/render/java2d/InstalledFontCollection.java6
-rw-r--r--src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java28
-rw-r--r--src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java14
-rw-r--r--src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java6
-rw-r--r--src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java4
-rw-r--r--src/java/org/apache/fop/render/java2d/Java2DRendererContextConstants.java2
-rw-r--r--src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java24
-rw-r--r--src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java6
11 files changed, 52 insertions, 52 deletions
diff --git a/src/java/org/apache/fop/render/java2d/Base14FontCollection.java b/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
index ca4a4bce3..29e80dc2f 100644
--- a/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
+++ b/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java
index 3a773a2db..63b04da32 100644
--- a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java
+++ b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java
index ff246af2b..2f87b62ea 100644
--- a/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java
+++ b/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -34,5 +34,5 @@ public interface FontMetricsMapper extends FontMetrics {
* @return font with the desired characteristics.
*/
java.awt.Font getFont(int size);
-
+
}
diff --git a/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java b/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
index 4eac922e8..fe4e04766 100644
--- a/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
+++ b/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -61,7 +61,7 @@ public class InstalledFontCollection implements FontCollection {
/**
* Main constructor
- *
+ *
* @param graphics2D a graphics 2D
*/
public InstalledFontCollection(Graphics2D graphics2D) {
diff --git a/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java b/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java
index 64e329c62..10af3aa86 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.java2d;
// Java
@@ -63,17 +63,17 @@ public class Java2DFontMetrics {
* The typical height of a small cap latter (often derived from "x", value in mpt)
*/
private int xHeight = 0;
-
+
/**
* The highest point of the font above the baseline (usually derived from "d", value in mpt)
*/
private int ascender = 0;
-
+
/**
* The lowest point of the font under the baseline (usually derived from "p", value in mpt)
*/
private int descender = 0;
-
+
/**
* Buffered font.
* f1 is bufferd for metric measurements during layout.
@@ -103,7 +103,7 @@ public class Java2DFontMetrics {
/** A LineMetrics to access high-resolution metrics information. */
private LineMetrics lineMetrics;
-
+
/**
* Temp graphics object needed to get the font metrics
*/
@@ -130,7 +130,7 @@ public class Java2DFontMetrics {
setFont(family, style, size);
return Math.round(lineMetrics.getAscent() * FONT_FACTOR);
}
-
+
/**
* Determines the font ascent of the Font described by this
* FontMetrics object
@@ -159,7 +159,7 @@ public class Java2DFontMetrics {
* Rectangle FontMetrics.getStringBounds(..) method can be called.
* The y value of the rectangle is the offset from the origin
* (baseline) apparently needed by the sample test program
- *
+ *
* xxxxx@xxxxx 2001-05-15
*/
/* I don't think this is right.
@@ -231,7 +231,7 @@ public class Java2DFontMetrics {
Rectangle2D rect = fmt.getStringBounds(ch, 0, 1, this.graphics);
return (int)Math.round(rect.getWidth() * 1000);
}
-
+
/**
* Return widths (in 1/1000ths of point size) of all
* characters
@@ -265,7 +265,7 @@ public class Java2DFontMetrics {
atts.put(TextAttribute.SIZE, new Float(size)); //size in pt
return new Font(atts);
}
-
+
/**
* Checks whether the font for which values are
* requested is the one used immediately before or
@@ -301,17 +301,17 @@ public class Java2DFontMetrics {
TextLayout layout = new TextLayout("x", f1, graphics.getFontRenderContext());
Rectangle2D rect = layout.getBounds();
xHeight = (int)Math.round(-rect.getY() * 1000);
-
+
//PostScript-compatible ascent
layout = new TextLayout("d", f1, graphics.getFontRenderContext());
rect = layout.getBounds();
ascender = (int)Math.round(-rect.getY() * 1000);
-
+
//PostScript-compatible descent
layout = new TextLayout("p", f1, graphics.getFontRenderContext());
rect = layout.getBounds();
descender = (int)Math.round((rect.getY() + rect.getHeight()) * -1000);
-
+
//Alternative way to get metrics but the ascender is again wrong for our purposes
lineMetrics = f1.getLineMetrics("", graphics.getFontRenderContext());
}
diff --git a/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java b/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
index b29378a96..8fe93d051 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.java2d;
import java.awt.Color;
@@ -40,12 +40,12 @@ public class Java2DGraphics2DAdapter extends AbstractGraphics2DAdapter {
public void paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException {
-
+
float fwidth = width / 1000f;
float fheight = height / 1000f;
float fx = x / 1000f;
float fy = y / 1000f;
-
+
// get the 'width' and 'height' attributes of the SVG document
Dimension dim = painter.getImageSize();
float imw = (float)dim.getWidth() / 1000f;
@@ -56,12 +56,12 @@ public class Java2DGraphics2DAdapter extends AbstractGraphics2DAdapter {
Java2DRenderer renderer = (Java2DRenderer)context.getRenderer();
Java2DGraphicsState state = renderer.state;
-
+
//Create copy and paint on that
Graphics2D g2d = (Graphics2D)state.getGraph().create();
g2d.setColor(Color.black);
g2d.setBackground(Color.black);
-
+
//TODO Clip to the image area.
// transform so that the coordinates (0,0) is from the top left
diff --git a/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java b/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
index 31da90c95..1c5fa8427 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
@@ -73,14 +73,14 @@ public class Java2DGraphicsState {
* @param org the instance to copy
*/
public Java2DGraphicsState(Java2DGraphicsState org) {
- this.currentGraphics = (Graphics2D)org.currentGraphics.create();
+ this.currentGraphics = (Graphics2D)org.currentGraphics.create();
this.fontInfo = org.fontInfo;
this.initialTransform = org.initialTransform;
this.currentStroke = org.currentStroke;
this.currentStrokeStyle = org.currentStrokeStyle;
this.currentStrokeWidth = org.currentStrokeWidth;
}
-
+
/**
* @return the currently valid state
*/
@@ -92,7 +92,7 @@ public class Java2DGraphicsState {
public void dispose() {
this.currentGraphics.dispose();
this.currentGraphics = null;
-
+
}
/**
diff --git a/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java b/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java
index a18f71cc0..0709d4ea9 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
diff --git a/src/java/org/apache/fop/render/java2d/Java2DRendererContextConstants.java b/src/java/org/apache/fop/render/java2d/Java2DRendererContextConstants.java
index 0fd87f910..0157b7411 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DRendererContextConstants.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DRendererContextConstants.java
@@ -29,5 +29,5 @@ public interface Java2DRendererContextConstants extends
/** The current Java2DGraphicsState. */
String JAVA2D_STATE = "state";
-
+
}
diff --git a/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java b/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java
index 64ac823fc..12b269a44 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -94,7 +94,7 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler
+ "currentYPosition = " + currentYPosition + "}";
}
}
-
+
/** {@inheritDoc} */
protected void renderSVGDocument(RendererContext context,
Document doc) {
@@ -105,12 +105,12 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler
int x = info.currentXPosition;
int y = info.currentYPosition;
-
+
SVGUserAgent ua = new SVGUserAgent(context.getUserAgent(), new AffineTransform());
-
+
GVTBuilder builder = new GVTBuilder();
BridgeContext ctx = new BridgeContext(ua);
-
+
GraphicsNode root;
try {
root = builder.build(ctx, doc);
@@ -120,20 +120,20 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler
eventProducer.svgNotBuilt(this, e, getDocumentURI(doc));
return;
}
-
+
// If no viewbox is defined in the svg file, a viewbox of 100x100 is
// assumed, as defined in SVGUserAgent.getViewportSize()
float iw = (float) ctx.getDocumentSize().getWidth() * 1000f;
float ih = (float) ctx.getDocumentSize().getHeight() * 1000f;
-
+
float w = (float) info.width;
float h = (float) info.height;
AffineTransform origTransform = info.state.getGraph().getTransform();
-
+
// correct integer roundoff
info.state.getGraph().translate(x / 1000f, y / 1000f);
-
+
//SVGSVGElement svg = ((SVGDocument) doc).getRootElement();
// Aspect ratio preserved by layout engine, not here
AffineTransform at = AffineTransform.getScaleInstance(w / iw, h / ih);
@@ -148,10 +148,10 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler
context.getUserAgent().getEventBroadcaster());
eventProducer.svgRenderingError(this, e, getDocumentURI(doc));
}
-
+
info.state.getGraph().setTransform(origTransform);
}
-
+
/** {@inheritDoc} */
public boolean supportsRenderer(Renderer renderer) {
return (renderer instanceof Java2DRenderer);
diff --git a/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java
index 19e9a4d1d..afcf088cc 100644
--- a/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java
+++ b/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java
@@ -5,9 +5,9 @@
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.java2d;
// Java