v1.1.0
Added 2
- Added setTextRenderer function to select the text renderer mode, with 'system' restoring the previous Chrome-like platform-specific behavior behavior changed · inferred, marked in the notes below
- Added getTextRenderer function to inspect the active text renderer mode
Changed 1
- Text now defaults to the portable renderer, using FreeType on macOS, Linux, and Windows so rendering and measureText results are consistent across operating systems when the same fonts are registered
Fixed 9
- Full-sweep arc() and ellipse() now draw correctly for every start angle
- A degenerate ellipse() is drawn as straight lines like Chrome
- Addon's own symbols are bound on Linux so Electron's cxx runtime cannot replace them
- Windows Skia is compiled with -ffp-contract=off like Chromium
- Skia-c is compiled with -ffp-contract=off like Chromium
- rotate() path, arc() with equal start and end angles, rotated ellipse, isPointInStroke state, and one-point stroke pruning were corrected
- Blink's double CTM is kept as the source of truth for the context transform
- CTM invertibility is decided from Blink's double CTM
- The stroke of every one-point path is skipped like Chrome
1 change to check, marked in the notes below
From @napi-rs/canvas
Highlights
Portable text rendering by default (#1404)
Text now defaults to the portable renderer, using FreeType on macOS, Linux, and Windows to make rendering and measureText results consistent across operating systems when the same fonts are registered.
Behavior change: default text output, measurements, and system-font resolution can differ from v1.0.12/v1.0.13. To restore the previous Chrome-like, platform-specific behavior, call: behavior changed · inferred
const { setTextRenderer } = require('@napi-rs/canvas')
setTextRenderer('system')
Use getTextRenderer() to inspect the active mode. Installed fonts and fallback for characters missing from registered fonts can still vary by OS and machine.
What's Changed
- chore(deps): group @oxc-node packages in renovate config by @Brooooooklyn in https://github.com/Brooooooklyn/canvas/pull/1398
- chore(deps): update dependency electron to v45 by @renovate[bot] in https://github.com/Brooooooklyn/canvas/pull/1399
- fix(ci): invalidate musl cache on Zig toolchain changes by @Brooooooklyn in https://github.com/Brooooooklyn/canvas/pull/1400
- docs: remove broken install size badge by @Brooooooklyn in https://github.com/Brooooooklyn/canvas/pull/1401
- fix(build): bind the addon's own symbols on Linux so Electron's cxx runtime cannot replace them by @Brooooooklyn in https://github.com/Brooooooklyn/canvas/pull/1406
- feat(text): draw text the same on every OS by default, add setTextRenderer by @Brooooooklyn in https://github.com/Brooooooklyn/canvas/pull/1404
- fix(path): draw full-sweep arc() and ellipse() for every start angle by @Brooooooklyn in https://github.com/Brooooooklyn/canvas/pull/1407
- fix(path): draw a degenerate ellipse() as straight lines like Chrome by @Brooooooklyn in https://github.com/Brooooooklyn/canvas/pull/1408
- fix(build): compile Windows Skia with -ffp-contract=off like Chromium by @Brooooooklyn in https://github.com/Brooooooklyn/canvas/pull/1409
- fix(path): follow-ups to #1408: rotate() path, arc() start == end, rotated ellipse, isPointInStroke state, one-point stroke prune by @Brooooooklyn in https://github.com/Brooooooklyn/canvas/pull/1411
- fix(build): compile skia-c with -ffp-contract=off like Chromium by @Brooooooklyn in https://github.com/Brooooooklyn/canvas/pull/1412
- fix(ctx): keep Blink's double CTM as the source of truth by @Brooooooklyn in https://github.com/Brooooooklyn/canvas/pull/1413
- fix(ctx): decide CTM invertibility from Blink's double CTM by @Brooooooklyn in https://github.com/Brooooooklyn/canvas/pull/1414
- fix(ctx): skip the stroke of every one-point path like Chrome by @Brooooooklyn in https://github.com/Brooooooklyn/canvas/pull/1415
- chore(deps): update dependency node to v26 by @renovate[bot] in https://github.com/Brooooooklyn/canvas/pull/1410
- fix(ci): use vendored Yarn in Node test containers by @Brooooooklyn in https://github.com/Brooooooklyn/canvas/pull/1417
Full Changelog: https://github.com/Brooooooklyn/canvas/compare/v1.0.13...v1.1.0