public class FontWeight extends Object
Font-weight property sets the weight (or boldness) of the font. The weights available depend on the font-family that is currently set.
| Modifier and Type | Field and Description |
|---|---|
static FontWeight |
Bold
Bold font weight.
|
static FontWeight |
Bolder
One relative font weight heavier than the parent element
|
static FontWeight |
Lighter
One relative font weight lighter than the parent element
|
static FontWeight |
Normal
Normal font weight.
|
| Constructor and Description |
|---|
FontWeight() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(FontWeight other)
Determines whether specified FontWeight instances are equal
|
boolean |
equals(Object obj)
Determines whether this FontWeight instance is equal to specified uncasted
|
static FontWeight |
fromNumber(int number)
Creates a font-weight from specified number
|
int |
getNumber()
Returns a number - integer value between 1 and 1000, inclusive, which describes the boldness of the font, or throws an exception, if current boldness is not absolute, but relative
|
String |
getValue()
Returns a value of this font-weight as a string
|
int |
hashCode()
Returns a hash-code for this instance
|
boolean |
isAbsolute()
Indicates whether this font-weight instance stores an absolute value of the weight (boldness) of the font, as an integer number
|
boolean |
isInitial()
Indicates whether this font-size has an initial value (Medium)
|
boolean |
isRelative()
Indicates whether this font-weight instance stores a relative value of the weight (boldness) of the font - compared to the boldness of the parent element
|
static boolean |
op_Equality(FontWeight first,
FontWeight second)
Checks whether two "FontWeight" values are equal
|
static boolean |
op_Inequality(FontWeight first,
FontWeight second)
Checks whether two "FontWeight" values are not equal
|
static boolean |
tryParse(String input,
FontWeight[] result)
Tries to parse a specified string and return a valid FontWeight instance on success
|
public static final FontWeight Bold
Bold font weight. Same as 700.
public static final FontWeight Bolder
One relative font weight heavier than the parent element
public static final FontWeight Lighter
One relative font weight lighter than the parent element
public static final FontWeight Normal
Normal font weight. Same as 400.
public final boolean equals(FontWeight other)
Determines whether specified FontWeight instances are equal
other - Other FontWeight instance to check the equalitypublic boolean equals(Object obj)
Determines whether this FontWeight instance is equal to specified uncasted
public static FontWeight fromNumber(int number)
Creates a font-weight from specified number
number - Unsigned integer, must be within [1..1000] rangeIllegalArgumentException - Specified number is out from [1..1000] rangepublic final int getNumber()
Returns a number - integer value between 1 and 1000, inclusive, which describes the boldness of the font, or throws an exception, if current boldness is not absolute, but relative
com.aspose.ms.System.InvalidOperationException - Thrown if current font-weight holds a relative value of the font boldnesspublic final String getValue()
Returns a value of this font-weight as a string
public int hashCode()
Returns a hash-code for this instance
public final boolean isAbsolute()
Indicates whether this font-weight instance stores an absolute value of the weight (boldness) of the font, as an integer number
public final boolean isInitial()
Indicates whether this font-size has an initial value (Medium)
public final boolean isRelative()
Indicates whether this font-weight instance stores a relative value of the weight (boldness) of the font - compared to the boldness of the parent element
public static boolean op_Equality(FontWeight first, FontWeight second)
Checks whether two "FontWeight" values are equal
first - First value to checksecond - Second value to checkpublic static boolean op_Inequality(FontWeight first, FontWeight second)
Checks whether two "FontWeight" values are not equal
first - First value to checksecond - Second value to checkpublic static boolean tryParse(String input, FontWeight[] result)
Tries to parse a specified string and return a valid FontWeight instance on success
input - Input string to parseresult - Valid FontWeight value on success or Normal on failureCopyright © 2024. All rights reserved.