/**
* {@inheritDoc}
*/
public void drawString(final String s, final float x, final float y) {
FontPdf font;
float size;
if (this.overrideFont == null) {
font = getImplicitFont();
size = getFont().getSize();
} else {
font = this.overrideFont;
size = this.overrideFontSize;
this.overrideFont = null;
}
if (font != this.getGraphicsState().font
|| (size != this.getGraphicsState().fontSize)) {
this.getGraphicsState().font = font;
this.getGraphicsState().fontSize = size;
final String fontName = this.pdfContext.getFontName(font.getFontUse());
this.write("/" + fontName + " " + size + " Tf");
}
this.saveGraphicsState();
final Shape imclip = getClip();
writeClip(imclip);
Color c = getColor();
applyColor(c, true);
c = getBackground();
applyColor(c, false);
this.write("BT");
final AffineTransform trans = getTransform();
trans.translate(x, y);
final double[] vals = new double[PsUtil.MATRIX_QTY_ELEMENTS];
trans.getMatrix(vals);
final String matrixString = octalMatrixToString(vals);
this.write(matrixString + "cm");
this.write("1 0 0 -1 0 0 Tm ");
final String outputString = font.textToPdf(s, true);
this.write(outputString);
this.write("ET");
this.restoreGraphicsState();
}