v3.0 #255
Pinned
samizdatco
announced in
Announcements
v3.0
#255
Replies: 1 comment
-
I've been waiting for this. I made a simple text layout engine on top of skia-canvas. https://github.com/seanghay/sone |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
New Features
GUI
App
global now has aneventLoop
property which can be set to:"native"
(the default) in which case the Node event loop is suspended while the OS handles displaying GUI windows"node"
where the Node event loop maintains control (allowingsetInterval
andsetTimeout
to run) and handles GUI events manually every few milliseconds (though note some of the caveats associated with the Winit feature this uses).closed
property and emit aclose
event when they are closed. Closed windows can later be re-opened by calling the newopen()
method.borderless
attribute allows Window titlebars and borders to be hidden (thanks to @hydroperx Window#decorations #230)Imagery
loadImage()
andloadImageData()
helpers now usenode-fetch
to handle web requests and can accept a fetch options object as the final argument.Image
objects can now be created by passing a Buffer or dataURL-containing string as a constructor argument and will be immeditately drawable (no asynchronous loading required).sharp
npm module has been installed):loadImage()
&loadImageData()
can now be called with a Sharp object as their sole argumentsrc
property on a new Image object can be set to a Sharp object and it will begin asynchronously loadingcreateTexture()
for setting the line cap style and selecting whether vector patterns should be clipped or outlinedRendering
downsample
flag (for jpegs only), which enables 4:2:0 chroma-subsampling. By default, no subsampling (a.k.a. 4:4:4) will be performeddensity
,matte
, andmsaa
) which behave the same as their equivalents in the toFile() method.Typography
textContrast
— a number in the range 0.0–1.0 controlling the amount of additional weight to add (defaults to0.0
)textGamma
— a number in the range 0.0–4.0 controlling how glyph edges are blended with the background (defaults to1.4
)textAlign
attribute can now be set to"justify"
measureText()
has been rewritten to calculate metrics based not just on the font specified infont
but also any fallback fonts that were used for character glyphs not present in the ‘main’ font. The line-by-line measurements now include aruns
array with bounds and metrics for each single-font range of characters on the line.Supported Platforms
libfontconfig
packages no longer need to be installed on the host system usingapt
,apk
,yum
,dnf
, etc.Breaking Changes
saveAs()
andsaveAsSync()
are now calledtoFile()
andtoFileSync()
toDataURL()
now behaves the same as its browser equivalent: it is synchronous and its only configuration option is a numericalquality
settingtoDataURLSync()
has been removedtoURL()
andtoURLSync()
produce data URLs and support the same enhanced export options astoBuffer
outline
option is set totrue
fast-glob
dependency). If you want the old behavior, try adding thefast-glob
orglob
modules to your package and using them like this.Misc. Improvements
App.launch()
now returns a Promise that resolves when the final window is closed, allowing you to schedule code to run before the process would otherwise exit (see also the newidle
event which fires under the same circumstances).input
event objects now contain aninputType
property to distinguish between insertion, deletion, and IME compositionmousemove
events)buttons
attributedensity
option passed to toFile() or toBuffer())SKIA_CANVAS_STRICT
environment variable to1
ortrue
.node-pre-gyp
with a custom installation script and removed theglob
dependency, cutting the number ofnode_modules
directories installed from 83 to 12.file:
URLs (allowing relative paths to be constructed withimport.meta.url
)gpu
property which can be set tofalse
in order to use CPU-based renderingBugfixes
cursor
property to "none" now hides the cursormoved
window events are no longer emitted during resizesresize
events now update the window object’s width & height properties in addition to providing the new size in the event objectroundRect()
now reflects context's current transform state and accepts plain{x, y}
objects for corner-radii in addition to Numbers and DOMPoints (thanks to @mpaperno Accept any{x:number, y:number}
object when parsing corner radii #223)createConicGradient()
are no longer incorrectly offset by 90°lineTo
on an empty Path2D no longer adds a line from the origin to the specified coordinates: it now acts as if it were amoveTo
measureText()
now correctly calculates widths when letterSpacing has been setstartRange
andendRange
in TextMetrics.lines[] now correspond to character indices in the string passed to measureText(), not byte indices into the UTF-8 buffer backing itFull Changelog: v2.0.2...v3.0.0
Beta Was this translation helpful? Give feedback.
All reactions