API

Interface TextLayerOptions

Initial placement and compositing options for a 2D text layer in a standalone text renderer.

interface TextLayerOptions {
    coverageGamma?: number;
    opacity?: number;
    order?: number;
    positionPx?: { x: number; y: number };
    rotationRad?: number;
    scale?: number;
    visible?: boolean;
}
Index
coverageGamma?: number

Coverage gamma for anti-aliased edges. Raises per-pixel coverage to 1/coverageGamma before compositing, darkening/thickening anti-aliased edges to mimic the gamma-space blending used by native text renderers (DirectWrite/CoreText "stem darkening"). Only meaningful when rendering into an sRGB (linear-blended) surface, where correct linear AA otherwise makes text look lighter/thinner than gamma-space rasterizers. Values >1 thicken; 1 (default) is a no-op. Typical text values are ~1.8–2.2.

opacity?: number

Alpha multiplier in [0, 1]. Default 1.

order?: number

Sort order within a renderer (lower draws first). Default 0.

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

Top-left origin (in canvas pixels) for the layer's local coordinate frame. Default (0, 0).

rotationRad?: number

Z-axis rotation about positionPx, in radians. Default 0.

scale?: number

Uniform scale applied to the laid-out text. Default 1.

visible?: boolean

Default true.