SVGLengthList xs = _x.getAnimVal();
SVGLengthList ys = _y.getAnimVal();
SVGLengthList dxs = _dx.getAnimVal();
SVGLengthList dys = _dy.getAnimVal();
SVGNumberList rs = _rotate.getAnimVal();
int len;
// process the x attribute
len = xs.getNumberOfItems();
for (int i = 0; i < len && firstChar + i <= lastChar; i++) {
as.addAttribute
(GVTAttributedCharacterIterator.TextAttribute.X,
new Float(xs.getItem(i).getValue()), firstChar + i,
firstChar + i + 1);
}
// process the y attribute
len = ys.getNumberOfItems();
for (int i = 0; i < len && firstChar + i <= lastChar; i++) {
as.addAttribute
(GVTAttributedCharacterIterator.TextAttribute.Y,
new Float(ys.getItem(i).getValue()), firstChar + i,
firstChar + i + 1);
}
// process dx attribute
len = dxs.getNumberOfItems();
for (int i = 0; i < len && firstChar + i <= lastChar; i++) {
as.addAttribute
(GVTAttributedCharacterIterator.TextAttribute.DX,
new Float(dxs.getItem(i).getValue()), firstChar + i,
firstChar + i + 1);
}
// process dy attribute
len = dys.getNumberOfItems();
for (int i = 0; i < len && firstChar + i <= lastChar; i++) {
as.addAttribute
(GVTAttributedCharacterIterator.TextAttribute.DY,
new Float(dys.getItem(i).getValue()), firstChar + i,
firstChar + i + 1);
}
// process rotate attribute
len = rs.getNumberOfItems();
if (len == 1) { // not a list
// each char will have the same rotate value
Float rad = new Float(Math.toRadians(rs.getItem(0).getValue()));
as.addAttribute
(GVTAttributedCharacterIterator.TextAttribute.ROTATION,
rad, firstChar, lastChar + 1);
} else if (len > 1) { // it's a list
// set each rotate value from the list
for (int i = 0; i < len && firstChar + i <= lastChar; i++) {
Float rad = new Float(Math.toRadians(rs.getItem(i).getValue()));
as.addAttribute
(GVTAttributedCharacterIterator.TextAttribute.ROTATION,
rad, firstChar + i, firstChar + i + 1);
}
}