A class providing static methods to create formatting attributes. Each attribute is encoded using two bits of an integer as follows:
VA | TD | FW | FV | FS
BIT 31 ... 9 8 | 7 6 | 5 4 | 3 2 | 1 0
FS = Font style
FV = Font variant
FW = Font weight
TD = Text decoration
VA = Vertical alignment
The values of each attribute are as follows:
FS: 00 - UNDEFINED
01 - NORMAL
10 - ITALIC
11 - OBLIQUE
FV: 00 - UNDEFINED
01 - NORMAL
10 - SMALL_CAPS
FW: 00 - UNDEFINED
01 - NORMAL
10 - BOLD
11 - LIGHT
TD: 00 - UNDEFINED
01 - NONE
10 - UNDERLINE
VA: 00 - UNDEFINED
01 - BASELINE
10 - SUP
11 - SUB
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| public static final int | FS_NORMAL
Font style values |
| public static final int | |
| private static final int | FS_SHIFT
The number of bits to shift for each formatting attribute |
| public static final int | FV_NORMAL
Font variant values |
| private static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | FW_NORMAL
Font weight values |
| private static final int | |
| public static final int | |
| public static final int | TD_NONE
Text decoration values |
| private static final int | |
| public static final int | |
| public static final int | |
| public static final int | VA_BASELINE
Vertical alignment values |
| private static final int | |
| public static final int | |
| public static final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static int | |
| public static int | Returns: the font variantthe integer attributes)Get the font variant from an integer |
| public static int | |
| public static int | Returns: the text decorationthe integer attributes)Get the text decoration from an integer |
| public static int | Returns: the vertical alignmentthe integer attributes)Get the vertical alignment from an integer |
| public static int | Returns: the merged formatting attributesthe set to merge into a, int the set to merge (overwrites attributes from b)a)Merge two sets of formatting attributes |
| public static int | |
| public static int | Returns: the formatting attributesCreate formatting attributes from the given font style |
| public static int | Returns: the formatting attributesthe font variant (one of fontVariant)FV_NORMAL,
FV_SMALLCAPS)Create formatting attributes from the given font variant |
| public static int | Returns: the formatting attributesCreate formatting attributes from the given font weight |
| public static int | Returns: the formatting attributesthe text decoration (one of textDecoration)TD_NONE,
TD_UNDERLINE)Create formatting attributes from the given text decoration |
| public static int | Returns: the formatting attributesCreate formatting attributes from the given vertical align |
| FS_ITALIC | back to summary |
|---|---|
| public static final int FS_ITALIC | |
| FS_NORMAL | back to summary |
|---|---|
| public static final int FS_NORMAL Font style values | |
| FS_OBLIQUE | back to summary |
|---|---|
| public static final int FS_OBLIQUE | |
| FS_SHIFT | back to summary |
|---|---|
| private static final int FS_SHIFT The number of bits to shift for each formatting attribute | |
| FV_NORMAL | back to summary |
|---|---|
| public static final int FV_NORMAL Font variant values | |
| FV_SHIFT | back to summary |
|---|---|
| private static final int FV_SHIFT | |
| FV_SMALLCAPS | back to summary |
|---|---|
| public static final int FV_SMALLCAPS | |
| FW_BOLD | back to summary |
|---|---|
| public static final int FW_BOLD | |
| FW_LIGHT | back to summary |
|---|---|
| public static final int FW_LIGHT | |
| FW_NORMAL | back to summary |
|---|---|
| public static final int FW_NORMAL Font weight values | |
| FW_SHIFT | back to summary |
|---|---|
| private static final int FW_SHIFT | |
| NORMAL | back to summary |
|---|---|
| public static final int NORMAL | |
| TD_NONE | back to summary |
|---|---|
| public static final int TD_NONE Text decoration values | |
| TD_SHIFT | back to summary |
|---|---|
| private static final int TD_SHIFT | |
| TD_UNDERLINE | back to summary |
|---|---|
| public static final int TD_UNDERLINE | |
| UNDEFINED | back to summary |
|---|---|
| public static final int UNDEFINED | |
| VA_BASELINE | back to summary |
|---|---|
| public static final int VA_BASELINE Vertical alignment values | |
| VA_SHIFT | back to summary |
|---|---|
| private static final int VA_SHIFT | |
| VA_SUB | back to summary |
|---|---|
| public static final int VA_SUB | |
| VA_SUP | back to summary |
|---|---|
| public static final int VA_SUP | |
| FormattingAttributes | back to summary |
|---|---|
| private FormattingAttributes() Hidden constructor. Use | |
| getFontStyle | back to summary |
|---|---|
| public static int getFontStyle(int attributes) Get the font style from an integer
| |
| getFontVariant | back to summary |
|---|---|
| public static int getFontVariant(int attributes) Get the font variant from an integer
| |
| getFontWeight | back to summary |
|---|---|
| public static int getFontWeight(int attributes) Get the font weight from an integer
| |
| getTextDecoration | back to summary |
|---|---|
| public static int getTextDecoration(int attributes) Get the text decoration from an integer
| |
| getVerticalAlign | back to summary |
|---|---|
| public static int getVerticalAlign(int attributes) Get the vertical alignment from an integer
| |
| merge | back to summary |
|---|---|
| public static int merge(int a, int b) Merge two sets of formatting attributes
| |
| of | back to summary |
|---|---|
| public static int of(Node node) Create formatting attributes from an XML node
| |
| ofFontStyle | back to summary |
|---|---|
| public static int ofFontStyle(int fontStyle) Create formatting attributes from the given font style
| |
| ofFontVariant | back to summary |
|---|---|
| public static int ofFontVariant(int fontVariant) Create formatting attributes from the given font variant
| |
| ofFontWeight | back to summary |
|---|---|
| public static int ofFontWeight(int fontWeight) Create formatting attributes from the given font weight | |
| ofTextDecoration | back to summary |
|---|---|
| public static int ofTextDecoration(int textDecoration) Create formatting attributes from the given text decoration
| |
| ofVerticalAlign | back to summary |
|---|---|
| public static int ofVerticalAlign(int verticalAlign) Create formatting attributes from the given vertical align
| |