| 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.
See also Class FontX.
public FontX(String name, int style, int size)Creates a new font with the specified name, style, and point size.
Parameter Description name Name of the font face. style Font style. Can be a combination of these values:
BOLD ITALIC PLAIN size 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 Name of the font face. style Font style. Can be a combination of these values:
BOLD ITALIC PLAIN size Point size of the font. bEmbed 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 Name of the font face. style Font style. Can be a combination of these values:
BOLD ITALIC PLAIN size 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 can be typed in the given language.
Return Value:
Returns true if the font can be typed, false otherwise.
Parameter Description language Identifier of the language to be checked.
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 that the argument is not null, is either a Font or FontX object, and has the same name, same style, and same point size as this FontX object.
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 containing the names of available font faces.
public static FontX ChooseFont(Component c)Displays a dialog box that allows 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 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 that allows 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 Component that owns the dialog box (and subsequently is blocked until the dialog box is closed). f FontX object to use as the default.
| © 1997 Microsoft Corporation. All rights reserved. Terms of Use. |