This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 10926 - fillText or strokeText behavior needs to preserve readability of text when using maxWidth
Summary: fillText or strokeText behavior needs to preserve readability of text when us...
Status: RESOLVED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML Canvas 2D Context (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-01 00:44 UTC by Jatinder Mann [MSFT]
Modified: 2010-10-05 12:58 UTC (History)
5 users (show)

See Also:


Attachments

Description Jatinder Mann [MSFT] 2010-10-01 00:44:48 UTC
Section 11 Text of the spec states:

"5.If the maxWidth argument was specified and the hypothetical width of the inline box in the hypothetical line box is greater than maxWidth CSS pixels, then change font to have a more condensed font (if one is available or if a reasonably readable one can be synthesized by applying a horizontal scale factor to the font) or a smaller font, and return to the previous step."

Currently the way the spec is defined, readability of text is difficult in the above situation. Further, the text reasonably readable is not very precise. Consider the following code:

ctx.font = '1000px Arial';
ctx.fillText("HTML5 Canvas 2D Context", 0, 300, 450);

IE and Firefox follow the spec, and the text is quite unreadable. Chrome and Safari do not implement maxWidth. Opera, however, renders the text at the font size that will fit in the maxWidth without scaling.

Operas implementation here seems to make most sense  as it is readable. This text should be updated like so:

"5.If the maxWidth argument was specified and the hypothetical width of the inline box in the hypothetical line box is greater than maxWidth CSS pixels, then change font size to a size that will fit in the maxWidth width without scaling the font, and return to the previous step."
Comment 1 Anne 2010-10-01 07:41:27 UTC
Isn't changing the font size the same as using a smaller font?
Comment 2 Ian 'Hixie' Hickson 2010-10-04 23:09:06 UTC
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:
   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: no spec change
Rationale: The spec currently allows either condensing or shrinking the text (or both, actually). I don't see why requiring that the text only be shrunk would be better. In fact, it seems like it would be worse -- in edge cases, it looks better just to condense the font than to shrink it. This is a quality of implementation issue.