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

[css4-fonts] font-size: auto

From: Christoph Päper <christoph.paeper@crissov.de>
Date: Wed, 15 Feb 2012 12:43:40 +0100
Message-Id: <119109D8-E485-4C89-96D2-BA7B98CC617F@crissov.de>
To: www-style list <www-style@w3.org>
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.
Received on Wednesday, 15 February 2012 11:44:09 UTC

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