Font

Name

Font

[Graphic: Figure from the text]

Description

The Font class represents a specific font to the system.

Class Definition

public class java.awt.Font extends java.lang.Object implements java.io.Serializable {
 // Constants public static final int BOLD;
public static final int ITALIC;
public static final int PLAIN; // Variables protected String name; protected int size; protected int style; // Constructors public Font (String name, int style, int size); // Class Methods public static Font decode (String str); public static Font getFont (String name) public static Font getFont (String name, Font defaultFont) // Instance Methods public boolean equals (Object object);
public String getFamily();
public String getName();
public FontPeer getPeer(); public int getSize();
public int getStyle();
public int hashCode();
public boolean isBold();
public boolean isItalic();
public boolean isPlain();
public String toString();
}

Constants

BOLD

public static final int BOLD

Constant for specifying bold fonts.

ITALIC

public static final int ITALIC

Constant for specifying fonts.

PLAIN

public static final int PLAIN

Constant for specifying plain fonts.

Variables

name

protected String name

The font's logical name.

size

protected int size

The font size; allegedly in points, though probably not true typographer's points.

style

protected int style

The font style, e.g., bold or italic or a combination thereof.

Constructors

Font

public Font (String name, int style, int size)

Class Methods

decode

public static Font decode (String str)

getFont

public static Font getFont (String name)

public static Font getFont (String name, Font defaultFont)

Instance Methods

equals

public boolean equals (Object object)

getFamily

public String getFamily()

getName

public String getName()

getPeer

public FontPeer getPeer()

getSize

public int getSize()

getStyle

public int getStyle()

hashCode

public int hashCode()

isBold

public boolean isBold()

isItalic

public boolean isItalic()

isPlain

public boolean isPlain()

toString

public String toString()

See Also

FontMetrics, Object, Properties, String