]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Changes to PSTextPainter to accomodate new Batik library.
authorGlen Mazza <gmazza@apache.org>
Tue, 9 Sep 2003 19:43:49 +0000 (19:43 +0000)
committerGlen Mazza <gmazza@apache.org>
Tue, 9 Sep 2003 19:43:49 +0000 (19:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196897 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/render/ps/PSTextPainter.java

index f8ed1d10a53b87132debe02908dc3919cfff23a8..855be1ddcfca0537509398dc1187d42282f987f7 100644 (file)
@@ -69,6 +69,7 @@ import org.apache.batik.gvt.text.Mark;
 import org.apache.batik.gvt.TextPainter;
 import org.apache.batik.gvt.TextNode;
 import org.apache.batik.gvt.text.GVTAttributedCharacterIterator;
+import org.apache.batik.gvt.text.TextPaintInfo;
 import org.apache.batik.gvt.font.GVTFontFamily;
 import org.apache.batik.bridge.SVGFontFamily;
 import org.apache.batik.gvt.renderer.StrokingTextPainter;
@@ -130,6 +131,14 @@ public class PSTextPainter implements TextPainter {
         if (ch == AttributedCharacterIterator.DONE) {
             return;
         }
+
+        TextPaintInfo tpi = (TextPaintInfo) aci.getAttribute(
+            GVTAttributedCharacterIterator.TextAttribute.PAINT_INFO);
+        
+        if (tpi == null) {
+            return;
+        }        
+
         TextNode.Anchor anchor;
         anchor = (TextNode.Anchor) aci.getAttribute(
                       GVTAttributedCharacterIterator.TextAttribute.ANCHOR_TYPE);
@@ -138,15 +147,12 @@ public class PSTextPainter implements TextPainter {
         gvtFonts = (List) aci.getAttribute(
                       GVTAttributedCharacterIterator.TextAttribute.GVT_FONT_FAMILIES);
         Paint forg = (Paint) aci.getAttribute(TextAttribute.FOREGROUND);
-        Paint strokePaint;
-        strokePaint = (Paint) aci.getAttribute(
-                     GVTAttributedCharacterIterator.TextAttribute.STROKE_PAINT);
+        Paint strokePaint = tpi.strokePaint;
         Float size = (Float) aci.getAttribute(TextAttribute.SIZE);
         if (size == null) {
             return;
         }
-        Stroke stroke = (Stroke) aci.getAttribute(
-                          GVTAttributedCharacterIterator.TextAttribute.STROKE);
+        Stroke stroke = tpi.strokeStroke;
         /*
         Float xpos = (Float) aci.getAttribute(
                        GVTAttributedCharacterIterator.TextAttribute.X);