public class MFont extends Object implements Serializable, Cloneable
Modifier and Type | Field and Description |
---|---|
static int |
BOLD
Bold font style.
|
static int |
ITALIC
Italic font style.
|
static int |
PLAIN
Plain font style.
|
Constructor and Description |
---|
MFont(Font f)
Create a wrapper for the specified AWT font.
|
MFont(MFont f)
Copy constructor.
|
MFont(String str)
Parses a font from a string.
|
MFont(String family,
int style,
double size)
Contructs a font.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a clone.
|
MFont |
cloneMFont()
Creates a clone.
|
boolean |
equals(Object o)
Tests whether two font objects equal.
|
Font |
getAWTFont()
Gets an AWT font instance.
|
String |
getFamily()
Gets the font family name.
|
Font |
getScaledAWTFont(Float scale)
Gets an AWT font instance after scaling.
|
double |
getSizeDouble()
Gets the font size.
|
String |
getString()
Gets the string representation.
|
int |
getStyle()
Gets the font style.
|
int |
hashCode() |
boolean |
isBold()
Tests whether the font is bold.
|
boolean |
isItalic()
Tests whether the font is italic.
|
static String |
sizeToString(double size)
Converts an integer or fractional size to a string.
|
String |
toString() |
public static final int PLAIN
public static final int BOLD
public static final int ITALIC
public MFont(String family, int style, double size)
family
- the familystyle
- the stylesize
- the sizepublic MFont(String str) throws IllegalArgumentException
str
- the string to be convertedIllegalArgumentException
public MFont(MFont f)
f
- the font to copypublic MFont(Font f)
f
- the AWT fontpublic String getFamily()
public int getStyle()
public double getSizeDouble()
public boolean isBold()
public boolean isItalic()
public Font getAWTFont()
public Font getScaledAWTFont(Float scale)
scale
- the scaling factorpublic String getString()
public boolean equals(Object o)
public MFont cloneMFont()
public static String sizeToString(double size)