ImageScript v4.0.0
    Preparing search index...

    InterfaceTextStyleOptions

    Text style options of Image.renderText

    interface TextStyleOptions {
        features?: Record<string, number | boolean>;
        hinting?: boolean;
        strokeColor?: number;
        strokeWidth?: number;
        variations?: Record<string, number | boolean>;
    }

    Hierarchy (View Summary)

    Index
    features?: Record<string, number | boolean>

    OpenType features by their tags, for the whole text: true turns one on (like tnum for tabular numbers, smcp for small caps, ss01 for a stylistic set), false off (also the ones on by default, like liga or kern), a number picks an alternate (salt: 2). Fonts without a feature ignore it

    {}

    hinting?: boolean

    Whether to run the hinting instructions of TrueType fonts, which align stems and edges with the pixel grid for crisper text at small sizes (like Windows renders text); the glyphs of hinted fonts are then placed on whole pixels. Fonts without instructions (and CFF/OpenType outlines) aren't affected

    true

    strokeColor?: number

    Color of the outline

    0x000000ff

    strokeWidth?: number

    Width of an outline around the glyphs in pixels

    0

    variations?: Record<string, number | boolean>

    The instance of variable fonts, by their axes: weight (1-1000, like CSS's font-weight: 400 regular, 700 bold), width (percent of the normal width: 75 condensed, 125 expanded), slant (degrees, negative leans right), italic (true/false), opticalSize (the size the glyphs are designed for, in pixels; default: the font size, like browsers' font-optical-sizing: auto), and other axes by their 4-character tag (like Roboto Flex's GRAD: 50). Values outside an axis's range are clamped, axes a font doesn't have are ignored, fonts without axes aren't affected

    {} (the fonts' default instances)