Package com.teamten.font
Class TypefaceVariantSize
java.lang.Object
com.teamten.font.TypefaceVariant
com.teamten.font.TypefaceVariantSize
Represents a typeface, a variant (e.g., bold), and a size (e.g., 11pt).
-
Constructor Summary
ConstructorsConstructorDescriptionTypefaceVariantSize
(Typeface typeface, FontVariant fontVariant, double size) -
Method Summary
Modifier and TypeMethodDescriptionboolean
double
getSize()
Get the font size in points.int
hashCode()
toString()
static TypefaceVariantSize
Parses a string as a typeface, variant, and size.withVariant
(FontVariant fontVariant) Return a new instance with the specified variant.Methods inherited from class com.teamten.font.TypefaceVariant
getFontName, getFontVariant, getTypeface, withTypeface
-
Constructor Details
-
TypefaceVariantSize
-
-
Method Details
-
getSize
public double getSize()Get the font size in points. -
withVariant
Return a new instance with the specified variant. -
toString
- Overrides:
toString
in classTypefaceVariant
-
equals
- Overrides:
equals
in classTypefaceVariant
-
hashCode
public int hashCode()- Overrides:
hashCode
in classTypefaceVariant
-
valueOf
Parses a string as a typeface, variant, and size. The format must be "typeface, variant, size", where "typeface" can be parsed byTypeface.parse(String)
, "variant" can be parsed byFontVariant.parse(String)
, and the size can be parsed bySpaceUnit.parseDistance(String)
.- Throws:
IllegalArgumentException
- if the string cannot be parsed.
-