|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.FontFamily
public class FontFamily
A font family is a collection of font faces (fonts of differing sizes and styles) which belong to the same typeface and are referred to by the same family name. It can be used as a factory to create Font objects of specified sizes and styles.
Font
Field Summary | ||
---|---|---|
static int |
BITMAP_FONT
A bit flag indicating a bitmap font. |
|
static int |
CBTF_FONT
A type for CBTF (Compact Bitmap Typeface Format) fonts. |
|
static String |
FAMILY_SYSTEM
The family name of the system font. |
|
static int |
MONO_BITMAP_FONT
Deprecated. |
|
static int |
SCALABLE_FONT
A bit flag indicating a scalable font. |
|
static int |
SFF4_FONT
A type for SFF4 (Slangsoft Font Format 4) fonts. |
|
static int |
TRUE_TYPE_FONT
A type for TrueType fonts. |
|
static int |
UNKNOWN_FONT
A type for fonts of unknown type. |
Method Summary | ||
---|---|---|
boolean |
equals(Object object)
Compares one font family to another. |
|
static FontFamily |
forName(String name)
Retrieves a FontFamily object from the font registry by name, creating a new one and adding it to the font registry if the name is not found. |
|
Font |
getFont(int style,
int height)
Returns a font specified by style and size. |
|
Font |
getFont(int style,
int height,
int units)
Returns a font specified by style and size. |
|
static FontFamily[] |
getFontFamilies()
Return an array containing all registered font families. |
|
Font[] |
getFonts()
Deprecated. Use FontFamily.getFont(int, int) |
|
int[] |
getHeights()
Returns an array of heights in pixels supported by this font family. |
|
String |
getName()
Returns the font family's name. |
|
int |
getTypefaceType()
Get the typeface type. |
|
int |
hashCode()
Returns the hash code based on font family. |
|
boolean |
isHeightSupported(int height)
Determines if this font family supports a specific height. |
|
boolean |
isStyleSupported(int style)
Determines if this font family supports a specific style. |
|
String |
toString()
Retrieves a string representation of a font family. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static String FAMILY_SYSTEM
public static int BITMAP_FONT
public static int MONO_BITMAP_FONT
public static int SCALABLE_FONT
public static int UNKNOWN_FONT
public static int CBTF_FONT
public static int SFF4_FONT
public static int TRUE_TYPE_FONT
Method Detail |
---|
public static FontFamily forName(String name) throws ClassNotFoundException
name
- The name of the font family.
One of the permitted values is FontFamily.FAMILY_SYSTEM
.
ClassNotFoundException
public Font getFont(int style, int height)
style
- Bits selecting styles (Font.BOLD, Font.Italic, etc.).height
- Desired height in pixels.
Font
public Font getFont(int style, int height, int units)
style
- Bits selecting styles (Font.BOLD, Font.Italic, etc.).height
- Desired height in units specified by units.units
- The units for height. See the UNITS_* constants in the Ui class.
Font
public static FontFamily[] getFontFamilies()
public int getTypefaceType()
public int[] getHeights()
public final String getName()
public String toString()
toString
in class Object
public final boolean isHeightSupported(int height)
height
- A font height in pixels.
public boolean isStyleSupported(int style)
Use this method to determine if this font family supports a given font style.
Subclasses of FontFamily
must implement this method. We
recommend that this method should return true only if every font
contained in the font family supports the specified style.
style
- Font style you want to check (that is, PLAIN
,
BOLD
, and so on.)
Font
public Font[] getFonts()
FontFamily.getFont(int, int)
If this font family supports scalable fonts, this method should return null.
Font
objects supported by this family.public boolean equals(Object object)
equals
in class Object
object
- The other font family object.
Boolean.hashCode()
,
Hashtable
public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
Hashtable
|
|||||||||
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