@PublicAPI public class MFont extends java.lang.Object implements java.io.Serializable, java.lang.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(java.awt.Font f)
Create a wrapper for the specified AWT font.
|
MFont(MFont f)
Copy constructor.
|
MFont(java.lang.String str)
Parses a font from a string.
|
MFont(java.lang.String family,
int style,
double size)
Contructs a font.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a clone.
|
MFont |
cloneMFont()
Creates a clone.
|
boolean |
equals(java.lang.Object o)
Tests whether two font objects equal.
|
java.awt.Font |
getAWTFont()
Gets an AWT font instance.
|
java.lang.String |
getFamily()
Gets the font family name.
|
java.awt.Font |
getScaledAWTFont(java.lang.Float scale)
Gets an AWT font instance after scaling.
|
double |
getSizeDouble()
Gets the font size.
|
java.lang.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 java.lang.String |
sizeToString(double size)
Converts an integer or fractional size to a string.
|
java.lang.String |
toString() |
public static final int PLAIN
public static final int BOLD
public static final int ITALIC
public MFont(java.lang.String family, int style, double size)
family
- the familystyle
- the stylesize
- the sizepublic MFont(java.lang.String str) throws java.lang.IllegalArgumentException
str
- the string to be convertedjava.lang.IllegalArgumentException
public MFont(MFont f)
f
- the font to copypublic MFont(java.awt.Font f)
f
- the AWT fontpublic java.lang.String getFamily()
public int getStyle()
public double getSizeDouble()
public boolean isBold()
public boolean isItalic()
public java.awt.Font getAWTFont()
public java.awt.Font getScaledAWTFont(java.lang.Float scale)
scale
- the scaling factorpublic java.lang.String getString()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public MFont cloneMFont()
public java.lang.Object clone()
clone
in class java.lang.Object
public static java.lang.String sizeToString(double size)
public java.lang.String toString()
toString
in class java.lang.Object