skia-canvas
Advanced tools
Changelog
📦 ⟩ [v0.9.26] ⟩ Oct 18, 2021
icudtl.dat
fileFontLibrary.use
now reports an error if the specified font file doesn't existmeasureText
with various unicode escapesChangelog
📦 ⟩ [v0.9.25] ⟩ Aug 22, 2021
drawImage()
][mdn_drawImage]imageSmoothingQuality
settings to provide a more meaningful range across low
, medium
, and high
measureText()
][measureText()] now returns correct metrics regardless of current textAlign
settingicudtl.dat
changes on Windows (which suppressed the misleading warning message but required running as Administrator)Changelog
📦 ⟩ [v0.9.24] ⟩ Aug 18, 2021
d
][p2d_d] property with an SVG representation of the path’s contours and an [unwind()
][p2d_undwind] method for converting from even-odd to non-zero winding rulescreateTexture()
][createTexture()] context method returns CanvasTexture objects which can be assigned to fillStyle
or strokeStyle
setLineDash
is active can now be customized by assigning a Path2D to the context’s [lineDashMarker
][lineDashMarker] property (default dashing can be restored by assigning null
)lineDashFit
][lineDashFit] property which defaults to "turn"
but can be set to "move"
(which preserves orientation) or "follow"
(which distorts the marker’s shape to match the contour)??
operator which is unavailable prior to Node 14icudtl.dat
file could not be foundsimplify()
][simplify] method now takes an optional fill-rule argumentChangelog
📦 ⟩ [v0.9.23] ⟩ Jul 12, 2021
conicCurveTo()
][conicCurveTo] methodoutlineText()
][outline_text] methodedges
][edges] property which contains an array of line-drawing commands describing the path’s individual contourscontains()
][contains] method which tests whether a given point is on/within the pathpoints()
][points] method which returns an array of [x, y]
pairs at the requested spacing along the curve’s peripheryoffset()
][offset] or [transform()
][transform] to shift position or apply a DOMMatrix respectivelyjitter()
][jitter] to break the path into smaller sections and apply random noise to the segments’ positionsround()
][round] to round off every sharp corner in a path to a particular radiustrim()
][trim] to select a percentage-based subsection of the pathinterpolate()
][interpolate] methodfill()
or stroke()
method no longer disturbs the context’s ‘current’ path (if one has been created using beginPath()
)filter
property will now accept percentage values greater than 999%newPage()
and saveAs()
methods now work in the browser, including the ability to save image sequences to a zip archive. The browser’s canvas is still doing all the drawing however, so file export formats will be limited to PNG and JPEG and none of the other Skia-specific extensions will be available.matte
][matte] value in their options object which can be used to set the background color for any portions of the canvas that were left semi-transparentChangelog
📦 ⟩ [v0.9.22] ⟩ Jun 09, 2021
async
][async_orig] property for details.SaveAs
and the other canvas output functions all accept an optional [density
][density] argument which is an integer ≥1 and will upscale the image accordingly. The density can also be passed using the filename
argument by ending the name with an ‘@’ suffix like some-image@2x.png
.outline
][outline] argument to true
.toBuffer
, toDataURL
, png
, jpg
, pdf
, and svg
) and file i/o (saveAs
) are now asynchronous and return Promise
objects. The old, synchronous behavior is still available on a canvas-by-canvas basis by setting its async
property to false
.quality
argument accepted by the output methods is now a float in the range 0–1 rather than an integer from 0–100. This is consistent with the encoderOptions arg in the spec. Quality now defaults to 0.92 (again, as per the spec) rather than lossless.measureText
was reporting zero when asked to measure a string that was entirely made of whitespace. This is still the case for ‘blank‘ lines when textWrap
is set to true
but in the default, single-line mode the metrics will now report the width of the whitespace.Context2D
s now use an external Typesetter
struct to manage layout and rendering.Changelog
📦 ⟩ [v0.9.21] ⟩ May 22, 2021
createConicGradient()
][createConicGradient()].decode()
method allowing for async loading without the [loadImage
][loadImage()] helper.drawImage
with a Canvas
object as the argument now uses a Skia Pict
rather than a Drawable
as the interchange format, meaning it can actually respect the canvas's current globalAlpha
and globalCompositeOperation
state (fixed #6).CanvasPattern
s now respect the imageSmoothingEnabled
settingcounterclockwise
arg to ellipse
and arc
is now correctly treated as optional.console.log
representations of the canvas-related objects friendlier.Path2D
, Image
, and Canvas
’s format support.Changelog
📦 ⟩ [v0.9.20] ⟩ Mar 27, 2021
loadImage
helper can now handle Buffer
argumentsctx.font