|
|||||||||
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("Tiny", Font.BOLD, 10); public void onPaint(Graphics g) { g.setFont(font); g.drawText("Hello", 10, 10); ...SuperWaba Notes:
g.setFont(new Font("myFont", Font.PLAIN or Font.BOLD,12 or 14))
.
myLabel.setFont(new Font("SystemNarrow",Font.PLAIN,12));
In this case, the style and size parameters are not used.
Field Summary | |
static int |
BOLD
A bold font style. |
static int |
PLAIN
A plain font style. |
Constructor Summary | |
Font(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 |
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 |
equals,
getClass,
hashCode,
notify,
toString,
wait,
wait |
Field Detail |
public static final int PLAIN
public static final int BOLD
Constructor Detail |
public Font(String name, int style, int size)
PLAIN
,
BOLD
,
Graphics
Method Detail |
public 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 |