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
FieldsModifier and TypeFieldDescriptionstatic final GFontThe default font: 10p serif.final StringThe font family CSS value.final StringThe CSS font size (including units), e.g.final StringThe CSS font style: "normal", "italic" or "oblique".final StringThe font variant, default "normal".final StringThe font weight as CSS value, e.g.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionbooleanChecks if two font objects are equal.booleanChecks 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.