-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
measureText resulting integer in CentOS 6 #472
Comments
@i2joseph it'd be great if you could boil this down into a test case that passes on the correct behaviour, then it'd be easier to verify and fix and protect against regressions. |
@i2joseph have a look in canvas.test.js, search for @kangax do you have any input on the proper way to assert that the values coming out of here are appropriate? |
@rvagg I haven't found a good way yet. Same issue in Fabric; values could be slightly different depending on a system. |
Looking at src/CanvasRenderingContext2d.cc I think this is more likely due to whether you have Pango enabled or not (rather than OSX vs Linux/CentOS). For Pango the following is used: Reading the Pango docs (https://developer.gnome.org/pango/stable/pango-Glyph-Storage.html#PangoRectangle) I can't see how to get this to be more precise :( |
Tried this:
... but even when using get_extents instead of get_pixel_extents the logical_rect.width is still divisible by PANGO_UNITS (which is 1024). |
Should be fixed in 2.x since Pango is required (and in 2bbfec5)? |
Hi,
The measureText method is resulting integer in CentOS 6. Is there a way to solve this problem? THANKS.
Here is the comparison result between CentOS and Mac OS X 10.8
Result from CentOS:
{ width: 25,
actualBoundingBoxLeft: 1,
actualBoundingBoxRight: 24,
actualBoundingBoxAscent: 8,
actualBoundingBoxDescent: 0,
emHeightAscent: 11,
emHeightDescent: 3,
alphabeticBaseline: 0 }
Result from Mac OS X 10.8:
{ width: 24.005859375,
actualBoundingBoxLeft: 0.017578125,
actualBoundingBoxRight: 23.162109375,
actualBoundingBoxAscent: 8.58984375,
actualBoundingBoxDescent: 0.140625,
emHeightAscent: 10.86328125,
emHeightDescent: 2.54296875,
alphabeticBaseline: 0 }
The text was updated successfully, but these errors were encountered: