meo-skia-canvas
    Preparing search index...

    Class ParagraphBuilder

    🧪 Not in the HTML Canvas standard.

    Index
    • Create a builder for laying out styled text.

      Text is shaped with the process-global font library. CanvasKit takes a FontMgr here; this build has no per-builder equivalent, so the parameter is omitted rather than accepted and ignored.

      const para = new ParagraphBuilder({ textStyle: { fontSize: 16 } })
      .addText("hello")
      .build()

      Parameters

      Returns ParagraphBuilder

    • Reserve a rectangle in the text flow for something drawn separately.

      align and baseline were accepted and discarded until 4.2.0, so every placeholder laid out on the baseline whatever was passed. A value outside either set now throws rather than silently reverting to the default.

      Parameters

      Returns this

    • Append text in the current style.

      Parameters

      • text: string

      Returns this

    • End the innermost pushStyle, returning to the style beneath it. Popping with nothing pushed is harmless.

      Returns this

    • Begin a run in style, stacked on top of whatever is already pushed. Text added from here on uses it until the matching pop.

      Font variations are the exception: the paragraph's font collection is fixed when the builder is created, so an axis position pushed here has no effect. Set those on the constructor's textStyle.

      Parameters

      Returns this