Skip to content

chore(deps): bump @napi-rs/canvas from 1.1.0 to 1.2.0 - #71

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/napi-rs/canvas-1.2.0
Open

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/npm_and_yarn/napi-rs/canvas-1.2.0

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 25, 2026

Copy link
Copy Markdown
Contributor

Bumps @napi-rs/canvas from 1.1.0 to 1.2.0.

Release notes

Sourced from @​napi-rs/canvas's releases.

v1.2.0

Highlights

@font-face descriptors in GlobalFonts and static font-stretch matching (#1464, #1465, #1467)

GlobalFonts.register(font, nameAlias?, descriptors?) and GlobalFonts.registerFromPath(path, nameAlias?, descriptors?) now accept a descriptors object ({ weight, style, stretch }), matching Chrome's new FontFace(name, data, descriptors):

  • Supports CSS values, ranges ('100 900', 'oblique 10deg 20deg', '75% 125%'), calc(), and 'auto'. Invalid descriptors return null without registering; non-object descriptors throw a TypeError.
  • Variable fonts clamp wght/slnt/wdth to declared descriptor ranges, use the ital axis for italic when available, and apply variation coordinates in SVG <text>.
  • Static (non-variable) font-stretch matching now follows CSS Fonts Level 4 (Width > Style > Weight priority and exact matches for expanded widths).
GlobalFonts.registerFromPath('./fonts/Lato-Regular.ttf', 'MyLato', { weight: 400 })
GlobalFonts.registerFromPath('./fonts/Lato-Bold.ttf', 'MyLato', { weight: 700 })

Behavior change: registered faces without descriptors are all auto, so in a family registered without descriptors, the most recently registered face draws every style (with synthetic bold/italic when needed), matching Chrome @font-face. Pass { weight, style, stretch } for each file in a family, or use loadFontsFromDir to match by each file's own style.

DirectWrite and Fontations on Windows in setTextRenderer('system') (#1468)

setTextRenderer('system') on Windows now uses DirectWrite (with Fontations for color, CFF2, avar2, and unsupported variable fonts) plus Chrome Windows' gamma/contrast and rasterizer settings. The default 'portable' text renderer is unchanged across all OSes.

PNG compressionLevel and filters options (#1463)

encode('png', options), encodeSync('png', options), toBuffer('image/png', options), and the node-canvas compatibility PngConfig now accept compressionLevel (zlib 0–9, default 6) and filters (libpng row filter bitmask via the new PngFilter export, default PngFilter.All / 0xF8):

const { createCanvas, PngFilter } = require('@napi-rs/canvas')
// Fast PNG encoding (Chromium's canvas preset: zlib level 1, Up filter only)
const png = await canvas.encode('png', {
compressionLevel: 1,
filters: PngFilter.Up,
})

ctx.antialias property (#1466)

Adds the node-canvas-compatible ctx.antialias property ('default' | 'none' | 'gray' | 'subpixel', default 'default'), saved and restored with save()/restore()/reset(). Setting 'none' disables antialiasing on raster shapes, strokes, clips, text, and bitmap image borders without affecting measureText().

What's Changed

... (truncated)

Changelog

Sourced from @​napi-rs/canvas's changelog.

1.2.0 (2026-11-20)

Bug Fixes

Features

1.1.1 (2026-11-12)

Bug Fixes

  • canvas: keep the canvas usable while an async encode is pending (#1424) (fa94bdc), closes #3584 #1419
  • deps: update rust crate selectors to 0.42 (#1422) (699311f)
  • deps: update rust crate selectors to 0.43 (#1456) (88bc119)
  • fonts: a name given to a file loadFontsFromDir loaded is its own FontFace (#1451) (5500224)
  • fonts: a name registered over an installed family works like a FontFace (#1447) (907d313)
  • fonts: free removed fonts (RSS stays flat) (#1445) (155ee1b)
  • fonts: spellings of a family are one family, and the face added last wins (#1450) (285031e)
  • image: draw a complete Buffer image before onload like Chrome (#1426) (921ef7c)
  • svg: SVG text falls back per character through the font list, as Chrome does (#1453) (458e584)
  • svg: synthetic bold and italic in SVG text (#1454) (f7ccba5)
  • text: a lang change re-sets the font like Blink (#1444) (14e4003)
  • text: floor every font size to 1/100 px like Chrome (#1430) (fa2d404)
  • text: let the font decide Turkish ligatures like Chrome (#1427) (6966812)
  • text: resolve letterSpacing and wordSpacing units like Chrome (#1449) (677b87a)
  • text: take characters the font list lacks from installed fonts (#1452) (9441087)
  • text: word spacing on a leading space follows desktop Chrome (#1446) (7367a1d)

Features

  • text: add Blink fallback stages and the macOS system fallback to the shaper (#1433) (0fc739a)
  • text: add chws and HanKerning to the Blink-style shaper (#1438) (00d7c7a)
  • text: add font-variant-caps to the Blink-style shaper (#1436) (ae1eb80)
  • text: add fontFeatureSettings, fontVariantLigatures/Numeric/Position, fontSizeAdjust and fontOpticalSizing (#1428) (614d41c)
  • text: add host language and per-script fonts to the Blink-style shaper (#1439) (f514832)
  • text: add letter and word spacing to the Blink-style shaper (#1435) (378814a)
  • text: add per-face size, opsz and ptem to the Blink-style shaper (#1437) (82156e6)
  • text: add the Blink shaper scaffold behind NAPI_RS_CANVAS_SHAPER (#1431) (aee4d71)
  • text: draw .notdef where the Blink shaper has no fallback source (#1441) (934cb92)

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [@napi-rs/canvas](https://github.com/Brooooooklyn/canvas) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/Brooooooklyn/canvas/releases)
- [Changelog](https://github.com/Brooooooklyn/canvas/blob/main/CHANGELOG.md)
- [Commits](Brooooooklyn/canvas@v1.1.0...v1.2.0)

---
updated-dependencies:
- dependency-name: "@napi-rs/canvas"
  dependency-version: 1.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code labels Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants