public class Font extends Object implements Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
Font.FontStyle
Style of font.
|
| Constructor and Description |
|---|
Font(String family,
Font.FontStyle style,
int size)
Creates a new instance of the Font with the specified
family,
style, and size. |
Font(String family,
String style,
int size)
Creates a new instance of the Font with the specified
family,
style, and size. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static Font |
font(String family,
Font.FontStyle style,
int size)
Gets an instance of the Font with the specified
family,
style, and size. |
static Font |
font(String family,
String style,
int size)
Gets an instance of the Font with the specified
family,
style, and size. |
static String[] |
fontFamilyNames()
Gets the names of available Font families.
|
static Font.FontStyle |
fontStyle(String style)
Gets an instance of the FontStyle represented by
style |
static String[] |
fontStyleNames()
Gets the names of available FontStyles.
|
int |
hashCode() |
Font |
javaFont()
Gets the Java object representative of this Font.
|
Font |
refamily(String family)
Gets an instance of this Font with the family changed to the specified
family |
Font |
resize(int size)
Gets an instance of this Font with the size changed to the specified
size |
Font |
restyle(Font.FontStyle style)
Gets an instance of this Font with the style changed to the specified
style |
Font |
restyle(String style)
Gets an instance of this Font with the style changed to the specified
style |
String |
toString() |
public Font(String family, Font.FontStyle style, int size)
family,
style, and size.family - font family; if null, set to Arialstyle - font style; if null, set to Font.FontStyle PLAINsize - the point size of the Fontpublic Font(String family, String style, int size)
family,
style, and size.family - font family; if null, set to Arialstyle - font style; if null, set to Font.FontStyle PLAINsize - the point size of the Fontpublic static Font.FontStyle fontStyle(String style)
stylestyle - case insensitive font style descriptorstyleIllegalArgumentException - style must not be nullpublic static String[] fontStyleNames()
public static Font font(String family, Font.FontStyle style, int size)
family,
style, and size.family - font family; if null, set to Arialstyle - font style; if null, set to Font.FontStyle PLAINsize - the point size of the Fontpublic static Font font(String family, String style, int size)
family,
style, and size.family - font family; if null, set to Arialstyle - font style; if null, set to Font.FontStyle PLAINsize - the point size of the Fontpublic static String[] fontFamilyNames()
public Font refamily(String family)
familyfamily - font family; if null, set to Arialfamily and this Font's style and sizepublic Font restyle(Font.FontStyle style)
stylestyle - font style; if null, set to Font.FontStyle PLAINstyle and this Font's family and sizepublic Font restyle(String style)
stylestyle - font style; if null, set to Font.FontStyle PLAINstyle and this Font's family and sizepublic Font resize(int size)
sizesize - point size of the fontsize and this Font's family and stylepublic Font javaFont()