All Packages Class Hierarchy This Package Previous Next Index
Class java.awt.Font
java.lang.Object
|
+----java.awt.Font
- public class Font
- extends Object
- implements Serializable
A class that produces font objects.
-
BOLD
- The bold style constant.
-
ITALIC
- The italicized style constant.
-
name
-
The logical name of this font.
-
PLAIN
- The plain style constant.
-
size
-
The point size of this font.
-
style
-
The style of the font.
-
Font(String, int, int)
- Creates a new font with the specified name, style and point size.
-
decode(String)
- Gets the specified font using the name passed in.
-
equals(Object)
- Compares this object to the specifed object.
-
getFamily()
- Gets the platform specific family name of the font.
-
getFont(String)
- Gets a font from the system properties list.
-
getFont(String, Font)
- Gets the specified font from the system properties list.
-
getName()
- Gets the logical name of the font.
-
getPeer()
- Gets the peer of the font.
-
getSize()
- Gets the point size of the font.
-
getStyle()
- Gets the style of the font.
-
hashCode()
- Returns a hashcode for this font.
-
isBold()
- Returns true if the font is bold.
-
isItalic()
- Returns true if the font is italic.
-
isPlain()
- Returns true if the font is plain.
-
toString()
-
Converts this object to a String representation.
PLAIN
public static final int PLAIN
- The plain style constant. This can be combined with the other style
constants for mixed styles.
BOLD
public static final int BOLD
- The bold style constant. This can be combined with the other style
constants for mixed styles.
ITALIC
public static final int ITALIC
- The italicized style constant. This can be combined with the other
style constants for mixed styles.
name
protected String name
- The logical name of this font.
style
protected int style
- The style of the font. This is the sum of the
constants PLAIN, BOLD, or ITALIC.
size
protected int size
- The point size of this font.
Font
public Font(String name,
int style,
int size)
- Creates a new font with the specified name, style and point size.
- Parameters:
- name - the font name
- style - the constant style used
- size - the point size of the font
- See Also:
- getFontList
getPeer
public FontPeer getPeer()
- Gets the peer of the font.
getFamily
public String getFamily()
- Gets the platform specific family name of the font.
Use getName to get the logical name of the font.
- See Also:
- getName
getName
public String getName()
- Gets the logical name of the font.
- See Also:
- getFamily
getStyle
public int getStyle()
- Gets the style of the font.
- See Also:
- isPlain, isBold, isItalic
getSize
public int getSize()
- Gets the point size of the font.
isPlain
public boolean isPlain()
- Returns true if the font is plain.
- See Also:
- getStyle
isBold
public boolean isBold()
- Returns true if the font is bold.
- See Also:
- getStyle
isItalic
public boolean isItalic()
- Returns true if the font is italic.
- See Also:
- getStyle
getFont
public static Font getFont(String nm)
- Gets a font from the system properties list.
- Parameters:
- nm - the property name
decode
public static Font decode(String str)
- Gets the specified font using the name passed in.
- Parameters:
- str - the name
getFont
public static Font getFont(String nm,
Font font)
- Gets the specified font from the system properties list.
- Parameters:
- nm - the property name
- font - a default font to return if property 'nm' is not defined
hashCode
public int hashCode()
- Returns a hashcode for this font.
- Overrides:
- hashCode in class Object
equals
public boolean equals(Object obj)
- Compares this object to the specifed object.
- Parameters:
- obj - the object to compare with
- Returns:
- true if the objects are the same; false otherwise.
- Overrides:
- equals in class Object
toString
public String toString()
- Converts this object to a String representation.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index
Submit a bug or feature