- From: Ian Hickson <ian@hixie.ch>
- Date: Thu, 15 Dec 2011 23:45:07 +0000 (UTC)
On Thu, 12 May 2011, Charles Pritchard wrote: > > > > Their intent is to ensure that when you have a specific amount of > > space in which text has to fit, and you don't know exactly what that > > space is or you don't know exactly what the text is, you can easily > > work around minor cases of limited space. For example, I use it on the > > issues chart: > > There's no guarantee of legibility There's never any guarantee of anything. However, within reason this can maintain legibility. > there's no exposure as to the actual size of the font being used. Indeed typically the text would be squeezed, not made smaler. > It's not (or was not, in the recent past) implemented in many browsers. IE9, Chrome, Opera, and Firefox all seem to implement it. > It serves only minor cases. It's unnecessary. It serves pretty much every time you want to put text on a label and are pretty sure it'll fit, but it might go slightly over. > Yes, you can use TextMetrics. So why have this added bloat? Convenience. This is a trivial cost for significant convenience. > Most of your philosophy regarding the Canvas API has been to keep out > unnecessary and unimplemented items. I don't see how this one is any > different. It changes multiple lines of code which most authors wouldn't write into an additional trivial argument that greatly improves the UI. I think that's a pretty good deal. > If it were intended, to be more useful, I'd want to see it in > measureText as well, so that measureText('string', maxWidth) would > return a font size attribute. We'll be improving measureText's metrics in due course. > Your use case, in your data chart, could quite easily have been written > up without the added attribute. That's why I'm bringing this up. It could have been done, but I probably wouldn't have bothered if it wasn't an extra argument. -- Ian Hickson U+1047E )\._.,--....,'``. fL http://ln.hixie.ch/ U+263A /, _.. \ _\ ;`._ ,. Things that are impossible just take longer. `._.-(,_..'--(,_..'`-.;.'
Received on Thursday, 15 December 2011 15:45:07 UTC