Home/ Reference/ Layer & Shapes

layer.CreateArtisticText(left, top, text, lang, charset, font, size, bold, italic, underline, align)

Creates artistic text (a single-line heading). size is in points, not doc.Unit. align: 1 left / 2 right / 3 center / 4 full justify. In the code: (x, y, title, 0, -1

Signature

layer.CreateArtisticText(left, top, text, lang, charset, font, size, bold, italic, underline, align)

Notes

Creates artistic text (a single-line heading). size is in points, not doc.Unit. align: 1 left / 2 right / 3 center / 4 full justify. In the code: (x, y, title, 0, -1, "Source Han Sans SC Bold", 172, 0, 0, 0, 3).

Python example (runnable)

Requires pywin32. The example assumes app / doc / page / layer are already connected. See Connection & Init
Python
layer = doc.ActivePage.ActiveLayer

# CreateArtisticText(Left, Top, text, langID, charset, font, size_pt, bold, italic, underline, align)
# langID 0, charset -1 (automatic); align 3 = centre
title = layer.CreateArtisticText(
    20/25.4, 280/25.4,          # position (Left, Top)
    "Risk summary",                # the text itself
    0, -1,                       # langID and charset: keep 0 and -1
    "Source Han Sans Bold",             # font name (a missing font fails silently, so read back and verify)
    72,                          # size in POINTS, never in document units
    0, 0, 0,                     # bold, italic, underline: 0=no 1=yes
    3                            # alignment: 1 left 2 right 3 centre 4 justified
)

title.Fill.UniformColor.RGBAssign(255, 255, 255)   # fill the text white
print("Headline created")

About this section: Layer & Shapes

Layer & Shapes — layers and shape creation.

Other entries in this section