DCT Lightfoot v3 API specification

javax.microedition.lcdui
Class Font

java.lang.Object
  |
  +--javax.microedition.lcdui.Font

public class Font
extends Object

This stores information about a font


Field Summary
static int FACE_MONOSPACE
          Monospace font
static int FACE_PROPORTIONAL
          Proportional font
static int FACE_SYSTEM
          System font
static int SIZE_LARGE
          Large size
static int SIZE_MEDIUM
          Medium size
static int SIZE_SMALL
          Small size
static int STYLE_BOLD
          Bold style
static int STYLE_ITALIC
          Italic style
static int STYLE_PLAIN
          Plain style
static int STYLE_UNDERLINED
          Underlined style
 
Method Summary
 int charsWidth(char[] ch, int offset, int length)
          Get the width of the characters
 int charWidth(char ch)
          Get the width of a character
 int getBaselinePosition()
          Get the baseline position
static Font getDefaultFont()
          Get the default font
 int getFace()
          Get the face
static Font getFont(int face, int style, int size)
          Get the specified font
 int getHeight()
          Get the height
 int getSize()
          Get the size
 int getStyle()
          Get the style
 boolean isBold()
          See if it is bold
 boolean isItalic()
          See if it is italic
 boolean isPlain()
          See if it is plain
 boolean isUnderlined()
          See if it is underlined
 int stringWidth(java.lang.String str)
          Return the width of the string
 int substringWidth(java.lang.String str, int offset, int length)
          Return the width of the substring
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACE_MONOSPACE

public static final int FACE_MONOSPACE
Monospace font

See Also:
Constant Field Values

FACE_PROPORTIONAL

public static final int FACE_PROPORTIONAL
Proportional font

See Also:
Constant Field Values

FACE_SYSTEM

public static final int FACE_SYSTEM
System font

See Also:
Constant Field Values

SIZE_LARGE

public static final int SIZE_LARGE
Large size

See Also:
Constant Field Values

SIZE_MEDIUM

public static final int SIZE_MEDIUM
Medium size

See Also:
Constant Field Values

SIZE_SMALL

public static final int SIZE_SMALL
Small size

See Also:
Constant Field Values

STYLE_BOLD

public static final int STYLE_BOLD
Bold style

See Also:
Constant Field Values

STYLE_ITALIC

public static final int STYLE_ITALIC
Italic style

See Also:
Constant Field Values

STYLE_PLAIN

public static final int STYLE_PLAIN
Plain style

See Also:
Constant Field Values

STYLE_UNDERLINED

public static final int STYLE_UNDERLINED
Underlined style

See Also:
Constant Field Values
Method Detail

getDefaultFont

public static Font getDefaultFont()
Get the default font

Returns:
the default font

getFont

public static Font getFont(int face,
                           int style,
                           int size)
Get the specified font

Parameters:
face - The face
style - The style
size - The size
Returns:
the specified font

charsWidth

public int charsWidth(char[] ch,
                      int offset,
                      int length)
Get the width of the characters

Parameters:
ch - The characters
offset - The offset
length - The length
Returns:
the width
Throws:
ArrayIndexOutOfBoundsException - if the offset and length are invalid
NullPointerException - if ch is null

charWidth

public int charWidth(char ch)
Get the width of a character

Parameters:
ch - The character
Returns:
the width

getBaselinePosition

public int getBaselinePosition()
Get the baseline position

Returns:
the baseline position

getFace

public int getFace()
Get the face

Returns:
the face

getHeight

public int getHeight()
Get the height

Returns:
the height

getSize

public int getSize()
Get the size

Returns:
the size

getStyle

public int getStyle()
Get the style

Returns:
the style

isBold

public boolean isBold()
See if it is bold

Returns:
true if it is bold

isItalic

public boolean isItalic()
See if it is italic

Returns:
true if it is italic

isPlain

public boolean isPlain()
See if it is plain

Returns:
true if it is plain

isUnderlined

public boolean isUnderlined()
See if it is underlined

Returns:
true if it is underlined

stringWidth

public int stringWidth(java.lang.String str)
Return the width of the string

Parameters:
str - The string
Returns:
the width

substringWidth

public int substringWidth(java.lang.String str,
                          int offset,
                          int length)
Return the width of the substring

Parameters:
str - The string
offset - The offset
length - The length
Returns:
the width

DCT Lightfoot v3 API specification

DCT Lightfoot v3 API specification