Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Jan 31, 2022

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull bot added the ⤵️ pull label Jan 31, 2022
chearon and others added 27 commits February 24, 2022 20:12
greatly improves font matching accuracy

Fixes #1572
Use latest setup-node and pin to Windows 2019. Windows 2022 needs dealing with later.
* feat: add ESM support

* docs: updated CHANGELOG

* refactor: destructure once

Co-authored-by: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>

* fix: use `exports.[name] = value` instead

Co-authored-by: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
the problem was exposed by #1987, but was always there

fixes #2041
While testing the solution for a local build, I got the next output:
```sh
Package pixman-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `pixman-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pixman-1' found
gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
```

After updating the command to the following: `brew install pkg-config cairo pango libpng jpeg giflib librsvg pixman`, I was able to generate a succesful build.

```sh
brew install pkg-config cairo pango libpng jpeg giflib librsvg pixman;
cd /node_modules/canva && npx node-gyp rebuild;
```
`rgb()` and `rgba()` are supposed to have identical grammar and behavior: https://www.w3.org/TR/css-color-4/#rgb-functions.

Fixes #2029
v9 dropped Node.js v10 support.
The WPT tests for this now pass. See issue for test content; I think it makes more sense to land the WPT tests than to copy individual ones into the node-canvas tests.

Fixes #2055
Borrowed from Chromium instead of reinventing the wheel. Firefox's is similar: https://searchfox.org/mozilla-central/source/gfx/2d/PathHelpers.h#127

Fixes #1736
Fixes #1808
* Adds deregisterAllFonts to the typescript declaration file

* updates changelog with deregisterAllFonts type fix
https://developer.chrome.com/blog/canvas2d/#round-rect

WPT tests:
    326 passing (1s)
    9 pending
    129 failing (down from 179)
This bug goes back 10 years to the original implementation.

Fixes #1909
agilgur5 and others added 22 commits March 29, 2025 16:26
This installation error on Node 22.14+:
```
npm error prebuild-install warn This package does not support N-API version undefined
npm error prebuild-install warn install No prebuilt binaries found (target=undefined runtime=napi arch=x64 libc= platform=linux)
```

is resolved by updating to newer `prebuild-install` 7.1.3, which has a newer version of `napi-build-utils` (2.0.0) with a bugfix for newer N-API version comparison
Claude found it right away

Fixes #2490
* fix(TextMetrics): rtl direction + start/end textAlign
* changelog
* update tests
* expose resolveTextAlignment
* jest test
A little kludgey to force 2 calls in canvas.cc but 2 calls are
necessary when changing size anyways, so it's the more general
usage. TODO remove backends anyways

Fixes #2514
0. Most importantly this fixes the dumb mistake I made in the
   previous commit: not all backends implemented destroySurface.
1. Both Backend and Pdf/SvgBackend were cleaning up memory on exit.
   This responsibility should not be unclear; let's just do it all
   in the child class, since PdfBackend and SvgBackend have other
   stuff to cleanup. This is all still less code.
2. The only reason to destroy the surface is if it's dirty from
   e.g. setWidth (this is referring to isSurfaceValid)
3. Make createSurface idempotent. This allows us to merge it with
   getSurface() and makes it safer. Call it ensureSurface.
Regressed in 3dca82a

This was originally added in
cfc6dfd, but I don't think that
assessment is right at least for the current bug: cairo_destroy,
called after the backend's SetWidth, still holds a reference
to the surface and calls the closure (presumably for leading
<svg> or something?).

I can't get it to happen consistently enough to write a test,
sadly.

Fixes #2520
compiles to the same thing before/after at any optimization level
Co-authored-by: Caleb Hearon <caleb@chearon.net>
Description:
- To handle non-string/non-Buffer sources while fetching image.
- Add test cases for '', null, and undefined inputs to loadImage()

Test Result:
```
npm run test
...
      ✔ rejects when loadImage is called with null
      ✔ rejects when loadImage is called with undefined
      ✔ rejects when loadImage is called with empty string

  291 passing (302ms)
  6 pending
```
As per the GCC 15 porting guide, section "Header dependency changes": https://gcc.gnu.org/gcc-15/porting_to.html#header-dep-changes

> Some C++ Standard Library headers have been changed to no longer include other headers that were being used internally by the library. As such, C++ programs that used standard library components without including the right headers will no longer compile.
>
> In particular, the following headers are used less widely within libstdc++ and may need to be included explicitly when compiling with GCC 15:
>
> `<stdint.h>` (for `int8_t`, `int32_t` etc.) and `<cstdint>` (for `std::int8_t`, `std::int32_t` etc.)
> `<ostream>` (for `std::endl`, `std::flush` etc.)

`<cstdint>` must now be explicitly included to use these types and was missing from `CharData.h`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.