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

    Interface TextEditScreenPose

    Screen-space pose passed to useTextEdit so the overlay can be placed and sized in CSS pixels.

    interface TextEditScreenPose {
        fontSize: number;
        height: number;
        lineHeight?: number;
        width: number;
        x: number;
        y: number;
        zoom?: number;
    }
    Index

    Properties

    fontSize: number

    Pre-scale font size: style.fontSize * zoom when zoom is omitted, the world-unit style.fontSize when it is set.

    height: number
    lineHeight?: number

    Effective on-screen line height multiplier (defaults to style.lineHeight).

    width: number

    Pre-scale — CSS pixels, or world units when zoom is set.

    x: number

    Top-left in CSS pixels relative to container. Always screen pixels, including when zoom is set — the scale is anchored at this point, not translated by it.

    y: number
    zoom?: number

    CSS scale applied to the overlay (transform: scale(zoom), anchored at its top-left). Every other size on this pose, and every typographic metric the hook writes, is then pre-scale — pass world units and the transform does the world→screen conversion.

    This is the only way run-level typography can be correct at a zoom other than 1. runsToDom emits run fontSize / letterSpacing in world units and domToRuns reads them straight back; threading a scale through the writer and its inverse through the reader would go lossy on fractional zooms. Scaling the whole overlay instead leaves that serializer pure and scales node-level and run-level values by the same factor for free.

    Omit it (the default, 1) and the pose is plain screen pixels — the hook then infers the world→screen factor from fontSize / style.fontSize to scale node-level letterSpacing, and run-level overrides are left unscaled. Correct only at zoom 1.