Package com.iizix.prop
Class GFont
java.lang.Object
com.iizix.prop.GFont
- All Implemented Interfaces:
Cloneable
A font specifies the properties for a Font used in text operations.
- Author:
- Christopher Mindus
Field Summary
Modifier and TypeFieldDescriptionstatic final GFont
The default font: 10p serif.final String
The font family CSS value.final String
The CSS font size (including units), e.g.final String
The CSS font style: "normal", "italic" or "oblique".final String
The font variant, default "normal".final String
The font weight as CSS value, e.g.Constructor Summary
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if two font objects are equal.boolean
Checks if two font objects are equal.Gets the font as a String in the form described below.toString()
Returns a string representation of this class instance and its values.
Field Details
DEFAULT
The default font: 10p serif.family
The font family CSS value.size
The CSS font size (including units), e.g. "10pt".weight
The font weight as CSS value, e.g. "bold", default "normal".style
The CSS font style: "normal", "italic" or "oblique".variant
The font variant, default "normal".
Constructor Details
GFont
Creates an new normal font.- Parameters:
family
- The font family CSS value.size
- The CSS font size (including units), e.g. "10pt".- Throws:
NullPointerException
- If family or size is null.
GFont
Creates an new normal font.- Parameters:
family
- The font family CSS value.size
- The CSS font size (including units), e.g. "10pt".weight
- The font weight as CSS value, e.g. "bold", default "normal".style
- The CSS font style: "normal", "italic" or "oblique".variant
- The font variant, default "normal".- Throws:
NullPointerException
- If family, size, weight, style or variant is null.
Method Details
equals
Checks if two font objects are equal.equals
Checks if two font objects are equal.- Parameters:
font
- another font object. If null, the fonts are not equal.- Returns:
- true if equal, false otherwise.
getString
Gets the font as a String in the form described below.- Returns:
- the String as described above.
toString
Returns a string representation of this class instance and its values.