Packages

@napi-rs/canvas

1.1.0 · 30 Oct 2026MIT47.9M / weekRepositoryHomepagenpmAtom feed

Your version

1.1.0

latest30 Oct 2026Where it was published

In short

1 new9 fixed6 internal

Release note

Highlights

Portable text rendering by default

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:

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

  • build: Bind the addon's own symbols on Linux so Electron's cxx runtime cannot replace them

  • text: Draw text the same on every OS by default, add setTextRenderer

  • path: Draw full-sweep arc() and ellipse() for every start angle

  • path: Draw a degenerate ellipse() as straight lines like Chrome

  • build: Compile Windows Skia with -ffp-contract=off like Chromium

  • path: follow-ups to #1408: rotate() path, arc() start == end, rotated ellipse, isPointInStroke state, one-point stroke prune

  • build: Compile skia-c with -ffp-contract=off like Chromium

  • ctx: Keep Blink's double CTM as the source of truth

  • ctx: Decide CTM invertibility from Blink's double CTM

  • ctx: Skip the stroke of every one-point path like Chrome