New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 826129 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

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
 
reupload the test.html
test.html
925 bytes View Download
Labels: Needs-Milestone
Labels: Triaged-ET Needs-Feedback
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!

826129.mp4
1.8 MB View Download
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.
test.mp4
6.2 MB View Download
Project Member

Comment 5 by sheriffbot@chromium.org, Apr 9 2018

Cc: viswa.karala@chromium.org
Labels: -Needs-Feedback
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
Labels: Needs-Feedback
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!
826129.mp4
627 KB View Download
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.
test.mp4
6.6 MB View Download
Project Member

Comment 8 by sheriffbot@chromium.org, Apr 23 2018

Labels: -Needs-Feedback
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
Cc: phanindra.mandapaka@chromium.org
Labels: M-68 FoundIn-68 Target-68
Status: Untriaged (was: Unconfirmed)
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!

Comment 10 by junov@chromium.org, 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.
Owner: junov@chromium.org
Status: WontFix (was: Untriaged)
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