|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Object
Font
public class Font
This class is a handle to font.
In order to obtain Font instances, use
getFont(int, int, int) or Style.font(int).
Fonts are described in the stylesheet of a widget. A font has three basic properties: face, size and style:
font-1: prop medium italic underlined
Graphics.getFont(),
Graphics.setFont(Font)| Method Summary | |
|---|---|
int |
height()
Returns the height of Font, in pixels. |
int |
stringWidth(String str)
Gets the total advance width for showing the specified String
in this Font. |
int |
substringWidth(String str,
int offset,
int len)
Gets the total advance width for showing the specified substring in this Font. |
| Methods inherited from class Object |
|---|
toString, equals, hashCode |
| Methods inherited from |
|---|
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public int height()
public int stringWidth(String str)
String
in this Font.
The advance width is the horizontal distance that would be occupied if
str were to be drawn using this Font,
including inter-character spacing following
str necessary for proper positioning of subsequent text.
str - the String to be measured
public int substringWidth(String str,
int offset,
int len)
Font.
The advance width is the horizontal distance that would be occupied if
the substring were to be drawn using this Font,
including inter-character spacing following
the substring necessary for proper positioning of subsequent text.
The offset and len parameters must
specify a valid range of characters
within str. The offset parameter must
be within the
range [0..(str.length())], inclusive.
The len parameter must be a non-negative
integer such that (offset + len) <= str.length().
str - the String to be measuredoffset - zero-based index of first character in the substringlen - length of the substring
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||