java.awt.Font (JDK 1.0)
This class represents a font in a platform-independent way. The constructor accepts a font name, style, and point size. In Java 1.0, supported font names are: "TimesRoman," "Helvetica," "Courier," "Dialog," and "DialogInput." In Java 1.1, "Serif," "SansSerif," and "Monospaced" should be used in preference to the first three names. The style may be one of the constants PLAIN, BOLD, or ITALIC, or the sum BOLD+ITALIC.
The class method getFont() looks up the specified name in the system properties list and returns the font specified as the value of that property. It takes an optional Font default to use if the named font property is not found. This allows user customizability.
Use the FontMetrics class if you need to know how tall a font is or how wide a string drawn using that font will be.
public classFontextends Object implements Serializable { //Public ConstructorpublicFont(Stringname, intstyle, intsize); //Constantspublic static final intBOLD; public static final intITALIC; public static final intPLAIN; //Protected Instance Variablesprotected Stringname; protected intsize; protected intstyle; //Class Methods1.1 public static Fontdecode(Stringstr); public static FontgetFont(Stringnm); public static FontgetFont(Stringnm, Fontfont); //Public Instance Methodspublic booleanequals(Objectobj); //Overrides Objectpublic StringgetFamily(); public StringgetName(); 1.1 public FontPeergetPeer(); public intgetSize(); public intgetStyle(); public inthashCode(); //Overrides Objectpublic booleanisBold(); public booleanisItalic(); public booleanisPlain(); public StringtoString(); //Overrides Object}
Passed To:
Component.getFontMetrics(), Component.setFont(), ComponentPeer.getFontMetrics(), ComponentPeer.setFont(), Font.getFont(), FontMetrics(), Graphics.getFontMetrics(), Graphics.setFont(), MenuComponent.setFont(), Toolkit.getFontMetrics()
Returned By:
Component.getFont(), Font.decode(), Font.getFont(), FontMetrics.getFont(), Graphics.getFont(), MenuComponent.getFont(), MenuContainer.getFont()
Type Of:
FontMetrics.font