|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--waba.fx.Font
Font is the character font used when drawing text on a surface.
Fonts have a name, such as "Helvetica", a style and a point size (usually around 10). It's important to note that many devices have an extremely limited number of fonts. For example, most PalmPilot devices have only two fonts: plain and bold. If the font specified can't be found during drawing, the closest matching font will be used.
Here is an example showing text being drawn in a given font:
... Font font = new Font("Helvetica", Font.BOLD, 10); } public void onPaint(Graphics g) { g.setFont(font); g.drawText("Hello", 10, 10); ...PS: in palm OS, if font size is greater than 12, it uses the large font set (added by guich@121)
Field Summary | |
static int |
BOLD
A bold font style. |
static int |
PLAIN
A plain font style. |
Constructor Summary | |
Font(java.lang.String name,
int style,
int size)
Creates a font of the given name, style and size. |
Method Summary | |
Font |
asBold()
returns this font as Bold |
java.lang.String |
getName()
Returns the name of the font. |
int |
getSize()
Returns the size of the font. |
int |
getStyle()
Returns the style of the font. |
Methods inherited from class java.lang.Object |
hashCode,
toString |
Field Detail |
public static final int PLAIN
public static final int BOLD
Constructor Detail |
public Font(java.lang.String name, int style, int size)
PLAIN
,
BOLD
,
Graphics
Method Detail |
public java.lang.String getName()
public int getSize()
public int getStyle()
PLAIN
,
BOLD
public Font asBold()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |