* Draw a string to the PostScript document. The text is painted using
* text operations.
* {@inheritDoc}
*/
public void drawString(Graphics2D g, String s, float x, float y) throws IOException {
PSGraphics2D g2d = (PSGraphics2D)g;
g2d.preparePainting();
if (this.overrideFont == null) {
java.awt.Font awtFont = g2d.getFont();
this.font = createFont(awtFont);
} else {
this.font = this.overrideFont;
this.overrideFont = null;
}
//Color and Font state
g2d.establishColor(g2d.getColor());
establishCurrentFont();
PSGenerator gen = getPSGenerator();
gen.saveGraphicsState();
//Clip
Shape imclip = g2d.getClip();
g2d.writeClip(imclip);
//Prepare correct transformation
AffineTransform trans = g2d.getTransform();
gen.concatMatrix(trans);
gen.writeln(gen.formatDouble(x) + " "
+ gen.formatDouble(y) + " moveto ");
gen.writeln("1 -1 scale");