← 输入框|imagescript.dev|刷新
ImageScript v4.1.0
    Preparing search index...

    InterfaceTextLayoutOptions

    The layout options of Image.renderText (part of RenderTextOptions): the size, wrapping and alignment

    interface TextLayoutOptions {
        height?: number;
        horizontalAlign?: HorizontalAlign;
        verticalAlign?: VerticalAlign;
        width?: number;
        wrapStyle?: WrapStyle;
    }

    Hierarchy (View Summary)

    Index
    height?: number

    The image's height in pixels: lines that don't fit are left out, and the text is placed in it by verticalAlign.

    The height of the lines
    
    horizontalAlign?: HorizontalAlign

    Where the lines are placed horizontally: 'left', 'center' or 'right' in the width, or (without one) relative to the widest line

    The paragraph's direction: 'left' for left-to-right text, 'right' for right-to-left text (Arabic, Hebrew, ...), like the start of CSS' text-align

    verticalAlign?: VerticalAlign

    Where the text is placed vertically in the height: 'top', 'middle' or 'bottom'. When not all lines fit, these keep the first, the middle or the last lines. Without a height, it has no effect

    'top'

    width?: number

    The image's width in pixels: lines are wrapped to fit into it (inside the outline, see TextStyleOptions.strokeWidth) and placed in it by horizontalAlign

    The widest line's width
    
    wrapStyle?: WrapStyle

    Whether to wrap between words or at any character

    'word'