Graphics.Canvas.Extra
- Package
- purescript-web-font-loading
- Repository
- rowtype-yoga/purescript-web-font-loading
Native canvas capabilities not provided by Graphics.Canvas.
#createCanvasElement Source
createCanvasElement :: Effect CanvasElementA fresh, detached <canvas> element, not attached to the document — handy as
an offscreen drawing surface (e.g. a texture source).
#createOffscreenCanvas Source
createOffscreenCanvas :: Number -> Number -> Effect CanvasElementConstruct a native worker-compatible surface. Throws when OffscreenCanvas is unavailable; callers can choose another surface using the capability query.
#supportsOffscreenCanvas Source
supportsOffscreenCanvas :: Effect BooleanUnlike detached DOM canvases, these surfaces are available in workers.
#getContext2DNullable Source
getContext2DNullable :: CanvasElement -> Effect (Nullable Context2D)Preserve the native null result when the context type is unavailable or the surface has already been bound to a different context type.
#resetContext Source
resetContext :: Context2D -> Effect UnitUse the native reset operation when available. On older implementations, restore the identity transform and clear the bitmap without resizing it.
#createPatternNullable Source
createPatternNullable :: Context2D -> CanvasImageSource -> PatternRepeat -> Effect (Nullable CanvasPattern)Like Graphics.Canvas.createPattern, but retain native allocation failure.
#setPatternTransform Source
setPatternTransform :: CanvasPattern -> Transform -> Effect BooleanApply a DOMMatrix2DInit directly; no DOMMatrix constructor is needed in workers. Returns false if this browser does not support pattern transforms.
#LetterSpacing Source
newtype LetterSpacingA CSS length controlling extra space between glyphs, e.g. 8px.
Constructors
Instances
#setLetterSpacing Source
setLetterSpacing :: Context2D -> LetterSpacing -> Effect UnitSet the context's letterSpacing.
#FontKerning Source
#setFontKerning Source
setFontKerning :: Context2D -> FontKerning -> Effect UnitSet the context's fontKerning.