TextDocument
Properties
true if a Text layer has All Caps enabled; otherwise false. To set this value, use fontCapsOption. Only reflects the first character in the Text layer.true, the Text layer shows a fill. Access fillColor for the actual color. When false, only a stroke is shown.true, the Text layer shows a stroke. Access strokeColor for the actual color and strokeWidth for its thickness. When false, only a fill is shown.AutoKernType.NO_AUTO_KERN, AutoKernType.METRIC_KERN, AutoKernType.OPTICAL_KERN. Only reflects the first character; setting it applies to all characters.BaselineDirection.BASELINE_WITH_STREAM, BaselineDirection.BASELINE_VERTICAL_ROTATED, BaselineDirection.BASELINE_VERTICAL_CROSS_STREAM. Only reflects the first character; setting it applies to all characters.[line.start_x, line.start_y, line.end_x, line.end_y, ...] values per composed line. If a line has no characters, its x/y values are the maximum float value.BoxAutoFitPolicy.NONE. Disabled if boxVerticalAlignment is anything other than BoxVerticalAlignment.TOP.boxFirstBaselineAlignmentMinimum is non-zero. Defaults to BoxFirstBaselineAlignment.ASCENT.boxFirstBaselineAlignment when non-zero. Defaults to zero.true if some part of the text did not compose into the box.true if a Text layer is a layer of paragraph (bounded) text; otherwise false.[width, height] array of pixel dimensions. Throws an exception if boxText is not true.[width, height] array of pixel dimensions (minimum value of 1). Throws an exception if boxText is not true.BoxVerticalAlignment.TOP.ComposerEngine.UNIVERSAL_TYPE_ENGINE for new layers; ComposerEngine.LATIN_CJK_ENGINE only appears in older projects and can't be set back to. Reflects and sets all paragraphs in the Text layer.DigitSet.DEFAULT_DIGITS, DigitSet.ARABIC_DIGITS, DigitSet.HINDI_DIGITS, DigitSet.FARSI_DIGITS, DigitSet.ARABIC_DIGITS_RTL. Only reflects the first character; setting it applies to all characters.ParagraphDirection.DIRECTION_LEFT_TO_RIGHT, ParagraphDirection.DIRECTION_RIGHT_TO_LEFT. Reflects and sets all paragraphs in the Text layer.false, uses the Single-Line Composer instead. Reflects and sets all paragraphs in the Text layer.true if a Text layer has faux bold enabled; otherwise false. Only reflects the first character in the Text layer.true if a Text layer has faux italic enabled; otherwise false. Only reflects the first character in the Text layer.[r, g, b] floating-point values (values above 1.0 possible in 32-bpc projects). Throws an exception on read if applyFill is not true. Setting this also sets applyFill to true. Only reflects the first character; setting it applies to all characters.FontBaselineOption.FONT_NORMAL_BASELINE, FontBaselineOption.FONT_FAUXED_SUPERSCRIPT, FontBaselineOption.FONT_FAUXED_SUBSCRIPT. Only reflects the first character; setting it applies to all characters.FontCapsOption.FONT_NORMAL_CAPS, FontCapsOption.FONT_SMALL_CAPS, FontCapsOption.FONT_ALL_CAPS, FontCapsOption.FONT_ALL_SMALL_CAPS. Only reflects the first character; setting it applies to all characters.ParagraphJustification enumerated value. Mixed values are read as ParagraphJustification.MULTIPLE_JUSTIFICATIONS; setting that value results in CENTER_JUSTIFY instead. Reflects and sets all paragraphs in the Text layer.AutoKernType.METRIC_KERN and AutoKernType.OPTICAL_KERN. Setting this also sets AutoKernType.NO_AUTO_KERN. Only reflects the first character; setting it applies to all characters.autoLeading is true. Setting this also sets autoLeading to true. Minimum settable value is 0 (silently clipped to 0.01). Only reflects the first character; setting it applies to all characters.LeadingType.ROMAN_LEADING_TYPE, LeadingType.JAPANESE_LEADING_TYPE. Reflects and sets all paragraphs in the Text layer.LineJoinType.LINE_JOIN_MITER, LineJoinType.LINE_JOIN_ROUND, LineJoinType.LINE_JOIN_BEVEL. Only reflects the first character; setting it applies to all characters.LineOrientation.HORIZONTAL, LineOrientation.VERTICAL_RIGHT_TO_LEFT, LineOrientation.VERTICAL_LEFT_TO_RIGHT.true if a Text layer is a layer of point (unbounded) text; otherwise false.true if a Text layer has small caps enabled; otherwise false. To set this value, use fontCapsOption. Only reflects the first character in the Text layer.[r, g, b] floating-point values. Throws an exception on read if applyStroke is not true. Setting this also sets applyStroke to true. Only reflects the first character; setting it applies to all characters.true, the stroke appears over the fill for a Text layer. The layer's Character Panel render-order setting can override the per-character value returned here. Only reflects the first character; setting it applies to all characters.true if a Text layer has subscript enabled; otherwise false. To set this value, use fontBaselineOption. Only reflects the first character in the Text layer.true if a Text layer has superscript enabled; otherwise false. To set this value, use fontBaselineOption. Only reflects the first character in the Text layer.Instance Methods
characterRange
Returns: CharacterRange
Since: 27.0
Returns an instance of the Text layer range accessor CharacterRange. The instance remembers the constructor parameters; they remain constant, and changes to the TextDocument's length may cause it to throw exceptions on access until the length changes back to a value that makes the range valid again. Use toString() on the result to find the constructed parameters.
Parameters
characterStart + 1. If -1, dynamically calculated as the TextDocument's text length on access. Must be greater than or equal to characterStart and less than or equal to the TextDocument's length.composedLineCharacterIndexesAt
Returns: { start: number; end: number }
Since: 27.0
Returns the character index bounds of the composed line intersecting the given text index. start is the composed line's start text index (greater than or equal to zero); end is its end index (greater than start, or equal to start if it's the last line). Throws if the computed bounds fall outside the current TextDocument.
Parameters
composedLineRange
Returns: ComposedLineRange
Since: 27.0
Returns an instance of the Text layer range accessor ComposedLineRange. The instance remembers the constructor parameters; they remain constant, and changes to the TextDocument's contents may cause it to throw exceptions on access until the contents change back to a value that makes the range valid again. Use toString() on the result to find the constructed parameters.
Parameters
composedLineIndexStart + 1. If -1, dynamically calculated as the last composed line on access. Must be greater than composedLineIndexStart and less than or equal to the number of composed lines.paragraphCharacterIndexesAt
Returns: { start: number; end: number }
Since: 27.0
Returns the character index bounds of the paragraph intersecting the given text index. start is the paragraph's start text index (greater than or equal to zero); end is its end index (greater than start, or equal to start if it's the last paragraph).
Parameters
paragraphRange
Returns: ParagraphRange
Since: 27.0
Returns an instance of the Text layer range accessor ParagraphRange. The instance remembers the constructor parameters; they remain constant, and changes to the TextDocument's contents may cause it to throw exceptions on access until the contents change back to a value that makes the range valid again. Use toString() on the result to find the constructed parameters.
Parameters
paragraphIndexStart + 1. If -1, dynamically calculated as the last paragraph on access. Must be greater than paragraphIndexStart and less than or equal to the number of paragraphs.resetCharStyle
Returns: boolean
Since: 27.0
Restores all characters in the Text layer to the default text character characteristics in the Character panel.
resetParagraphStyle
Returns: boolean
Since: 27.0
Restores all paragraphs in the Text layer to the default text paragraph characteristics in the Paragraph panel.
toString
Returns: string
Since: 27.0