weasel API - v0.8.0
    Preparing search index...

    Interface TextStyle

    User-facing text style. All fields optional; defaults applied at render time via resolveTextStyle.

    interface TextStyle {
        align?: "center" | "left" | "right";
        caretColor?: string;
        fill?: FillStyle;
        fontFamily?: string;
        fontSize?: number;
        fontStyle?: "normal" | "italic";
        fontWeight?: string | number;
        letterSpacing?: number;
        lineHeight?: number;
        selectionBackground?: string;
        selectionColor?: string;
        strikethrough?: boolean;
        stroke?: Stroke;
        underline?: boolean;
    }
    Index

    Properties

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

    Default 'left'.

    caretColor?: string

    Caret color used by the edit overlay. Defaults to the text color when fill is solid; falls back to #000 for non-solid paints.

    fill?: FillStyle

    Default { fill: 'solid', color: '#000' }.

    fontFamily?: string

    Default 'sans-serif'.

    fontSize?: number

    Font size in world units. Default 16.

    fontStyle?: "normal" | "italic"

    Default 'normal'.

    fontWeight?: string | number

    Default 400.

    letterSpacing?: number

    Extra advance added after each glyph, in world units. Default 0.

    lineHeight?: number

    Multiplier applied to fontSize. Default 1.2.

    selectionBackground?: string

    Selection background color used by the edit overlay's ::selection pseudo-element. Defaults to a 25%-opacity tint of caretColor via CSS color-mix. Pass 'none' to fall back to the browser-native highlight.

    selectionColor?: string

    Selection text color paired with selectionBackground. Default: inherits text color.

    strikethrough?: boolean

    Default false.

    stroke?: Stroke

    Outline painted over the glyph fill. Omitted (the default) means no outline — there is no such thing as a default text stroke.

    Only glyphs on the outline tier are stroked: above textOutlineMinScreenSize a glyph is a real PolygonPath, so it gets the ordinary tessellated ribbon with real joins, caps and miters, in any paint. Below it a glyph is a sampled distance field with no geometry to stroke, and it renders unstroked rather than approximated. width is in world units, like every other stroke in the kit — it does not scale with fontSize.

    underline?: boolean

    Default false.