Font
Leave feedback
On this page
Inheritance: java.lang.Object
public final class Font
Class representing a font.
| Constructor | Description |
|---|---|
| Font(String fontFamilyName, float size) | Initializes a new instance of the [Font](../../com.groupdocs.watermark.watermarks/font) class with a specified font family name and a size. |
| Font(String fontFamilyName, float size, int style) | Initializes a new instance of the [Font](../../com.groupdocs.watermark.watermarks/font) class with a specified font family name, a size and a style. |
| Font(String fontFamilyName, String folderPath, float size) | |
| Font(String fontFamilyName, String folderPath, float size, FontStyle style) |
| Method | Description |
|---|---|
| getFolderPath() | |
| setFolderPath(String folderPath) | |
| getFamilyName() | Gets the family name of this [Font](../../com.groupdocs.watermark.watermarks/font). |
| getSize() | Gets the size of this [Font](../../com.groupdocs.watermark.watermarks/font). |
| getStyle() | Gets the [FontStyle](../../com.groupdocs.watermark.watermarks/fontstyle) for this [Font](../../com.groupdocs.watermark.watermarks/font). |
| getBold() | Gets a value indicating whether the font is bold. |
| getItalic() | Gets a value indicating whether the font is italic. |
| getStrikeout() | Gets a value indicating whether the font specifies a horizontal line through the font. |
| getUnderline() | Gets a value indicating whether the font is underlined. |
public Font(String fontFamilyName, float size)
Initializes a new instance of the [Font](../../com.groupdocs.watermark.watermarks/font) class with a specified font family name and a size.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| fontFamilyName | java.lang.String | The font family name. |
| size | float | The size of the new font. |
public Font(String fontFamilyName, float size, int style)
Initializes a new instance of the [Font](../../com.groupdocs.watermark.watermarks/font) class with a specified font family name, a size and a style.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| fontFamilyName | java.lang.String | The font family name. |
| size | float | The size of the new font. |
| style | int | The [FontStyle](../../com.groupdocs.watermark.watermarks/fontstyle) of the new font. |
public Font(String fontFamilyName, String folderPath, float size)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| fontFamilyName | java.lang.String | |
| folderPath | java.lang.String | |
| size | float |
public Font(String fontFamilyName, String folderPath, float size, FontStyle style)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| fontFamilyName | java.lang.String | |
| folderPath | java.lang.String | |
| size | float | |
| style | FontStyle |
public String getFolderPath()
Returns: java.lang.String
public void setFolderPath(String folderPath)
Parameters:
| Parameter | Type | Description |
|---|---|---|
| folderPath | java.lang.String |
public final String getFamilyName()
Gets the family name of this [Font](../../com.groupdocs.watermark.watermarks/font).
Returns:
java.lang.String - The family name of this [Font](../../com.groupdocs.watermark.watermarks/font).
public final float getSize()
Gets the size of this [Font](../../com.groupdocs.watermark.watermarks/font).
Returns:
float - The size of this [Font](../../com.groupdocs.watermark.watermarks/font).
public final int getStyle()
Gets the [FontStyle](../../com.groupdocs.watermark.watermarks/fontstyle) for this [Font](../../com.groupdocs.watermark.watermarks/font).
Default value is [FontStyle.Regular](../../com.groupdocs.watermark.watermarks/fontstyle#Regular) (normal text).
Returns:
int - The [FontStyle](../../com.groupdocs.watermark.watermarks/fontstyle) of this [Font](../../com.groupdocs.watermark.watermarks/font).
public final boolean getBold()
Gets a value indicating whether the font is bold.
Returns: boolean - True if this font is bold; otherwise, false.
public final boolean getItalic()
Gets a value indicating whether the font is italic.
Returns: boolean - True if this font is italic; otherwise, false.
public final boolean getStrikeout()
Gets a value indicating whether the font specifies a horizontal line through the font.
Returns: boolean - True if this font specifies a horizontal line through the font; otherwise, false.
public final boolean getUnderline()
Gets a value indicating whether the font is underlined.
Returns: boolean - True if this font is underlined; otherwise, false.
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.