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 gm...@apache.org on 2003/09/13 16:23:40 UTC

cvs commit: xml-fop/src/java/org/apache/fop/svg PDFGraphics2D.java PDFTextPainter.java

gmazza      2003/09/13 07:23:40

  Modified:    src/java/org/apache/fop/render/ps PSTextPainter.java
               src/java/org/apache/fop/svg PDFGraphics2D.java
                        PDFTextPainter.java
  Log:
  Applied Thomas DeWeese's (Batik team) patches to the transcoder code.
  patch info: http://marc.theaimsgroup.com/?l=fop-dev&m=106318855328310&w=2
  
  Revision  Changes    Path
  1.8       +1 -1      xml-fop/src/java/org/apache/fop/render/ps/PSTextPainter.java
  
  Index: PSTextPainter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/ps/PSTextPainter.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PSTextPainter.java	9 Sep 2003 19:43:49 -0000	1.7
  +++ PSTextPainter.java	13 Sep 2003 14:23:40 -0000	1.8
  @@ -146,7 +146,7 @@
           List gvtFonts;
           gvtFonts = (List) aci.getAttribute(
                         GVTAttributedCharacterIterator.TextAttribute.GVT_FONT_FAMILIES);
  -        Paint forg = (Paint) aci.getAttribute(TextAttribute.FOREGROUND);
  +        Paint forg = tpi.fillPaint;
           Paint strokePaint = tpi.strokePaint;
           Float size = (Float) aci.getAttribute(TextAttribute.SIZE);
           if (size == null) {
  
  
  
  1.11      +12 -28    xml-fop/src/java/org/apache/fop/svg/PDFGraphics2D.java
  
  Index: PDFGraphics2D.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/svg/PDFGraphics2D.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- PDFGraphics2D.java	20 Aug 2003 18:09:46 -0000	1.10
  +++ PDFGraphics2D.java	13 Sep 2003 14:23:40 -0000	1.11
  @@ -471,6 +471,7 @@
               g.setPaint(new Color(1, 1, 1, 0));
               g.fillRect(0, 0, width * scaleFactor, height * scaleFactor);
               g.clip(new Rectangle(0, 0, buf.getWidth(), buf.getHeight()));
  +            g.setComposite(gc.getComposite());
   
               if (!g.drawImage(img, 0, 0, buf.getWidth(), buf.getHeight(), observer)) {
                   return false;
  @@ -500,29 +501,10 @@
                           mask[maskpos++] = (byte)(alpha & 0xFF);
                           if (alpha != 255) {
                               hasMask = true;
  -                            /*
  -                            if (alpha != 0) {
  -                                binaryMask = false;
  -                            }*/
  -
  -                            // System.out.println("Alpha: " + alpha);
  -                            // Composite with opaque white...
  -                            add = (255 - alpha);
  -                            mult = (alpha << 16) / 255;
  -                            result[count++] =
  -                                (byte)(add
  -                                       + ((((val >> 16) & 0xFF) * mult) >> 16));
  -                            result[count++] =
  -                                (byte)(add
  -                                       + ((((val >> 8) & 0xFF) * mult) >> 16));
  -                            result[count++] = (byte)(add
  -                                                     + ((((val) & 0xFF) * mult)
  -                                                        >> 16));
  -                        } else {
  -                            result[count++] = (byte)((val >> 16) & 0xFF);
  -                            result[count++] = (byte)((val >> 8) & 0xFF);
  -                            result[count++] = (byte)((val) & 0xFF);
                           }
  +                        result[count++] = (byte)((val >> 16) & 0xFF);
  +                        result[count++] = (byte)((val >> 8) & 0xFF);
  +                        result[count++] = (byte)((val) & 0xFF);
                       }
                   }
                   break;
  @@ -641,12 +623,6 @@
        */
       public void draw(Shape s) {
           // System.out.println("draw(Shape)");
  -        Color c;
  -        c = getColor();
  -        if (c.getAlpha() == 0) {
  -            return;
  -        }
  -
           AffineTransform trans = getTransform();
           double[] tranvals = new double[6];
           trans.getMatrix(tranvals);
  @@ -672,6 +648,11 @@
               }
           }
   
  +        Color c;
  +        c = getColor();
  +        if (c.getAlpha() == 0) {
  +            return;
  +        }
           if (c.getAlpha() != 255) {
               Map vals = new java.util.HashMap();
               vals.put(PDFGState.GSTATE_ALPHA_STROKE, new Float(c.getAlpha() / 255f));
  @@ -1237,6 +1218,7 @@
           writeClip(imclip);
           Color c = getColor();
           applyColor(c, true);
  +        applyPaint(getPaint(), true);
           int salpha = c.getAlpha();
   
           if (salpha != 255) {
  @@ -1374,6 +1356,7 @@
           writeClip(imclip);
           Color c = getColor();
           applyColor(c, true);
  +        applyPaint(getPaint(), true);
   
           boolean fill = true;
           boolean stroke = false;
  @@ -1382,6 +1365,7 @@
               stroke = true;
               applyStroke(currentStroke);
               applyColor(c, false);
  +            applyPaint(getPaint(), false);
           }
   
           currentStream.write("BT\n");
  
  
  
  1.8       +1 -1      xml-fop/src/java/org/apache/fop/svg/PDFTextPainter.java
  
  Index: PDFTextPainter.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/svg/PDFTextPainter.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PDFTextPainter.java	9 Sep 2003 19:44:22 -0000	1.7
  +++ PDFTextPainter.java	13 Sep 2003 14:23:40 -0000	1.8
  @@ -138,7 +138,6 @@
           gvtFonts = (List) aci.getAttribute(
               GVTAttributedCharacterIterator.TextAttribute.GVT_FONT_FAMILIES);
   
  -        Paint forg = (Paint) aci.getAttribute(TextAttribute.FOREGROUND);
           TextPaintInfo tpi = (TextPaintInfo) aci.getAttribute(
               GVTAttributedCharacterIterator.TextAttribute.PAINT_INFO);
           
  @@ -146,6 +145,7 @@
               return;
           }        
           
  +        Paint forg = tpi.fillPaint;
           Paint strokePaint = tpi.strokePaint;
           Float size = (Float) aci.getAttribute(TextAttribute.SIZE);
           if (size == null) {
  
  
  

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