January 2002
Intermediate to advanced
264 pages
8h 3m
English
javax.microedition.lcdui.Font
This class represents fonts and font metrics. Applications query for
fonts based on font attributes and the system will attempt to provide
a font that matches the requested attributes as closely as possible.
Some of these attributes are style, size, and face. Values for the
style attribute may be combined using the logical
OR operator (e.g., STYLE_BOLD | STYLE_ITALIC), whereas values for the other attributes may
not be combined (e.g., SIZE_LARGE | SIZE_SMALL is
illegal).
public final classFont{ // public class fields public static final intFACE_MONOSPACE= 32; public static final intFACE_PROPORTIONAL= 64; public static final intFACE_SYSTEM= 0; public static final intSIZE_LARGE= 16; public static final intSIZE_MEDIUM= 0; public static final intSIZE_SMALL= 8; public static final intSTYLE_BOLD= 1; public static final intSTYLE_ITALIC= 2; public static final intSTYLE_PLAIN= 0; public static final intSTYLE_UNDERLINED= 4; // public class methods public static FontgetDefaultFont( ); public static FontgetFont(int face, int style, int size); // public instance methods public intcharsWidth(char[] ch, int offset, int length); public intcharWidth(char ch); public intgetBaselinePosition( ); public intgetFace( ); public intgetHeight( ); public intgetSize( ); public intgetStyle( ); public booleanisBold( ); public booleanisItalic( ); public booleanisPlain( ); public booleanisUnderlined( ); public intstringWidth(String str); ...
Read now
Unlock full access