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 instance with the specified font family name, size, and style.
init Initializes a new Font instance with a custom font family name, a folder containing TrueType fonts, a size, and a style.
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 a horizontal line through the text.
style The style information for this Font.
underline The font is underlined.

Example

from groupdocs.watermark import Watermarker
from groupdocs.watermark.watermarks import TextWatermark, Font, Color

with Watermarker("document.pdf") as watermarker:
    watermark = TextWatermark("CONFIDENTIAL", Font("Arial", 48))
    watermark.foreground_color = Color.red
    watermarker.add(watermark)
    watermarker.save("watermarked.pdf")

Guides

Task guides that use Font:

See Also