Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output and measureText differences between 2.6.0 and 2.6.1 #1553

Open
robhogan opened this issue Apr 13, 2020 · 1 comment
Open

Output and measureText differences between 2.6.0 and 2.6.1 #1553

robhogan opened this issue Apr 13, 2020 · 1 comment

Comments

@robhogan
Copy link

robhogan commented Apr 13, 2020

Issue

I noticed due to some failing regression tests on a project I'm working on that there are some very subtle differences between 2.6.0 and 2.6.1.

It seems measureText now gives a different result. With 28px Noto Sans, ctx.measureText("by Joe Bloggs") returns 176.65234375 on 2.6.0 and 175 on 2.6.1. (indeed all measureText results now appear to be integers, but they're not a simple rounding as this example shows).

In this case the rendered result seems to be identical despite the different measure. However, we also use measureText for wrapping, and so in some cases text now wraps differently than it did under 2.6.0.

Something also seems to have changed in PNG output - the byte sizes are now slightly smaller for identical images in my tests, using the same output settings.

I'm using prebuilt binaries (not building from source) - could this be down to these being built against different dependency versions? Should that be expected (is there any way to pin external build dependencies?)

Steps to Reproduce

Happy to update this with a repro case if it's regarded as unexpected

Environment

  • Version of node-canvas 2.6.0 vs 2.6.1
  • Environment: node 10.16 on macOS 10.15.3:
@zbjornson
Copy link
Collaborator

I don't see anything that changed between 2.6.0 and 2.6.1 that would cause this, so my guess is on a dependency also. @chearon might remember if a dependency was updated. You might try npm install canvas --build-from-source (I don't think yarn forwards that flag) as a troubleshooting measure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants