W3C home > Mailing lists > Public > www-style@w3.org > February 2012

Re: [css4-fonts] font-size: auto

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 15 Feb 2012 13:47:24 -0800
Message-ID: <CAAWBYDCa40O=a5od2RUDhNh9gstvbhaHg8ujKjrvc9aaP2BNaA@mail.gmail.com>
To: Christoph Päper <christoph.paeper@crissov.de>
Cc: www-style list <www-style@w3.org>
On Wed, Feb 15, 2012 at 3:43 AM, Christoph Päper
<christoph.paeper@crissov.de> wrote:
> Sometimes you have a one-line box (or maybe 2 lines of text) with a fixed width and the text within should fill all of this. This could be done with either manually adjusting letter-spacing and word-spacing or with manually increasing the font-size until just before the last word breaks to the next line. This, however, does not work reliably since you can never know which font will be used in the end. For letter and word spacing the automated variant is known as justified text, i.e. “text-align: justify”, but for font sizing there is none.
> Therefore I would like to suggest for level 4 of the Font module to make the ‘font-size’ property accept at least one new keyword, e.g. ‘auto’, ‘line-fill’, ‘width’ or ‘fill-x’, that facilitates the described behavior.
> I’m not sure there are also valid usecases for
> a) shrinking the size until the complete text fits within one line,
> b) increasing the size until the parent box’s height is used to the maximum extent by lines of text,
> so I’m leaving that to level 5 or others to propose. Beware, though, that if these are future things to address ‘auto’ may not be the best choice for the suggested line fill keyword.

I agree that something like this would be really nice for several reasons.

An interesting issue pops up when the element you're filling is itself
content-sized, like a float.

Received on Wednesday, 15 February 2012 21:48:14 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:12 UTC