Package com.nsdev.lettergenerator.font
Enum Class FontVariant
- All Implemented Interfaces:
Serializable,Comparable<FontVariant>,Constable
Physical font face selected from resolved bold and italic style flags. Custom families register
their actual faces through
LetterPdfGenerator.Builder.registerFont(String, FontVariant, java.nio.file.Path). A regular face is required for each custom family, and a requested
bold/italic variant must also be registered; the generator does not synthesize missing custom
faces.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBold, upright face.Face combining bold weight and italic posture.Italic, normal-weight face.Upright, normal-weight face; required for every custom font family. -
Method Summary
Modifier and TypeMethodDescriptionstatic FontVariantfromStyle(boolean bold, boolean italic) Maps resolved style flags to the exact physical face required for rendering.booleanisBold()Reports whether this physical face supplies bold weight.booleanisItalic()Reports whether this physical face supplies italic posture.static FontVariantReturns the enum constant of this class with the specified name.static FontVariant[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
REGULAR
Upright, normal-weight face; required for every custom font family. -
BOLD
Bold, upright face. -
ITALIC
Italic, normal-weight face. -
BOLD_ITALIC
Face combining bold weight and italic posture.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isBold
public boolean isBold()Reports whether this physical face supplies bold weight.- Returns:
- true for
BOLDandBOLD_ITALIC
-
isItalic
public boolean isItalic()Reports whether this physical face supplies italic posture.- Returns:
- true for
ITALICandBOLD_ITALIC
-
fromStyle
Maps resolved style flags to the exact physical face required for rendering.- Parameters:
bold- whether the resolved text style requests bold weightitalic- whether the resolved text style requests italic posture- Returns:
- the matching variant, or
REGULARwhen both flags are false
-