set CanvasRenderingContext2D.font fontSize < 12px when canvasElement not on the DOM tree
Reported by
s.q.chen...@gmail.com,
Mar 27 2018
|
||||||||
Issue description
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
Steps to reproduce the problem:
1. create a canvasElement
let canvas = document.createElement('canvas'))
2. set canvas size
canvas.width = 100
canvas.height = 100
3. get the CanvasRenderingContext2D
let ctx = canvas.getContext('2d'))
4. set font
ctx.font = "8px Arial"
5. draw ctx.font text in canvas
ctx.fillText(ctx.font, 0, 50)
6. append canvas to body
document.body.appendChild(canvas)
What is the expected behavior?
there is "12px Arial" in the canvas and it's size is 12px
What went wrong?
the text sould be "8px Arial" and size is 8px, but get 12px
Did this work before? N/A
Does this work in other browsers? N/A
Chrome version: 63.0.3239.132 Channel: n/a
OS Version: 10.0
Flash Version:
this problem only hapend with the fontSize < 12px
,
Mar 27 2018
,
Apr 9 2018
Tested the issue on chrome reported version 63.0.3239.132 using Windows-10 with steps mentioned below: 1) Launched chrome reported version, dragged and dropped the file provided in comment# 1 2) Able to see "8px Arial", under Devtools > body section, observed margin: 8px @Reporter: Please find the attached screen cast for your reference and let us know if we missed anything in verifying the issue, if possible could you please provide the screen shot of excepted behaviour of the issue which helps in further triagign it. Thanks!
,
Apr 9 2018
Sorry, I have upgraded Chrome to 65.0.3325.146, but this problem will still happen. I asked my friends, some of them will happen, some will not.
,
Apr 9 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 11 2018
Unable to reproduce the issue on chrome reported version 63.0.3239.132 & latest stable 65.0.3325.181 using Windows-10 with steps mentioned below: 1) Launched chrome reported version, dragged and dropped the file provided in comment# 1 2) Able to see "8px Arial", under Devtools > body section, observed margin: 8px @Reporter: Please find the attached screen cast for your reference, try to test this issue by creating a new person with no apps and extensions in it and you can also check on latest chrome stable and let us know if the issue still persists. You can download latest chrome stable from URL: https://www.chromium.org/getting-involved/dev-channel Thanks!
,
Apr 23 2018
Hi, I tried to upgrade chrome to 66.0.3359.117, but the problem still exists. And I tried to uninstall all the extensions, but still not. Today, I suddenly found out that switching my chrome language to English, this problem was disappeared, but switching to Simplified Chinese would not work. Will the problem lie in this? See my video for details.
,
Apr 23 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 24 2018
Able to reproduce this issue on reported version 66.0.3359.117 and also on latest chrome 68.0.3404.0 using Ubuntu 14.04, Windows 10. Similar behavior is observed on older version 61.0.3163.71 as well. Issue is reproducible on changing the language to Simplified Chinese and observed that displaying both ""12px Arial and 8px Triaging this as a non-regression issue and marking it as untriaged. Thanks!
,
Apr 24 2018
This is a browser setting interfering with the content. You will see a setting for minimum font size if you navigate to: chrome://settings/fonts The default value for this setting depends on you language setting. The reasoning is that Chinese, Korean and Japanese character may not be legible if printed too small. The rationale for this behavior is that web sites not designed with these languages in mind should still be usable when displaying text that was possibly entered by the user. We could make the argument that the minimum font size setting should not apply to 2D canvas, but I am not sure whether that is a good idea. Another possibility is for your web page to hack around this restriction by using a large font size and scaling it down by calling ctx.scale() on the 2D rendering context.
,
May 7 2018
Closing this issue because the browser is technically working as intended. If you are not able to find a good workaround for your application, please let us know and we can re-open this bug. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by s.q.chen...@gmail.com
, Mar 27 2018925 bytes
925 bytes View Download