java.lang.Object | +--java.awt.FontAll Implemented Interfaces:
static int | BOLDConstant indicating a "bold" font. |
static int | CENTER_BASELINE |
static int | HANGING_BASELINE |
static int | ITALICConstant indicating an "italic" font. |
static int | LAYOUT_LEFT_TO_RIGHT A flag for |
static int | LAYOUT_NO_LIMIT_CONTEXTA flag for |
static int | LAYOUT_NO_START_CONTEXTA flag for |
static int | LAYOUT_RIGHT_TO_LEFT A flag for |
static int | PLAINConstant indicating a "plain" font. |
static int | ROMAN_BASELINE |
static int | TRUETYPE_FONT Indicates to |
java.lang.String | nameThe name of this font |
float | pointSize |
int | sizeThe font point size. |
int | styleThe font style, which is a combination (by summing, not OR-ing) of the font style constants in this class. |
Font(java.lang.String name, int style, int size) Initializes a new instance of |
static java.awt.Font | decode(java.lang.String fontspec)Creates a |
boolean | equals(java.lang.Object obj)Tests whether or not the specified object is equal to this font. |
java.lang.String | getFamily()Returns the system specific font family name. |
static java.awt.Font | getFont(java.lang.String propname, java.awt.Font defval) Returns a |
static java.awt.Font | getFont(java.lang.String propname) Returns a |
java.lang.String | getName()Returns the name of the font. |
java.awt.peer.FontPeer | getPeer()Returns a native peer object for this font. |
int | getSize()Returns the style of the font. |
float | getSize2D() |
int | getStyle() |
int | hashCode()Returns a hash value for this font. |
boolean | isBold()Tests whether or not this font is bold. |
boolean | isItalic()Tests whether or not this font is italic. |
boolean | isPlain()Tests whether or not this is a plain font. |
java.lang.String | toString()Returns a string representation of this font. |
public static final int BOLDpublic static final int CENTER_BASELINEpublic static final int HANGING_BASELINEpublic static final int ITALICpublic static final int LAYOUT_LEFT_TO_RIGHTlayoutGlyphVector, indicating that the
orientation of a text run is from left to right.
public static final int LAYOUT_NO_LIMIT_CONTEXTlayoutGlyphVector, indicating that the
text does not contain valid characters after the
limit position. If this flag is set,
layoutGlyphVector does not examine the text after
limit, even if this would be necessary to select the
correct glyphs (e.g., for Arabic text).
public static final int LAYOUT_NO_START_CONTEXTlayoutGlyphVector, indicating that the
text does not contain valid characters before the
start position. If this flag is set,
layoutGlyphVector does not examine the text before
start, even if this would be necessary to select the
correct glyphs (e.g., for Arabic text).
public static final int LAYOUT_RIGHT_TO_LEFTlayoutGlyphVector, indicating that the
orientation of a text run is from right to left.
public static final int PLAINpublic static final int ROMAN_BASELINEpublic static final int TRUETYPE_FONTcreateFont that the supplied font data
is in TrueType format.
Specification Note: The Sun JavaDoc for J2SE 1.4 does not indicate whether this value also subsumes OpenType. OpenType is essentially the same format as TrueType, but allows to define glyph shapes in the same way as PostScript, using cubic bezier curves.
protected String nameprotected float pointSizeprotected int sizeprotected int stylepublic Font(java.lang.String name, int style, int size)Font with the specified
attributes.
name - The name of the font.style - The font style.size - The font point size.public static Font decode(java.lang.String fontspec)Font object from the specified string, which
is in one of the following formats:
The style should be one of BOLD, ITALIC, or BOLDITALIC. The default style if none is specified is PLAIN. The default size if none is specified is 12.
fontspec - public boolean equals(java.lang.Object obj)
null.
Font.
obj - true if the specified object is equal to this
object, false otherwise.public String getFamily()public static Font getFont(java.lang.String propname)Font object from the passed property name.
propname - The name of the system property.null if the property
not exist or is malformed.public static Font getFont(java.lang.String propname, java.awt.Font defval)Font object from the passed property name.
propname - The name of the system property.defval - Value to use if the property is not found.default if the property
not exist or is malformed.public String getName()public FontPeer getPeer()public int getSize()public float getSize2D()public int getStyle()public int hashCode()public boolean isBold()true if this font is bold, false
otherwise.public boolean isItalic()true if this font is italic, false
otherwise.public boolean isPlain()true if this is a plain font, false
otherwise.public String toString()