Author: jeremias
Date: Tue Aug 26 01:14:11 2008
New Revision: 688990

URL: http://svn.apache.org/viewvc?rev=688990&view=rev
Log:
Fixed cursor advancement for fixed width spaces.
Set color before "BT" (beginText) to match the old PDFRenderer.

Modified:
    
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/pdf/PDFPainter.java

Modified: 
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/pdf/PDFPainter.java
URL: 
http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/pdf/PDFPainter.java?rev=688990&r1=688989&r2=688990&view=diff
==============================================================================
--- 
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/pdf/PDFPainter.java
 (original)
+++ 
xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/render/pdf/PDFPainter.java
 Tue Aug 26 01:14:11 2008
@@ -393,6 +393,7 @@
     /** [EMAIL PROTECTED] */
     public void drawText(int x, int y, int[] dx, int[] dy, String text) throws 
IFException {
         //Note: dy is currently ignored
+        generator.updateColor(state.getTextColor(), true, null);
         generator.beginTextObject();
         FontTriplet triplet = new FontTriplet(
                 state.getFontFamily(), state.getFontStyle(), 
state.getFontWeight());
@@ -401,7 +402,6 @@
         String fontKey = fontInfo.getInternalFontKey(triplet);
         int sizeMillipoints = state.getFontSize();
         float fontSize = sizeMillipoints / 1000f;
-        generator.updateColor(state.getTextColor(), true, null);
 
         // This assumes that *all* CIDFonts use a /ToUnicode mapping
         Typeface tf = getTypeface(fontKey);
@@ -442,7 +442,8 @@
                 if (CharUtilities.isFixedWidthSpace(orgChar)) {
                     //Fixed width space are rendered as spaces so copy/paste 
works in a reader
                     ch = font.mapChar(CharUtilities.SPACE);
-                    glyphAdjust = -(font.getCharWidth(ch) - 
font.getCharWidth(orgChar));
+                    int spaceDiff = font.getCharWidth(ch) - 
font.getCharWidth(orgChar);
+                    glyphAdjust = -(10 * spaceDiff / fontSize);
                 } else {
                     ch = font.mapChar(orgChar);
                 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to