key |= meFont.getFace(); key |= meFont.getStyle(); key |= meFont.getSize(); if (meFont.getFace() == Font.FACE_SYSTEM) { name = FACE_SYSTEM_NAME; } else if (meFont.getFace() == Font.FACE_MONOSPACE) { name = FACE_MONOSPACE_NAME; } else if (meFont.getFace() == Font.FACE_PROPORTIONAL) { name = FACE_PROPORTIONAL_NAME; if ((meFont.getStyle() & Font.STYLE_PLAIN) != 0) { style += "plain,"; if ((meFont.getStyle() & Font.STYLE_BOLD) != 0) { style += "bold,"; if ((meFont.getStyle() & Font.STYLE_ITALIC) != 0) { style += "italic,"; if ((meFont.getStyle() & Font.STYLE_ITALIC) != 0) { style += "underlined,"; if (meFont.getSize() == Font.SIZE_SMALL) { size = SIZE_SMALL; } else if (meFont.getSize() == Font.SIZE_MEDIUM) { size = SIZE_MEDIUM; } else if (meFont.getSize() == Font.SIZE_LARGE) { size = SIZE_LARGE;
/** * Create a <code>CanvasAppender</code>. constructor */ public CanvasAppender() { // Set default formatter formatter = new SimpleFormatter(); screenOffset = 0; // Create logging font loggingFont = Font.getFont(Font.FACE_MONOSPACE, Font.STYLE_PLAIN, Font.SIZE_SMALL); // Store size of a line writted writted in the screen with this font lineSize = loggingFont.getHeight(); }
public void drawString(String str, int x, int y, int anchor) { int newx = x; int newy = y; if (anchor == 0) { anchor = javax.microedition.lcdui.Graphics.TOP | javax.microedition.lcdui.Graphics.LEFT; } if ((anchor & javax.microedition.lcdui.Graphics.TOP) != 0) { newy += g.getFontMetrics().getAscent(); } else if ((anchor & javax.microedition.lcdui.Graphics.BOTTOM) != 0) { newy -= g.getFontMetrics().getDescent(); } if ((anchor & javax.microedition.lcdui.Graphics.HCENTER) != 0) { newx -= g.getFontMetrics().stringWidth(str) / 2; } else if ((anchor & javax.microedition.lcdui.Graphics.RIGHT) != 0) { newx -= g.getFontMetrics().stringWidth(str); } g.drawString(str, newx, newy); if ((currentFont.getStyle() & javax.microedition.lcdui.Font.STYLE_UNDERLINED) != 0) { g.drawLine(newx, newy + 1, newx + g.getFontMetrics().stringWidth(str), newy + 1); } }
return Font.getFont(meFace, meStyle, meSize);
if ((currentFont.getStyle() & javax.microedition.lcdui.Font.STYLE_UNDERLINED) != 0) { g.drawLine(newx, newy + 1, newx + g.stringWidth(str), newy + 1);
org.microemu.device.impl.Font getFont(Font meFont) { int key = 0; key |= meFont.getFace(); key |= meFont.getStyle(); key |= meFont.getSize(); if (meFont.getFace() == Font.FACE_SYSTEM) { name = FACE_SYSTEM_NAME; } else if (meFont.getFace() == Font.FACE_MONOSPACE) { name = FACE_MONOSPACE_NAME; } else if (meFont.getFace() == Font.FACE_PROPORTIONAL) { name = FACE_PROPORTIONAL_NAME; if ((meFont.getStyle() & Font.STYLE_PLAIN) != 0) { style += "plain,"; if ((meFont.getStyle() & Font.STYLE_BOLD) != 0) { style += "bold,"; if ((meFont.getStyle() & Font.STYLE_ITALIC) != 0) { style += "italic,"; if ((meFont.getStyle() & Font.STYLE_ITALIC) != 0) { style += "underlined,"; if (meFont.getSize() == Font.SIZE_SMALL) { size = SIZE_SMALL; } else if (meFont.getSize() == Font.SIZE_MEDIUM) { size = SIZE_MEDIUM; } else if (meFont.getSize() == Font.SIZE_LARGE) {