You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is, those numbers get pulled from Pango. They'll be different across platforms too. I don't think there's anything that could be done about it, would be nice though because I currently have pixel-based tests that fail on Windows for that same reason.
Yeah, as far as I understand it it won't ever be the same on all platforms. I don't think that that is the case for the browser implemented canvas either.
In fact, it's not really supposed to be the same on all platforms since font-rendering isn't done the same on all platforms. I'm not even sure that you want the same font-rendering on all platforms, or if you actually want to match how the OS is rendering fonts.
Anyhow, unfortunately there isn't much we can do about it, and since the web implementation has the same problem I don't think it's worth keeping this issue open. Sorry about that, maybe you can figure out another way do to what you are trying to accomplish?
The following code:
ctx.textAlign='center';
ctx.textBaseLine='middle';
ctx.font=helpers.fontString(this.baseFontSize, 'normal', Base.defaultFontFamily);
ctx.fillStyle=Base.defaultForegroundColor;
var m = ctx.measureText(this.text);
console.log('measured text', this.text, 'm: ', m, 'fontsize:', this.baseFontSize);
produces different output on Ubuntu 15.10 and Ubuntu 14.04.
14.04:
measured text $135 m: { width: 40,
actualBoundingBoxLeft: 20,
actualBoundingBoxRight: 60,
actualBoundingBoxAscent: 6.5,
actualBoundingBoxDescent: 8.5,
emHeightAscent: 9.5,
emHeightDescent: 9.5,
alphabeticBaseline: 5.5 } fontsize: 16
15.10:
measured text $135 m: { width: 40,
actualBoundingBoxLeft: 18,
actualBoundingBoxRight: 20,
actualBoundingBoxAscent: 6.5,
actualBoundingBoxDescent: 8.5,
emHeightAscent: 9.5,
emHeightDescent: 9.5,
alphabeticBaseline: 5.5 } fontsize: 16
node-canvas: 1.3.12
Specifically the difference is the actualBoundingBoxLeft and actualBoundingBoxRight.
I noticed that there were these measureText related issues:
#472
#331
But this one (wrong left right values) has never been mentioned. It could well be another pango difference.
The text was updated successfully, but these errors were encountered: