From: Glen Mazza Date: Tue, 9 Sep 2003 19:44:22 +0000 (+0000) Subject: Changes to PDFTextPainter to accomodate new Batik library. X-Git-Tag: Root_Temp_KnuthStylePageBreaking~1108 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cec578cc58b5d29143867b21d88ed74f24a90051;p=xmlgraphics-fop.git Changes to PDFTextPainter to accomodate new Batik library. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196898 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/fop/svg/PDFTextPainter.java b/src/java/org/apache/fop/svg/PDFTextPainter.java index 111ccb3e7..135d8740e 100644 --- a/src/java/org/apache/fop/svg/PDFTextPainter.java +++ b/src/java/org/apache/fop/svg/PDFTextPainter.java @@ -68,6 +68,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; @@ -118,7 +119,7 @@ public class PDFTextPainter implements TextPainter { // System.out.println("PDFText paint"); String txt = node.getText(); Point2D loc = node.getLocation(); - + AttributedCharacterIterator aci = node.getAttributedCharacterIterator(); // reset position to start of char iterator @@ -135,17 +136,22 @@ public class PDFTextPainter implements TextPainter { List gvtFonts; gvtFonts = (List) aci.getAttribute( - GVTAttributedCharacterIterator.TextAttribute.GVT_FONT_FAMILIES); + GVTAttributedCharacterIterator.TextAttribute.GVT_FONT_FAMILIES); + Paint forg = (Paint) aci.getAttribute(TextAttribute.FOREGROUND); - Paint strokePaint; - strokePaint = (Paint) aci.getAttribute( - GVTAttributedCharacterIterator.TextAttribute.STROKE_PAINT); + TextPaintInfo tpi = (TextPaintInfo) aci.getAttribute( + GVTAttributedCharacterIterator.TextAttribute.PAINT_INFO); + + if (tpi == null) { + return; + } + + 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);