|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
totalcross.lang.Objecttotalcross.ui.font.Font
public final class Font
Font is the character font used when drawing text on a surface. Fonts can be antialiased, and usually range from size 6 to 22.
| Field Summary | |
|---|---|
static int |
BIG_SIZE
A big-sized font (2 above the normal size) |
static String |
DEFAULT
The default font name: "TCFont". |
FontMetrics |
fm
|
Object |
hv_UserFont
|
static int |
MAX_FONT_SIZE
The maximum font size: 22. |
static int |
MIN_FONT_SIZE
The minimum font size: 6. |
String |
name
Read only field that contains the font's name. |
static int |
NORMAL_SIZE
A normal-sized font |
int |
size
Read only field that contains the font's size. |
int |
style
Read only field that contains the font's style. |
static int |
TAB_SIZE
The tab size will be TAB_SIZE * font's max width. |
| Method Summary | |
|---|---|
Font |
asBold()
Returns this font as Bold |
static int |
getDefaultFontSize()
Returns the default font size, based on the screen's size. |
static Font |
getFont(boolean boldStyle,
int size)
Gets the instance of the default font, with the given style and size. |
static Font |
getFont(String name,
boolean boldStyle,
int size)
Gets the instance of a font of the given name, style and size. |
| Methods inherited from class totalcross.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public String name
public int style
public int size
public Object hv_UserFont
public FontMetrics fm
public static final int NORMAL_SIZE
public static final int BIG_SIZE
public static final String DEFAULT
public static final int MIN_FONT_SIZE
public static final int MAX_FONT_SIZE
public static int TAB_SIZE
| Method Detail |
|---|
public static int getDefaultFontSize()
public static Font getFont(boolean boldStyle,
int size)
boldStyle - If true, a bold font is used. Otherwise, a plain font is used.size - If you want a text bigger than the standard size, use Font.NORMAL_SIZE+x; or if you want
a text smaller than the standard size, use Font.NORMAL_SIZE-x. Size is adjusted to be in the range
Font.MIN_FONT_SIZE ... Font.MAX_FONT_SIZE.
public static Font getFont(String name,
boolean boldStyle,
int size)
name - "TCFont" is the default font. You must install other fonts if you want to use them.boldStyle - If true, a bold font is used. Otherwise, a plain font is used.size - If you want a text bigger than the standard size, use Font.NORMAL_SIZE+x; or if you want
a text smaller than the standard size, use Font.NORMAL_SIZE-x. Size is adjusted to be in the range
Font.MIN_FONT_SIZE ... Font.MAX_FONT_SIZE.public Font asBold()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||