UXP Toolkit
    Preparing search index...

    Interface TextLayerCreateOptions

    An object literal can be constructed with any of the following properties and passed to Document.createLayer. As a type, TextLayerCreateOptions can be used in Typescript development.

    const options = { name: "myTextLayer", contents: "Hello, World!", fontSize: 24, position: {x: 200, y: 300} };
    await require('photoshop').app.activeDocument.createLayer(options);

    objects/createoptions

    24.2

    interface TextLayerCreateOptions {
        blendMode?: BlendMode;
        color?: LabelColors;
        contents?: string;
        fontName?: string;
        fontSize?: number;
        group?: boolean;
        mode?: BlendMode;
        name?: string;
        opacity?: number;
        position?: { x: number; y: number };
        textColor?: SolidColor;
    }

    Hierarchy

    • LayerCreateOptionsBase
      • TextLayerCreateOptions
    Index

    Properties

    blendMode?: BlendMode

    Blend mode of the newly created layer or group.

    NORMAL
    

    22.5

    color?: LabelColors

    Label color of the newly created layer or group.

    NONE
    

    22.5

    contents?: string

    Text content of the newly created text layer.

    "Lorem Ipsum"
    

    24.2

    fontName?: string

    Font PostScript name of the newly created text layer.

    "MyriadPro-Regular"
    

    24.2

    fontSize?: number

    Font size of the newly created text layer in pixels.

    12px
    

    24.2

    group?: boolean

    Whether to use previous layer to create clipping mask.

    false
    

    22.5

    mode?: BlendMode

    Deprecated, please use blendMode above as it will override this value.

    NORMAL
    

    22.5

    name?: string

    Name of the newly created layer. If no value is provided, then a name will be generated following the template, "Layer #".

    -
    

    22.5

    opacity?: number

    Opacity of the newly created layer or group.

    100
    

    22.5

    position?: { x: number; y: number }

    Insertion coordinates of the newly created text layer, in pixels

    document center.
    

    24.2

    textColor?: SolidColor

    Text color of the newly created text layer.

    black
    

    24.2