public class FontSize extends Object
Represents a font size as a special unit or a length value, which specifies the size of the font (historically the width of the capital "M").
| Modifier and Type | Field and Description |
|---|---|
static FontSize |
Large
The normally large absolute-size
|
static FontSize |
Larger
Larger relative-size - font will be larger relative to the parent element's font-size, roughly by the ratio used to separate the absolute-size keywords above.
|
static FontSize |
Medium
Medium size.
|
static FontSize |
Small
The normally small absolute-size
|
static FontSize |
Smaller
Smaller relative-size - font will be smaller relative to the parent element's font-size, roughly by the ratio used to separate the absolute-size keywords above.
|
static FontSize |
XLarge
The mediocre large absolute-size
|
static FontSize |
XSmall
The mediocre small absolute-size
|
static FontSize |
XxLarge
The very large absolute-size
|
static FontSize |
XxSmall
The very small absolute-size
|
| Constructor and Description |
|---|
FontSize() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(FontSize other)
Determines whether this font-size instance is equal to specified
|
boolean |
equals(Object obj)
Determines whether this font-size instance is equal to specified uncasted
|
static FontSize |
fromLength(Length length)
Creates a font-size from specified length
|
Length |
getLength()
A length value, if this font-size was defined with it, or throwed exception otherwise
|
String |
getValue()
Returns a value of this font size as a string
|
int |
hashCode()
Returns a hash-code for this instance
|
boolean |
isAbsoluteSize()
Indicates whether this font-size is defined with an absolute size as a keyword, based on the user's default font size (which is medium)
|
boolean |
isInitial()
Indicates whether this font-size has an initial value (Medium)
|
boolean |
isLengthDefined()
Indicates whether this font-size is defined with a
Length value |
boolean |
isRelativeSize()
Indicates whether this font-size is defined with an relative size as a keyword.
|
static boolean |
op_Equality(FontSize first,
FontSize second)
Checks whether two "FontSize" values are equal
|
static boolean |
op_Inequality(FontSize first,
FontSize second)
Checks whether two "FontSize" values are not equal
|
static boolean |
tryParse(String keyword,
FontSize[] result)
Tries to recognize a specified keyword as a proper keyword value of the 'font-size' and return it on success or NULL on failure.
|
public static final FontSize Large
The normally large absolute-size
public static final FontSize Larger
Larger relative-size - font will be larger relative to the parent element's font-size, roughly by the ratio used to separate the absolute-size keywords above.
public static final FontSize Medium
Medium size. Initial value.
public static final FontSize Small
The normally small absolute-size
public static final FontSize Smaller
Smaller relative-size - font will be smaller relative to the parent element's font-size, roughly by the ratio used to separate the absolute-size keywords above.
public static final FontSize XLarge
The mediocre large absolute-size
public static final FontSize XSmall
The mediocre small absolute-size
public static final FontSize XxLarge
The very large absolute-size
public static final FontSize XxSmall
The very small absolute-size
public final boolean equals(FontSize other)
Determines whether this font-size instance is equal to specified
other - Other font-size instancepublic boolean equals(Object obj)
Determines whether this font-size instance is equal to specified uncasted
public static FontSize fromLength(Length length)
Creates a font-size from specified length
length - A length value, cannot be unitless or negativeIllegalArgumentException - Font size value is unit-less or negativepublic final Length getLength()
A length value, if this font-size was defined with it, or throwed exception otherwise
public final String getValue()
Returns a value of this font size as a string
public int hashCode()
Returns a hash-code for this instance
public final boolean isAbsoluteSize()
Indicates whether this font-size is defined with an absolute size as a keyword, based on the user's default font size (which is medium)
public final boolean isInitial()
Indicates whether this font-size has an initial value (Medium)
public final boolean isLengthDefined()
Indicates whether this font-size is defined with a Length value
public final boolean isRelativeSize()
Indicates whether this font-size is defined with an relative size as a keyword. The font will be larger or smaller relative to the parent element's font size, roughly by the ratio used to separate the absolute-size keywords.
public static boolean op_Equality(FontSize first, FontSize second)
Checks whether two "FontSize" values are equal
first - First value to checksecond - Second value to checkpublic static boolean op_Inequality(FontSize first, FontSize second)
Checks whether two "FontSize" values are not equal
first - First value to checksecond - Second value to checkpublic static boolean tryParse(String keyword, FontSize[] result)
Tries to recognize a specified keyword as a proper keyword value of the 'font-size' and return it on success or NULL on failure.
keyword - A keyword to parseresult - Result, of parsing was successful, or Medium otherwiseCopyright © 2024. All rights reserved.