Hierarchy

Properties

canvas: HTMLCanvasElement | OffscreenCanvas
context: OffscreenCanvasRenderingContext2D | CanvasRenderingContext2D
fontName: string
fontStyle: string
size: number
fauxBold: boolean
fauxItalic: boolean
fontBoundingBoxMap: {
    key: string;
    value: Rect;
}[] = []

Methods

  • Parameters

    • canvas: HTMLCanvasElement | OffscreenCanvas

    Returns void

  • Parameters

    • context: OffscreenCanvasRenderingContext2D | CanvasRenderingContext2D

    Returns void

  • Returns {
        ascent: number;
        descent: number;
        xHeight: number;
        capHeight: number;
    }

    • ascent: number
    • descent: number
    • xHeight: number
    • capHeight: number
  • Parameters

    • text: string
    • bounds: Rect

    Returns HTMLCanvasElement | OffscreenCanvas

  • Parameters

    • ctx: OffscreenCanvasRenderingContext2D | CanvasRenderingContext2D
    • text: string

    Returns TextMetrics

Constructors

  • Parameters

    • fontName: string
    • fontStyle: string
    • size: number
    • fauxBold: boolean = false
    • fauxItalic: boolean = false

    Returns ScalerContext

Generated using TypeDoc