*/
public void paint(TextNode node, Graphics2D g2d) {
String txt = node.getText();
Point2D loc = node.getLocation();
AttributedCharacterIterator aci =
node.getAttributedCharacterIterator();
// reset position to start of char iterator
if (aci.getBeginIndex() == aci.getEndIndex()) {
return;
}
char ch = aci.first();
if (ch == AttributedCharacterIterator.DONE) {
return;
}
TextNode.Anchor anchor;
anchor = (TextNode.Anchor) aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.ANCHOR_TYPE);
List gvtFonts;
gvtFonts = (List) aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.GVT_FONT_FAMILIES);
TextPaintInfo tpi = (TextPaintInfo) aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.PAINT_INFO);
if (tpi == null) {
return;
}
Paint forg = tpi.fillPaint;
Paint strokePaint = tpi.strokePaint;
Float size = (Float) aci.getAttribute(TextAttribute.SIZE);
if (size == null) {
return;
}
Stroke stroke = tpi.strokeStroke;
/*
Float xpos = (Float) aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.X);
Float ypos = (Float) aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.Y);
*/
Float posture = (Float) aci.getAttribute(TextAttribute.POSTURE);
Float taWeight = (Float) aci.getAttribute(TextAttribute.WEIGHT);
boolean useStrokePainter = false;
if (forg instanceof Color) {
Color col = (Color) forg;