java.lang.Object | +--java.awt.FontAll Implemented Interfaces:
static int | BOLD Constant indicating a "bold" font. |
static int | CENTER_BASELINE |
static int | HANGING_BASELINE |
static int | ITALIC Constant indicating an "italic" font. |
static int | LAYOUT_LEFT_TO_RIGHT A flag for |
static int | LAYOUT_NO_LIMIT_CONTEXT A flag for |
static int | LAYOUT_NO_START_CONTEXT A flag for |
static int | LAYOUT_RIGHT_TO_LEFT A flag for |
static int | PLAIN Constant indicating a "plain" font. |
static int | ROMAN_BASELINE |
static int | TRUETYPE_FONT Indicates to |
java.lang.String | name The name of this font |
float | pointSize |
int | size The font point size. |
int | style The 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 BOLD
public static final int CENTER_BASELINE
public static final int HANGING_BASELINE
public static final int ITALIC
public static final int LAYOUT_LEFT_TO_RIGHT
layoutGlyphVector
, indicating that the
orientation of a text run is from left to right.
public static final int LAYOUT_NO_LIMIT_CONTEXT
layoutGlyphVector
, 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_CONTEXT
layoutGlyphVector
, 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_LEFT
layoutGlyphVector
, indicating that the
orientation of a text run is from right to left.
public static final int PLAIN
public static final int ROMAN_BASELINE
public static final int TRUETYPE_FONT
createFont
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 name
protected float pointSize
protected int size
protected int style
public 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()