Package com.iizix.prop
Class GFont
- java.lang.Object
- com.iizix.prop.GFont
- All Implemented Interfaces:
java.lang.Cloneable
public class GFont extends java.lang.Object implements java.lang.CloneableA font specifies the properties for a Font used in text operations.- Author:
- Christopher Mindus
Field Summary
Fields Modifier and Type Field Description static GFontDEFAULTThe default font: 10p serif.java.lang.StringfamilyThe font family CSS value.java.lang.StringsizeThe CSS font size (including units), e.g.java.lang.StringstyleThe CSS font style: "normal", "italic" or "oblique".java.lang.StringvariantThe font variant, default "normal".java.lang.StringweightThe font weight as CSS value, e.g.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(GFont font)Checks if two font objects are equal.booleanequals(java.lang.Object o)Checks if two font objects are equal.java.lang.StringgetString()Gets the font as a String in the form described below.java.lang.StringtoString()Returns a string representation of this class instance and its values.
Field Detail
DEFAULT
public static final GFont DEFAULT
The default font: 10p serif.
family
public final java.lang.String family
The font family CSS value.
size
public final java.lang.String size
The CSS font size (including units), e.g. "10pt".
weight
public final java.lang.String weight
The font weight as CSS value, e.g. "bold", default "normal".
style
public final java.lang.String style
The CSS font style: "normal", "italic" or "oblique".
variant
public final java.lang.String variant
The font variant, default "normal".
Constructor Detail
GFont
public GFont(java.lang.String family, java.lang.String size)Creates an new normal font.- Parameters:
family- The font family CSS value.size- The CSS font size (including units), e.g. "10pt".- Throws:
java.lang.NullPointerException- If family or size is null.
GFont
public GFont(java.lang.String family, java.lang.String size, java.lang.String weight, java.lang.String style, java.lang.String variant)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:
java.lang.NullPointerException- If family, size, weight, style or variant is null.
Method Detail
equals
public boolean equals(java.lang.Object o)
Checks if two font objects are equal.- Overrides:
equalsin classjava.lang.Object
equals
public boolean equals(GFont font)
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
public java.lang.String getString()
Gets the font as a String in the form described below.- Returns:
- the String as described above.
toString
public java.lang.String toString()
Returns a string representation of this class instance and its values.- Overrides:
toStringin classjava.lang.Object- Returns:
- a string representation of this class instance.