*/
public void drawString(AttributedCharacterIterator iterator, float x,
float y) {
preparePainting();
Font fontState = null;
Shape imclip = getClip();
writeClip(imclip);
Color c = getColor();
applyColor(c, true);
applyPaint(getPaint(), true);
boolean fill = true;
boolean stroke = false;
if (true) {
Stroke currentStroke = getStroke();
stroke = true;
applyStroke(currentStroke);
applyColor(c, false);
applyPaint(getPaint(), false);
}
currentStream.write("BT\n");
// set text rendering mode:
// 0 - fill, 1 - stroke, 2 - fill then stroke
int textr = 0;
if (fill && stroke) {
textr = 2;
} else if (stroke) {
textr = 1;
}
currentStream.write(textr + " Tr\n");
AffineTransform trans = getTransform();
trans.translate(x, y);
double[] vals = new double[6];
trans.getMatrix(vals);
for (char ch = iterator.first(); ch != CharacterIterator.DONE;
ch = iterator.next()) {
//Map attr = iterator.getAttributes();
String name = fontState.getFontName();
int size = fontState.getFontSize();
if ((!name.equals(this.currentFontName))
|| (size != this.currentFontSize)) {
this.currentFontName = name;
this.currentFontSize = size;
currentStream.write("/" + name + " " + (size / 1000)