UXP Toolkit
    Preparing search index...

    The Class that groups all Type related properties of a Text Layer in Photoshop.

    const app = require('photoshop').app;
    const textItem = app.activeDocument.activeLayers[0].textItem;

    Some properties and methods are available directly in the TextItem instance itself:

    textItem.contents; // "Lorem Ipsum"
    textItem.contents = "Hello World";
    textItem.isPointText; // true
    await textItem.convertToParagraphText();

    Most properties and methods are grouped for convenience in the characterStyle and paragraphStyle properties of TextItem.

    textItem.characterStyle.size; // 12
    textItem.characterStyle.size = 24;
    textItem.paragraphStyle.hyphenation; // true

    Finally, the warpStyle object contains all the properties related to the Warp effect applied to the text layer.

    textItem.warpStyle.style; // "arcLower"
    

    Please note that for some properties that are expressed in pixels, the valid range of values might depend on the document's resolution. When this is the case, you'll find that in the documentation "for a 72ppi document" is specified.

    An example is the font size:

    // Range: 0.01..1296—for a 72ppi document
    textItem.characterStyle.size = 1000;

    If you want to find the range for documents with a different resolution, please use the following conversion formula:

    newVal = (documentResolution / 72) * referenceVal;

    // I.e., for a 300ppi document the maximum font size will be:
    // (300 / 72) * 1296 = 5400px

    Upon setting a value, validation will be performed internally. An invalid value will result in a Range Error.

    24.1

    Index

    Constructors

    Properties

    characterStyle: CharacterStyle

    The object that stores properties related to the Character panel in the Photoshop UI.

    paragraphStyle: ParagraphStyle

    The object that stores properties related to the Paragraph panel in the Photoshop UI.

    warpStyle: TextWarpStyle

    The object that stores properties related to the Warp Text dialog.

    Accessors

    Methods