Font

Inheritance: java.lang.Object

public final class Font

Class representing a font.

Constructors

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.

Methods

Method Description
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.

Font(String fontFamilyName, float size)

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.

Font(String fontFamilyName, float size, int style)

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.

getFamilyName()

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).

getSize()

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).

getStyle()

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).

getBold()

public final boolean getBold()

Gets a value indicating whether the font is bold.

Returns: boolean - True if this font is bold; otherwise, false.

getItalic()

public final boolean getItalic()

Gets a value indicating whether the font is italic.

Returns: boolean - True if this font is italic; otherwise, false.

getStrikeout()

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.

getUnderline()

public final boolean getUnderline()

Gets a value indicating whether the font is underlined.

Returns: boolean - True if this font is underlined; otherwise, false.