Font class

Font class

Represents a font.

The Font type exposes the following members:

Constructors

Constructor Description
init Initializes a new Font instance with the specified font family name and size.
init Initializes a new Font with the specified font family name, size, and style.
init Initializes a new Font instance with a custom font family name, the folder containing the TrueType font files, and a size.
init Initializes a new Font instance with a custom font family name, the folder containing the TrueType font files, and a size.

Properties

Property Description
bold The font is bold.
family_name The family name of this Font.
folder_path The folder that contains TrueType font files.
italic The font is italic.
size The size of this Font.
strikeout The font specifies whether it has a horizontal line through the characters.
style The style of this Font.
underline The font is underlined. Returns True if the font is underlined; otherwise, False.

Example

from groupdocs.watermark.watermarks import Font

fonts_folder = r"C:\CustomFonts"
# Create a font using a custom TrueType font located in fonts_folder
font = Font("CustomFontName", fonts_folder, 36.0)

Guides

Task guides that use Font:

See Also