xmlgraphics-fop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbowdi...@apache.org
Subject svn commit: r510531 - /xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRenderer.java
Date Thu, 22 Feb 2007 14:25:09 GMT
Author: cbowditch
Date: Thu Feb 22 06:25:08 2007
New Revision: 510531

URL: http://svn.apache.org/viewvc?view=rev&rev=510531
Log:
quick and dirty fix for underlining in PCL. Only works for text-rendering="auto"

Modified:
    xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRenderer.java

Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRenderer.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRenderer.java?view=diff&rev=510531&r1=510530&r2=510531
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRenderer.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/render/pcl/PCLRenderer.java Thu Feb 22 06:25:08
2007
@@ -20,11 +20,7 @@
 package org.apache.fop.render.pcl;
 
 //Java
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Graphics2D;
-import java.awt.Rectangle;
-import java.awt.RenderingHints;
+import java.awt.*;
 import java.awt.color.ColorSpace;
 import java.awt.geom.AffineTransform;
 import java.awt.geom.GeneralPath;
@@ -72,6 +68,7 @@
 import org.apache.fop.area.inline.Viewport;
 import org.apache.fop.area.inline.WordArea;
 import org.apache.fop.fo.extensions.ExtensionElementMapping;
+import org.apache.fop.fo.Constants;
 import org.apache.fop.fonts.Font;
 import org.apache.fop.fonts.FontInfo;
 import org.apache.fop.image.EPSImage;
@@ -576,10 +573,11 @@
 
         //Determine position
         int saveIP = currentIPPosition;
-        int rx = currentIPPosition + text.getBorderAndPaddingWidthStart();
+        final int rx = currentIPPosition + text.getBorderAndPaddingWidthStart();
         int bl = currentBPPosition + text.getOffset() + text.getBaselineOffset();
 
         try {
+
             final Color col = (Color)text.getTrait(Trait.COLOR);
             boolean pclFont = allTextAsBitmaps 
                     ? false
@@ -596,8 +594,13 @@
                 graphicContext.translate(rx, bl);
                 setCursorPos(0, 0);
                 gen.setTransparencyMode(true, true);
-                
+                if (text.hasUnderline()) {
+                    gen.writeCommand("&d0D");
+                }
                 super.renderText(text); //Updates IPD and renders words and spaces
+                if (text.hasUnderline()) {
+                    gen.writeCommand("&d@");
+                }
                 restoreGraphicsState();
             } else {
                 //Use Java2D to paint different fonts via bitmap
@@ -630,6 +633,7 @@
                         g2d.scale(1000, 1000);
                         g2d.setColor(col);
                         Java2DRenderer.renderText(text, g2d, font);
+                        // TODO: enable underlining
                     }
                     
                     public Dimension getImageSize() {



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org


Mime
View raw message