escpos-ts API - v1.0.0
    Preparing search index...

    Interface TextStyleOptions

    Style options for the Escpos.set and Escpos.setWithDefault methods.

    All fields are optional. Omitted fields leave the corresponding printer attribute unchanged (for Escpos.set) or use sensible defaults (for Escpos.setWithDefault).

    1.0.0

    interface TextStyleOptions {
        align?: "left" | "center" | "right";
        bold?: boolean;
        customSize?: boolean;
        density?: 0 | 4 | 5 | 2 | 1 | 7 | 3 | 8 | 6 | 9;
        doubleHeight?: boolean;
        doubleWidth?: boolean;
        flip?: boolean;
        font?: string;
        height?: 4 | 5 | 2 | 1 | 7 | 3 | 8 | 6;
        invert?: boolean;
        normalTextSize?: boolean;
        smooth?: boolean;
        underline?: 0 | 2 | 1;
        width?: 4 | 5 | 2 | 1 | 7 | 3 | 8 | 6;
    }
    Index

    Properties

    align?: "left" | "center" | "right"

    Horizontal text alignment.

    bold?: boolean

    Enable or disable bold text.

    customSize?: boolean

    Enable custom width × height size multipliers (auto-set when w or h > 1).

    density?: 0 | 4 | 5 | 2 | 1 | 7 | 3 | 8 | 6 | 9

    Print density (0–8; 9 = use printer default).

    doubleHeight?: boolean

    Print characters at double height.

    doubleWidth?: boolean

    Print characters at double width.

    flip?: boolean

    Enable 90-degree character rotation.

    font?: string

    Font identifier: 'a' for Font A, 'b' for Font B.

    height?: 4 | 5 | 2 | 1 | 7 | 3 | 8 | 6

    Vertical character height multiplier (1–8×).

    invert?: boolean

    Enable white-on-black character inversion.

    normalTextSize?: boolean

    Reset character size to 1×1 (cancels double-width/height).

    smooth?: boolean

    Enable character smoothing.

    underline?: 0 | 2 | 1

    Underline thickness: 0 = off, 1 = single, 2 = double.

    width?: 4 | 5 | 2 | 1 | 7 | 3 | 8 | 6

    Horizontal character width multiplier (1–8×).