public static enum Font.Weight extends java.lang.Enum<Font.Weight>
Enum Constant and Description |
---|
ANY
Font-weight constant indicating no preference.
|
BLACK
Font-weight constant indicating a weight of 900 (black).
|
BOLD
Font-weight constant indicating a weight of 700 (bold).
|
DARK
Font-weight constant indicating a weight of 500 (dark).
|
EXTRA_BOLD
Font-weight constant indicating a weight of 800 (extra bold).
|
EXTREMELY_LIGHT
Font-weight constant indicating a weight of 100 (extremely
light).
|
LIGHT
Font-weight constant indicating a weight of 300 (light).
|
NORMAL
Font-weight constant indicating a weight of 400 (normal).
|
SEMI_BOLD
Font-weight constant indicating a weight of 600 (semi-bold).
|
VERY_LIGHT
Font-weight constant indicating a weight of 200 (very light).
|
Modifier and Type | Method and Description |
---|---|
static Font.Weight |
fromNumeric(int numericWeight)
Returns the Weight constant corresponding to a given numeric weight.
|
java.lang.String |
getCssValue()
Returns the String describing this weight in CSS.
|
java.lang.String |
getFoValue()
Returns the String describing this weight in XSL-FO.
|
short |
getNumericWeight()
Return this weight's numeric weight.
|
static boolean |
isValidNumericWeight(int numericWeight)
Indicates whether a given numeric weight has a corresponding
Weight instance.
|
Font.Weight |
nextHeaviest()
Returns the next heaviest weight.
|
Font.Weight |
nextLightest()
Returns the next lightest weight.
|
static Font.Weight |
parseCss(java.lang.String input,
boolean lowerCaseOnly)
Parses a CSS2 String into an instance of
Font.Weight . |
static Font.Weight |
parseFo(java.lang.String input,
boolean lowerCaseOnly)
Parses an XSL-FO String into an instance of
Font.Weight . |
static Font.Weight |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Font.Weight[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Font.Weight ANY
public static final Font.Weight EXTREMELY_LIGHT
public static final Font.Weight VERY_LIGHT
public static final Font.Weight LIGHT
public static final Font.Weight NORMAL
public static final Font.Weight DARK
public static final Font.Weight SEMI_BOLD
public static final Font.Weight BOLD
public static final Font.Weight EXTRA_BOLD
public static final Font.Weight BLACK
public static Font.Weight[] values()
for (Font.Weight c : Font.Weight.values()) System.out.println(c);
public static Font.Weight valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic short getNumericWeight()
Short.MIN_VALUE
.public java.lang.String getCssValue()
public java.lang.String getFoValue()
public Font.Weight nextHeaviest()
public Font.Weight nextLightest()
public static Font.Weight fromNumeric(int numericWeight)
numericWeight
- The numeric weight for which a constant is
needed. This should be 100, 200, 300, 400, 500, 600, 700, 800, or
900.numericWeight.
public static boolean isValidNumericWeight(int numericWeight)
numericWeight
- The numeric weight being tested.numericWeight
public static Font.Weight parseCss(java.lang.String input, boolean lowerCaseOnly)
Font.Weight
.input
- The CSS2-style String to be converted.lowerCaseOnly
- Set to true to insist that all input values be
lowercase.
There is some ambiguity about whether CSS is case-sensitive or not. If
it is, all input should be lower case.Font.Weight
, or null if the input is not valid.public static Font.Weight parseFo(java.lang.String input, boolean lowerCaseOnly)
Font.Weight
.input
- The XSL-FO-style String to be converted.lowerCaseOnly
- Set to true to insist that all input values be
lowercase.
There is some ambiguity about whether XSL-FO is case-sensitive or not. If
it is, all input should be lower case.Font.Weight
, or null if the input is not valid.This documentation was created 2017-01-24 at 21:26 GMT by The aXSL Group and may be freely copied. See license for details.