/** * Draw a string using the current font and color in the x,y coordinates. The font is drawn from * the top position and not the baseline. * * @param str the string to be drawn. * @param x the x coordinate. * @param y the y coordinate. * @param textDecoration Text decoration bitmask (See Style's TEXT_DECORATION_* constants) */ public void drawString(String str, int x, int y, int textDecoration) { Object nativeFont = null; if (current != null) { nativeFont = current.getNativeFont(); } impl.drawString( nativeGraphics, nativeFont, str, x + xTranslate, y + yTranslate, textDecoration); }
/** * Sets the font to use with the drawString method calls * * @param font the font used with the drawString method calls */ public void setFont(Font font) { this.current = font; if (!(font instanceof CustomFont)) { impl.setNativeFont(nativeGraphics, font.getNativeFont()); } }