Re: Suggestion: A new text attribute to scale the size of text to follow the size of a box

On Apr 30, 2010, at 8:52 AM, Tab Atkins Jr. wrote:

> On Fri, Apr 30, 2010 at 7:17 AM, Bert Bos <bert@w3.org> wrote:
>> Another is to minimize the number of lines, i.e., rather make the text a
>> bit smaller (up to the minimum font size) than add extra line breaks.
> 
> Alternately, forget about scaling text down at all.  Just do linebreak
> calculations like normal, then always scale up to make it fit.
> 
> We'd actually still have to do some downscaling in the case that an
> unwrappable portion is too long, but we could always prefer scaling up
> to fit first.
> 
> I think this would address the use-case of newspaper headlines in
> narrow columns.  You just set a reasonable font-size, and then things
> automatically grow slightly when necessary.

I like this idea. It works more like how regular justification works. And if you want a particular line in larger type, you can add a line break (or span with a bigger font-size).

>> Based on that last option, we considered allowing automatic font sizes
>> *only* on the last line of a block of text, where last line is every
>> line before a forced line break. Hence the keyword 'size' on
>> the 'text-align-last' property. (In the most recent draft, that keyword
>> was again dropped, because of these open issues.)
> 
> This would be acceptable to me if we can't come up with anything else.

I think that would be very strange, typographically, to have several lines in one size and then a huge last line if its a two letter word or nearly the same size if it is nearly a full width line anyway. I don't think it is elegant to say that a line in the middle is a last line because of a BR. That seems rather hackish.


> I think, though, that the only real use-cases are:
> 
> 1) newspaper headlines
> 2) movie posters
> 3) last lines of paragraphs
> 4) single lines of text

For single lines of text, I would prefer something like 'font-size:fit'. The terms better represents the intent of the author. 

If you are going to be manually inserting line breaks (#1 & #2), then 'font-size:fit' and text-align:justify' and 'text-align-last:justify' would do it, without a new property. #3 is just plain weird, IMO.

Received on Friday, 30 April 2010 16:52:30 UTC