Open
Bug 660758
Opened 14 years ago
Updated 2 years ago
filled canvas text on transparent background has black bounding box
Categories
(Core :: Graphics: Canvas2D, defect)
Tracking
()
NEW
People
(Reporter: phorgan1, Unassigned)
References
()
Details
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
This:
<BODY >
<canvas id='testcanvas' width='430' height='100'></canvas>
var cvs=document.getElementById('testcanvas');
</body>
<script>
var ctx=cvs.getContext('2d');
ctx.font='50px LMRomanDunh10 serif';
ctx.fillStyle='rgba(25,00,230,1.0)';
ctx.fillText("How's this look?",10,65);
</script>
</html>
makes text that is weird looking. If the fillstyle is black, you'll just see black bounding boxes the size of each individual letter. If the fillstyle contrasts with black, you'll see the black boxes with the letters rendered in them.
Workaround. First, fill the canvas with any opaque color. like:
ctx.fillStyle='rgba(255,255,255,1.0)';
ctx.fillRect(0,0,cvs.width,cvs.height);
Then everything is ok. If you turn down the opacity on the fillstyle for the fill, then the bounding boxes show up, progressively darker as the opacity drops from 1.0 to 0.0
Reproducible: Always
Steps to Reproduce:
1.render filled text into a transparent canvas
2.
3.
Actual Results:
Got text with black bounding boxes.
Expected Results:
Text on the existing background.
On Mozilla IRC #firefox many people tried the test page, and reported back their results. Some people saw the problem, but people on the same operating system with the same version, had different results. We were all trying different about:config settings under gfx, but couldn't figure out anything that made a difference. People with the problem couldn't get rid of it, and people without the problem couldn't reproduce it. Then we all researched existing bugs and although there was one about artifacts with text on a transparent canvas, it was clearly a different bug.
Comment 1•14 years ago
|
||
Mozilla/5.0 (X11; Linux i686; rv:7.0a1) Gecko/20110531 Firefox/7.0a1
Setting resolution to New.
Issue present ever since Firefox 3.6.17
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 2•10 years ago
|
||
Is this fixed?
Updated•2 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•