Class Font
All Packages Class Hierarchy This Package Previous Next Index
Class Font
public class netscape.application.Font
extends java.lang.Object
implements netscape.util.Codable
{
/* Fields
*/
public final static int BOLD;
public final static int ITALIC;
public final static int PLAIN;
/* Constructors
*/
public Font();
public Font(String, int, int);
/* Methods
*/
public static Font defaultFont();
public static synchronized Font fontNamed(String, int, int);
public static Font fontNamed(String);
public void decode(Decoder);
public void describeClassInfo(ClassInfo);
public void encode(Encoder);
public String family();
public void finishDecoding();
public FontMetrics fontMetrics();
public boolean isBold();
public boolean isItalic();
public boolean isPlain();
public String name();
public int size();
public int style();
public String toString();
}
Object subclass representing a Font.
Fields
PLAIN
public final static int PLAIN
- Plain font style.
BOLD
public final static int BOLD
- Bold font style.
ITALIC
public final static int ITALIC
- Italic font style.
Constructors
Font
public Font()
- Constructs an empty Font. This constructor is only useful when
decoding.
Font
public Font(String name,
int style,
int size)
- Constructs a Font with the specified name, style and size.
Methods
defaultFont
public static Font defaultFont()
- Returns the "default" font, currently defined to be Helvetica 12.
fontNamed
public static synchronized Font fontNamed(String fontName,
int style,
int size)
- Retrieves the Font for the specified font name, style, and size, and
places it in the Application's font cache, allowing future requests
for the font to be handled efficiently.
fontNamed
public static Font fontNamed(String aString)
- Returns the Font identified by the String aString. Font names
take the form "FontName.style.size".
fontMetrics
public FontMetrics fontMetrics()
- Returns the Font's font metrics.
family
public String family()
- Returns the Font's family.
name
public String name()
- Returns the Font's name. For local fonts this is the font name,
such as "Helvetica".
style
public int style()
- Returns the integer representation of the Font's style.
size
public int size()
- Returns the Font's point size.
isPlain
public boolean isPlain()
- Returns true if the Font's style is "plain."
isBold
public boolean isBold()
- Returns true if the Font's style is "bold."
isItalic
public boolean isItalic()
- Returns true if the Font's style is "italic."
toString
public String toString()
- Returns the Font's string representation. The string takes the form
"Fontname.style.size" and is suitable for use in Font.fontNamed().
- Overrides:
- toString in class Object
describeClassInfo
public void describeClassInfo(ClassInfo info)
- Describes the Font class' information.
- See Also:
- describeClassInfo
encode
public void encode(Encoder encoder) throws CodingException
- Encodes the Font instance by name.
- See Also:
- encode
decode
public void decode(Decoder decoder) throws CodingException
- Decodes the Font instance by name.
- See Also:
- decode
finishDecoding
public void finishDecoding() throws CodingException
- Finishes the Font's decoding.
- See Also:
- finishDecoding
All Packages Class Hierarchy This Package Previous Next Index