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).
Set 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'
CanvasContext ignores setBackgroundFillStyle()
.
is 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).
a string specifying the font size and unit (e.g., '16pt'), or a number (the unit is assumed to be 'pt').
is a string (e.g., 'bold', 'normal') or a number (100, 200, ... 900).
is a string (e.g., 'italic', 'normal').
This is kept for backwards compatibility with 3.0.9.
Ensure 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.