FontStyles
Leave feedback
On this page
Inheritance: java.lang.Object
public final class FontStyles
Represents 4 possible styles of the font, used in the document: Regular, Bold, Italic, or Bold Italic.
| Constructor | Description |
|---|---|
| FontStyles(boolean isBold, boolean isItalic) | Creates a FontStyles instance from bold/italic flags. |
| Field | Description |
|---|---|
| Regular | |
| Bold | |
| Italic | |
| BoldItalic | |
| REGULAR | |
| BOLD | |
| ITALIC | |
| BOLD_ITALIC |
| Method | Description |
|---|---|
| toString(int style) | Converts a style value to a human-readable string. |
| getName() | Returns readable name of this font style. |
| isBold() | Returns true if bold bit is set. |
| isItalic() | Returns true if italic bit is set. |
| toString() | |
| equals(Object obj) | |
| hashCode() | |
| combine(FontStyles first, FontStyles second) | Union (C# operator +) |
| subtract(FontStyles minuend, FontStyles subtrahend) | Difference (C# operator -) |
| tryParse(String style, FontStyles[] parsed) | Parses a font style name to FontStyles. |
public FontStyles(boolean isBold, boolean isItalic)
Creates a FontStyles instance from bold/italic flags.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| isBold | boolean | |
| isItalic | boolean |
public static final int Regular
public static final int Bold
public static final int Italic
public static final int BoldItalic
public static final FontStyles REGULAR
public static final FontStyles BOLD
public static final FontStyles ITALIC
public static final FontStyles BOLD_ITALIC
public static String toString(int style)
Converts a style value to a human-readable string.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| style | int | the font style value |
Returns: java.lang.String - a string representation of the font style
public String getName()
Returns readable name of this font style.
Returns: java.lang.String
public boolean isBold()
Returns true if bold bit is set.
Returns: boolean
public boolean isItalic()
Returns true if italic bit is set.
Returns: boolean
public String toString()
Returns: java.lang.String
public boolean equals(Object obj)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| obj | java.lang.Object |
Returns: boolean
public int hashCode()
Returns: int
public static FontStyles combine(FontStyles first, FontStyles second)
Union (C# operator +)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| first | com.groupdocs.viewer.fonts.FontStyles | |
| second | com.groupdocs.viewer.fonts.FontStyles |
Returns: com.groupdocs.viewer.fonts.FontStyles
public static FontStyles subtract(FontStyles minuend, FontStyles subtrahend)
Difference (C# operator -)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| minuend | com.groupdocs.viewer.fonts.FontStyles | |
| subtrahend | com.groupdocs.viewer.fonts.FontStyles |
Returns: com.groupdocs.viewer.fonts.FontStyles
public static boolean tryParse(String style, FontStyles[] parsed)
Parses a font style name to FontStyles.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| style | java.lang.String | |
| parsed | com.groupdocs.viewer.fonts.FontStyles[] |
Returns: boolean - true on success, false otherwise.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.