Skip to content

Text document

TextDocument

Stores a value for a TextLayer's Source Text property.

Example
from py_aep import parse

app = parse("project.aep")
comp = app.project.compositions[0]
text_doc = comp.text_layers[0].text.source_text.value
print(text_doc.text)

See: https://ae-scripting.docsforadobe.dev/text/textdocument/

Attributes

all_caps

all_caps: bool | None

True if a Text layer has All Caps enabled. Read-only.

apply_fill

apply_fill = bool('_char_style', '56', default=None)

When True, the Text layer shows a fill. Read / Write.

apply_stroke

apply_stroke = bool('_char_style', '57', default=False)

When True, the Text layer shows a stroke. Read / Write.

auto_hyphenate

auto_hyphenate = bool('_para_style', '9', default=None)

The Text layer's auto hyphenate option. Read / Write.

auto_kern_type

auto_kern_type = enum(
    AutoKernType, "_char_style", "11", default=NO_AUTO_KERN
)

The Text layer's auto kern type option. Read / Write.

auto_leading

auto_leading = bool('_char_style', '4', default=True)

The Text layer's auto leading option. Read / Write.

baseline_direction

baseline_direction = enum(
    BaselineDirection,
    "_char_style",
    "35",
    default=BASELINE_WITH_STREAM,
)

The Text layer's baseline direction. Read / Write.

baseline_shift

baseline_shift = float('_char_style', '9', default=None)

This Text layer's baseline shift in pixels. Read / Write.

box_auto_fit_policy

box_auto_fit_policy: BoxAutoFitPolicy

The box's auto-fit policy. Read / Write.

box_first_baseline_alignment

box_first_baseline_alignment: BoxFirstBaselineAlignment

The box's first-baseline alignment. Read / Write.

box_first_baseline_alignment_minimum

box_first_baseline_alignment_minimum: float

The minimum for MINIMUM_VALUE_* first-baseline alignment. R/W.

box_inset_spacing

box_inset_spacing: float

The box's inset (padding) spacing in pixels. Read / Write.

box_text

box_text: bool

True if this is a box (paragraph) text layer. Read-only.

Box text stores the bounding-box vertex array in the frame; point text omits it.

box_text_pos

box_text_pos: list[float] | None

The top-left position of the text box as [x, y]. Read / Write.

None for point text. Setting moves the box while keeping its size; requires box (paragraph) text.

box_text_size

box_text_size: list[float] | None

The size of the text box as [width, height]. Read / Write.

None for point text. Setting dimensions on point text converts it into a box (paragraph) text layer; on box text it resizes the box while keeping its top-left corner fixed.

box_vertical_alignment

box_vertical_alignment: BoxVerticalAlignment

The box's vertical text alignment. Read / Write.

composed_line_count

composed_line_count: int | None

The number of composed lines in the Text layer. Read-only.

composer_engine

composer_engine: ComposerEngine | None

The Text layer's composer engine type. Read-only.

digit_set

digit_set = enum(
    DigitSet, "_char_style", "70", default=DEFAULT_DIGITS
)

The Text layer's digit set option. Read / Write.

direction

direction = enum(
    ParagraphDirection,
    "_para_style",
    "33",
    default=DIRECTION_LEFT_TO_RIGHT,
)

The Text layer's paragraph direction. Read / Write.

end_indent

end_indent = float('_para_style', '3', default=0.0)

The Text layer's paragraph end indent. Read / Write.

every_line_composer

every_line_composer = bool(
    "_para_style", "29", default=False
)

The Text layer's Every-Line Composer option. Read / Write.

True when Every-Line Composer is used, False for Single-Line.

faux_bold

faux_bold = bool('_char_style', '2', default=None)

True if a Text layer has faux bold enabled. Read / Write.

faux_italic

faux_italic = bool('_char_style', '3', default=None)

True if a Text layer has faux italic enabled. Read / Write.

