aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2006-05-02 14:39:32 +0000
committerJeremias Maerki <jeremias@apache.org>2006-05-02 14:39:32 +0000
commit9641f2a32dca4bd7078f1fdbc2871292823ee423 (patch)
treecebb1894f24004d074ec080f3a731e342a2ac21c /src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
parent3267f6ba94eebd0f88a39d7502a53e916f38a7e4 (diff)
downloadxmlgraphics-fop-9641f2a32dca4bd7078f1fdbc2871292823ee423.tar.gz
xmlgraphics-fop-9641f2a32dca4bd7078f1fdbc2871292823ee423.zip
Java2D Renderer:
Symbol and ZapfDingbats now work due to a little change in FontSetup.java Made the class a subclass of AbstractPathOrientedRenderer. This enables to remove some redundant code. Border painting on a Graphics2D is now available to other renderers. PCL Renderer: Improved Graphics2D implementation. PCLGraphic2D throws an UnsupportedOperationException if it encounters a feature it cannot properly handle. The Graphics2DAdapter can then fall back to painting a graphic in-memory and then as a bitmap. Added border painting. PCLRenderer supports to modes "quality" and "speed". The user can configure the mode depending on his needs. In "speed" mode borders are painted as shaded rectangles only. In "quality" mode it uses border rendering of the Java2DRenderer. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@398945 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java')
-rw-r--r--src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java26
1 files changed, 7 insertions, 19 deletions
diff --git a/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java b/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
index 22596ea53..4e605f33a 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
@@ -141,18 +141,6 @@ public class Java2DGraphicsState implements Constants, RendererState {
}
/**
- * @see org.apache.fop.render.java2d.RendererState#updateColor(org.apache.fop.datatypes.ColorType,
- * boolean, java.lang.StringBuffer)
- */
- public boolean updateColor(ColorType col, boolean fill, StringBuffer pdf) {
- if (col == null) {
- return false;
- }
- Color newCol = toColor(col);
- return updateColor(newCol);
- }
-
- /**
* Update the current Color
* @param col the ColorType
*/
@@ -177,13 +165,13 @@ public class Java2DGraphicsState implements Constants, RendererState {
*/
public boolean updateFont(String name, int size, StringBuffer pdf) {
- boolean updateName = (!name.equals(getGraph().getFont().getFontName()));
- boolean updateSize = (size != (getGraph().getFont().getSize()));
+ FontMetricsMapper mapper = (FontMetricsMapper)fontInfo.getMetricsFor(name);
+ boolean updateName = (!mapper.getFontName().equals(
+ getGraph().getFont().getFontName()));
+ boolean updateSize = (size != (getGraph().getFont().getSize() * 1000));
if (updateName || updateSize) {
// the font name and/or the font size have changed
- FontMetricsMapper mapper = (FontMetricsMapper) fontInfo
- .getMetricsFor(name);
java.awt.Font font = mapper.getFont(size);
currentGraphics.setFont(font);
@@ -215,8 +203,8 @@ public class Java2DGraphicsState implements Constants, RendererState {
switch (style) {
case EN_DOTTED:
- currentStroke = new BasicStroke(width, BasicStroke.CAP_BUTT,
- BasicStroke.JOIN_BEVEL, 0f, new float[] { 2f }, 0f);
+ currentStroke = new BasicStroke(width, BasicStroke.CAP_ROUND,
+ BasicStroke.JOIN_BEVEL, 0f, new float[] {0, 2 * width}, width);
currentGraphics.setStroke(currentStroke);
currentStrokeWidth = width;
@@ -227,7 +215,7 @@ public class Java2DGraphicsState implements Constants, RendererState {
case EN_DASHED:
currentStroke = new BasicStroke(width, BasicStroke.CAP_BUTT,
- BasicStroke.JOIN_BEVEL, 0f, new float[] { 8f, 2f }, 0f);
+ BasicStroke.JOIN_BEVEL, 0f, new float[] {8f, 2f}, 0f);
currentGraphics.setStroke(currentStroke);
currentStrokeWidth = width;