Package com.ms.awt |
![]() Previous |
![]() Microsoft Packages |
![]() Index |
![]() Next |
public class FontX extends Font { // Fields public static final int EMBEDDED = 1; public static final int STRIKEOUT = 2; public static final int UNDERLINE = 4; public static final int OUTLINE = 8; // Constructors public FontX(String name, int style, int size); public FontX(String name, int style, int size, boolean bEmbed); public FontX(String name, int style, int size, int xFlags); // Methods public boolean isTypeable(int language); public int getFlags() public String getFamily(); public String getName(); public int getStyle(); public int getSize(); public boolean isPlain(); public boolean isBold(); public boolean isItalic(); public int hashCode(); public boolean equals(Object obj); public String toString(); public static String[] getFontList(); public static FontX ChooseFont(Component c); public static FontX ChooseFont(Component c, FontX f); }
Creates a font object that defines the font family, font face, style, and size. Supports TrueType fonts.
public FontX(String name, int style, int size)Creates a new font with the specified name, style, and point size.
Parameter Description name The name of the font face. style The font style. Can be a combination of these values:
BOLD ITALIC PLAIN size The point size of the font.
public FontX(String name, int style, int size, boolean bEmbed)Creates a new font with the specified name, style, and point size, and specifies whether the font is embedded.
Parameter Description name The name of the font face. style The font style. Can be a combination of these values:
BOLD ITALIC PLAIN size The point size of the font. bEmbed Set to true if the font is embedded, false otherwise.
public FontX(String name, int style, int size, int xFlags)Creates an extended font.
Parameter Description name The name of the font face. style The font style. Can be a combination of these values:
BOLD ITALIC PLAIN size The point size of the font. xFlags Extended styles. Can be one of these values:
EMBEDDED UNDERLINE STRIKEOUT OUTLINE
public boolean isTypeable(int language)Checks whether the font is typeable in the given language.
Return Value:
Returns true if the font is typeable, false otherwise.
Parameter Description language The identifier of the language to check.
public int getFlags()Returns the extended flags of a FontX object.
Return Value:
Returns a combination of these extended styles: EMBEDDED, STRIKEOUT, UNDERLINE, and OUTLINE.
public boolean equals(Object obj)Checks whether the argument is not null and is either a Font or FontX object with the same name, same style, and same point size as this FontX.
Return Value:
Returns true if the objects are equal, false otherwise.
public String toString()Returns a string that specifies the family, font face, style, and size of the given font.
Return Value:
Returns a string having this format:
class[family=family-name,name=font-name,style=bold/italic,size=size]
public static String[] getFontList()Retrieves a list of the names of the font faces available.
Return Value:
Returns a string array, each component of which specifies the name of an available font face.
public static FontX ChooseFont(Component c)Displays a dialog box to allow the user to choose a font. A default font will be initialized.
Return Value:
Returns a FontX object or null if the user canceled the dialog box by pressing the Cancel button.
Parameter Description c The component that owns the dialog box (and subsequently is blocked until the dialog box is closed).
public static FontX ChooseFont(Component c, FontX f)Displays a dialog box to allow the user to choose a font. The default font will be initialized to the given font.
Return Value:
Returns a FontX object or null if the user canceled the dialog box by pressing the Cancel button.
Parameter Description c The component that owns the dialog box (and subsequently is blocked until the dialog box is closed). f The FontX object to use as the default.
See also Class FontX.