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
public static Font defaultFont()
- Returns the "default" font, currently defined to be Helvetica 12.
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.
public static Font fontNamed(String aString)
- Returns the Font identified by the String aString. Font names
normally take the form "FontName:style:size". This is a convience for
fontNamed() as the string is parsed apart and
then fontNamed(name, style, size) is called.
public FontMetrics fontMetrics()
- Returns the Font's font metrics.
public String family()
- Returns the Font's family.
public String name()
- Returns the Font's name. For local fonts this is the font name,
such as "Helvetica".
public int style()
- Returns the integer representation of the Font's style.
public int size()
- Returns the Font's point size.
public boolean isPlain()
- Returns true if the Font's style is "plain."
public boolean isBold()
- Returns true if the Font's style is "bold."
public boolean isItalic()
- Returns true if the Font's style is "italic."
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
public void describeClassInfo(ClassInfo info)
- Describes the Font class' information.
- See Also:
- describeClassInfo
public void encode(Encoder encoder) throws CodingException
- Encodes the Font instance by name.
- See Also:
- encode
public void decode(Decoder decoder) throws CodingException
- Decodes the Font instance by name.
- See Also:
- decode
public void finishDecoding() throws CodingException
- Finishes the Font's decoding.
- See Also:
- finishDecoding
All Packages Class Hierarchy This Package Previous Next Index
Copyright © 1997 Netscape Communications Corporation. All rights reserved
Please send any comments or corrections to ifcfeedback@netscape.com
HTML generated on 21 Oct 1997