Automattic / Automattic/node-canvas

Output and measureText differences between 2.6.0 and 2.6.1

Open
#1,553 1 comment 0 reactions 0 assignees View on GitHub
Text & Fonts
Dominant language
JavaScript
Stars
10.7k
Forks
1.2k
Avg merge
4d 8h
Merged PRs (30d)
1

Description

## 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:

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.