OpenSheetMusicDisplay
    Preparing search index...

    Class CanvasVexFlowBackend

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    canvas: HTMLElement
    graphicalMusicPage: GraphicalMusicPage

    The GraphicalMusicPage the backend is drawing from. Each backend only renders one GraphicalMusicPage, to which the coordinates are relative.

    height: number
    inner: HTMLElement
    renderer: Renderer
    width: number

    Accessors

    Methods

    • Initialize a canvas without attaching it to a DOM node. Can be used to draw in background

      Parameters

      • width: number = 300

        Width of the canvas

      • height: number = 300

        Height of the canvas

      Returns void

    • Renders a text to the screen.

      Parameters

      • fontHeight: number
      • fontStyle: FontStyles
      • font: Fonts
      • text: string
      • heightInPixel: number
      • screenPosition: PointF2D
      • color: string = undefined
      • fontFamily: string = undefined
      • language: string = undefined

        the language of the text as a BCP 47 tag (e.g. "ja"), for the browser's choice of fonts (see Label.language)

      Returns Node

    • Resizing a canvas clears its bitmap. Lazy/incremental rendering grows the canvas as it appends batches, so snapshot the current pixels and redraw them after resizing. For a normal render the canvas is still empty here, so this is effectively a no-op.

      Parameters

      • width: number
      • height: number

      Returns void