Canvas fontKerning style ignored on un-parented canvas
Reported by
sam.thom...@gmail.com,
Aug 3 2016
|
||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36 Steps to reproduce the problem: 1. http://jsfiddle.net/uoxd41m4/3/ 2. Note that the kerning is on for the top row of text, despite it being turned off. What is the expected behavior? Neither row of text should have kerning. What went wrong? Setting "font-kerning: none" did not apply on the canvas that was not already in the document body, so when it was blitted over it looks different than the one rendered directly on the main canvas. Did this work before? N/A Chrome version: 51.0.2704.103 Channel: n/a OS Version: OS X 10.11.6 Flash Version: Shockwave Flash 22.0 r0
,
Aug 4 2016
The behavior you are observing is spec compliant, if I am not mistaken. For style to get computed for a given element, the element has to be part of a style cascade. I think what you would want for this case is a fontKerning attribute to CanvasRenderingContext2D. You could request that feature by filing an issue here: https://github.com/whatwg/html/issues In the meantime, you can hack it. To draw text into a canvas that is not displayed but still parented to the document, you can place the canvas at a negative y position, far beyond the top of the document. |
||
►
Sign in to add a comment |
||
Comment 1 by durga.behera@chromium.org
, Aug 4 2016Components: Blink>Canvas
Labels: Needs-Feedback
152 KB
152 KB View Download