fill_color

fill_color: list[float] | None

The Text layer's fill color as [r, g, b]. Read / Write.

first_line_indent

first_line_indent = float('_para_style', '1', default=0.0)

The Text layer's paragraph first line indent. Read / Write.

font

font: str | None

The Text layer's font PostScript name. Read / Write.

font_baseline_option

font_baseline_option = enum(
    FontBaselineOption, "_char_style", "13", default=None
)

The Text layer's font baseline option. Read / Write.

font_caps_option

font_caps_option = enum(
    FontCapsOption, "_char_style", "12", default=None
)

The Text layer's font caps option. Read / Write.

font_object

font_object: FontObject | None

The Text layer's FontObject. Read-only.

font_size

font_size = float('_char_style', '1', default=None)

The Text layer's font size in pixels. Read / Write.

hanging_roman

hanging_roman = bool('_para_style', '21', default=False)

The Text layer's Roman Hanging Punctuation. Read / Write.

horizontal_scale

horizontal_scale = float('_char_style', '6', default=None)

This Text layer's horizontal scale in pixels. Read / Write.

justification

justification = enum(
    ParagraphJustification, "_para_style", "0", default=None
)

The paragraph justification for the Text layer. Read / Write.

kerning

kerning: int

The Text layer's kerning value. Read-only.

AE stores a uniform manual-kerning value at the document level; per-pair kerning is not exposed. Returns 0 when unset (the default for metric / optical auto-kerning).

leading

leading: float | None

The Text layer's spacing between lines. Read / Write.

When auto-leading is enabled, returns font_size * auto_leading_factor.

leading_type

leading_type = enum(
    LeadingType,
    "_para_style",
    "8",
    default=ROMAN_LEADING_TYPE,
)

The Text layer's paragraph leading type. Read / Write.

ligature

ligature = bool('_char_style', '18', default=False)

When True, ligature is used. Read / Write.

line_join_type

line_join_type = enum(
    LineJoinType,
    "_char_style",
    "62",
    default=LINE_JOIN_MITER,
)

The Text layer's line join type for strokes. Read / Write.

line_orientation

line_orientation: LineOrientation

The Text layer's line orientation. Read / Write.

no_break

no_break = bool('_char_style', '52', default=False)

When True, the no-break attribute is applied. Read / Write.

paragraph_count

paragraph_count: int | None

The number of paragraphs in the text layer. Read-only.

point_text

point_text: bool

True if this is a point text layer. Read-only.

small_caps

small_caps: bool | None

True if a Text layer has Small Caps enabled. Read-only.

space_after

space_after = float('_para_style', '5', default=0.0)

The Text layer's paragraph space after. Read / Write.

space_before

space_before = float('_para_style', '4', default=0.0)

The Text layer's paragraph space before. Read / Write.

start_indent

start_indent = float('_para_style', '2', default=0.0)

The Text layer's paragraph start indent. Read / Write.

stroke_color

stroke_color: list[float] | None

The Text layer's stroke color as [r, g, b]. Read / Write.

stroke_over_fill

stroke_over_fill = bool('_char_style', '58', default=True)

When True, the stroke appears over the fill. Read / Write.

stroke_width

stroke_width = float('_char_style', '63', default=1.0)

The Text layer's stroke thickness in pixels. Read / Write.

subscript

subscript: bool | None

True if a Text layer has subscript enabled. Read-only.

superscript

superscript: bool | None

True if a Text layer has superscript enabled. Read-only.

text

text: str

The text value for the Source Text property. Read / Write.

tracking

tracking = float('_char_style', '8', default=None)

The Text layer's spacing between characters. Read / Write.

tsume

tsume = float('_char_style', '36', default=0.0)

This Text layer's tsume value (0.0 to 1.0). Read / Write.

vertical_scale

vertical_scale = float('_char_style', '7', default=None)

This Text layer's vertical scale in pixels. Read / Write.