Account for the Firefox font size quantization in the text layer - #21810
Account for the Firefox font size quantization in the text layer#21810calixteman wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #21810 +/- ##
=======================================
Coverage 90.20% 90.20%
=======================================
Files 264 264
Lines 67322 67329 +7
=======================================
+ Hits 60729 60736 +7
Misses 6593 6593
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
8f6f3ed to
cb79d37
Compare
timvandermeij
left a comment
There was a problem hiding this comment.
r=me, with passing browser tests. Thanks!
|
/botio browsertest |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @calixteman received. Current queue size: 1 Live output at: http://54.193.163.58:8877/e6305afdc9d9f99/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @calixteman received. Current queue size: 1 Live output at: http://54.241.84.105:8877/0112093346dfb1d/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/0112093346dfb1d/output.txt Total script time: 18.10 mins
Image differences available at: http://54.241.84.105:8877/0112093346dfb1d/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/e6305afdc9d9f99/output.txt Total script time: 23.39 mins
Image differences available at: http://54.193.163.58:8877/e6305afdc9d9f99/reftest-analyzer.html#web=eq.log |
Firefox rounds the font size set on a canvas 2d context, once divided by the device pixel ratio, to 7 bits of precision. Hence `measureText` can return a width up to ~1% off the one the spans are laid out with, which made `--scale-x` slightly wrong in a zoom dependent way. Measure with a size left untouched by that rounding and rescale the returned width, which is linear in the font size.
cb79d37 to
1ad823c
Compare
|
/botio browsertest |
From: Bot.io (Linux m4)ReceivedCommand cmd_browsertest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/385709e28bf0a93/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_browsertest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/5fa67fe83411386/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/385709e28bf0a93/output.txt Total script time: 18.12 mins
Image differences available at: http://54.241.84.105:8877/385709e28bf0a93/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/5fa67fe83411386/output.txt Total script time: 23.19 mins
Image differences available at: http://54.193.163.58:8877/5fa67fe83411386/reftest-analyzer.html#web=eq.log |
Firefox rounds the font size set on a canvas 2d context, once divided by the device pixel ratio, to 7 bits of precision. Hence
measureTextcan return a width up to ~1% off the one the spans are laid out with, which made--scale-xslightly wrong in a zoom dependent way. Measure with a size left untouched by that rounding and rescale the returned width, which is linear in the font size.