API

Function setFontWeightOffset

  • Set the synthetic font-weight contour offset (in font design units) of one run of data.

    This mutates live text data, like a setter on a material: the run is repacked and regrouped before the call returns, so it is valid at any point in the TextData's life — including after it is already bound and rendering. Runs are packed synchronously by createTextData / createDefaultTextData / updateTextData, which is why the offset belongs to the owning data rather than to a detached run descriptor.

    • Positive offsets expand the rendered fill outward (bolder / thicker).
    • Zero removes any previously set offset, returning the run to the base pipeline.

    Offsets are keyed by run identity, so an update that replaces a run descriptor (e.g. updateDefaultTextData, or updateTextData({ update: "replaceRun" })) drops the offset; re-apply it to the new run — by index, most conveniently.

    Parameters

    • data: TextData

      The TextData (or DefaultTextData) that owns the run.

    • run: number | GlyphRun

      The run to weight: its GlyphRun reference, or its index in data.runs.

    • offset: number

      Contour offset in font design units. Finite, clamped to 0–100.

    Returns void