Hierarchy

  • TextRenderer<CanvasTextRendererState>
    • CanvasTextRenderer

Constructors

Properties

canvas: OffscreenCanvas | HTMLCanvasElement
context: CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D
fontFamilies: FontFamilyMap = {}

Font family map used to store web font faces that were added to the canvas text renderer.

fontFamilyArray: FontFamilyMap[] = ...
set: Readonly<TrPropSetters<CanvasTextRendererState>>
stage: Stage
type: "canvas" | "sdf" = 'canvas'

Methods

  • Invalidate the layout cache stored in the state. This will cause the text to be re-rendered on the next update.

    Parameters

    • state: CanvasTextRendererState

    Returns void

    Remarks

    This also invalidates the visible window cache.

  • Schedule a state update via queueMicrotask

    Parameters

    • state: CanvasTextRendererState

    Returns void

    Remarks

    This method is used to schedule a state update via queueMicrotask. This method should be called whenever a state update is needed, and it will ensure that the state is only updated once per microtask.

  • Allows the CoreTextNode to communicate changes to the isRenderable state of the itself.

    Parameters

    • state: CanvasTextRendererState
    • renderable: boolean

    Returns void

  • Parameters

    • state: CanvasTextRendererState
    • status: "loaded" | "failed" | "loading" | "initialState" | "destroyed"
    • Optional error: Error

    Returns void

Generated using TypeDoc