The HTMLCanvasElement or OffscreenCanvas that is associated with the above context.
If there was no associated <canvas> element, just store the default WIDTH / HEIGHT.
The 2D rendering context from the Canvas API. Forward method calls to this object.
Height of one line of text (in pixels).
StaticCANVAS_StaticCATEGORYStaticHEIGHTStaticWIDTHSet all pixels to transparent black rgba(0,0,0,0).
Set the pixels in a rectangular area to transparent black rgba(0,0,0,0).
Return a string of the form 'italic bold 15pt Arial'
Optionalcls: stringOptionalid: stringOptionaldevicePixelRatio: numberCanvasContext ignores setBackgroundFillStyle().
Optionalf: string | FontInfois 1) a FontInfo object or
2) a string formatted as CSS font shorthand (e.g., 'bold 10pt Arial') or
3) a string representing the font family (one of size, weight, or style must also be provided).
Optionalsize: string | numbera string specifying the font size and unit (e.g., '16pt'), or a number (the unit is assumed to be 'pt').
Optionalweight: string | numberis a string (e.g., 'bold', 'normal') or a number (100, 200, ... 900).
Optionalstyle: stringis a string (e.g., 'italic', 'normal').
StaticsanitizeEnsure that width and height do not exceed the browser limit.
array of [width, height] clamped to the browser limit.
A rendering context for the Canvas backend. This class serves as a proxy for the underlying CanvasRenderingContext2D object, part of the browser's API.