|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.FontSpec
public class FontSpec
FontSpec is a light weight class wrapping a few key Font parameters: font family, style, and height. Instances of this class are used as arguments for the following OpenVG functions: vgDrawText, vgMeasureText, and vgCreateText.
Field Summary | ||
---|---|---|
static int |
BOLD
A style bit for bold-face. |
|
static int |
BROKEN_LINE_UNDERLINED
A style bit for broken underlining. |
|
static int |
CURSIVE_STYLE
A style value to select a cursive font. |
|
static int |
DOTTED_UNDERLINED
A style bit for dotted underlining. |
|
static int |
EXTRA_BOLD
A style bit for extra-bold. |
|
static int |
FANTASY_STYLE
A style value to select a fantasy font as described in http://www.w3.org/TR/CSS2/fonts.html#generic-font-families. |
|
static int |
ITALIC
A style bit for italics. |
|
static int |
PLAIN
A style value: plain, not bold, italic, underlined, etc. |
|
static int |
STRIKE_THROUGH
A style bit for strike-through. |
|
static int |
UNDERLINED
A style bit for underlining. |
|
static int |
WAVY_UNDERLINED
A style bit for wavy underlining. |
Constructor Summary | ||
---|---|---|
FontSpec()
Creates a new font. |
||
FontSpec(FontFamily family)
Creates a new font specified by font-family. |
||
FontSpec(FontFamily family,
int style)
Creates a new font specified by font-family and style. |
||
FontSpec(FontFamily family,
int style,
int height)
Creates a new font specified by font-family, style and size. |
Method Summary | ||
---|---|---|
FontFamily |
getFontFamily()
Returns the font-family containing this font. |
|
int |
getHeight()
Returns the font's height. |
|
int |
getHeight(int units)
Returns the font's height. |
|
int |
getStyle()
Returns the font's style flags - bold, italic, underline, strikethrough, etc. |
|
void |
setFontFamily(FontFamily family)
Sets font-family. |
|
void |
setHeight(int height)
Sets font height. |
|
void |
setHeight(int height,
int units)
Sets font height. |
|
void |
setStyle(int style)
Sets font style - bold, italic, underline, strikethrough, etc. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int PLAIN
public static final int BOLD
public static final int ITALIC
public static final int UNDERLINED
public static final int DOTTED_UNDERLINED
public static final int BROKEN_LINE_UNDERLINED
public static final int STRIKE_THROUGH
public static final int EXTRA_BOLD
public static final int WAVY_UNDERLINED
public static final int CURSIVE_STYLE
public static final int FANTASY_STYLE
Constructor Detail |
---|
public FontSpec()
public FontSpec(FontFamily family)
family
- The font-family.public FontSpec(FontFamily family, int style)
family
- The font-family.style
- Bits selecting styles (FontSpec.BOLD, FontSpec.Italic, etc.).public FontSpec(FontFamily family, int style, int height)
family
- The font-family.style
- Bits selecting styles (FontSpec.BOLD, FontSpec.Italic, etc.).height
- Desired height in pixels.Method Detail |
---|
public FontFamily getFontFamily()
public void setFontFamily(FontFamily family)
family
- The font-family.public int getStyle()
public void setStyle(int style)
style
- Font style.public int getHeight()
Use this method to retrieve this font's block height (the drawing area for glyphs plus the leading).
public void setHeight(int height)
Use this method to set new font block height. (the drawing area for glyphs plus the leading).
height
- Font height in pixels.public int getHeight(int units)
Use this method to retrieve this font's block height (the drawing area for glyphs plus the leading).
units
- The units in which to return the height; must be one of Ui.UNITS_*.
public void setHeight(int height, int units)
Use this method to set new font block height. (the drawing area for glyphs plus the leading).
height
- Font height.units
- The units for the font height argument; must be one of Ui.UNITS_*.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal