- From: Bert Bos <bert@w3.org>
- Date: Fri, 15 Apr 2005 11:19:40 +0200
- To: www-style@w3.org
On Thursday 14 April 2005 08:58, Anne van Kesteren wrote: > Matthew Jaggard wrote: > > I have been looking through the CSS2.1 and found that it will not > > do what I am currently wanting (unless I'm blind and/or stupid). > > What I want is to make the text in my document fill the screen (I'm > > using the projection media type at the moment) so if I just have 1 > > letter, it would be huge and if I had a whole essay, it would be > > tiny, etc. It would be useful to be able to specify a maximum and > > minimum font size too and whether it fills the whole page or just > > does it by one line of text. > > CSS3 might introduce a viewport unit which would make that possible. > CSS3 also introduces, as the CR currently reads, 'min-font-size' and > 'max-font-size' in the CSS3 Text module. Correct. The viewport units vw, vh and vm will give you fonts (and other things) whose size is related to the size of the viewport. If you want a font size that isn't only related to the size of the viewport, but also to the length of the text itself, that is also on the agenda: the proposal is to turn this effect on with 'text-align-last: size' and then protect against the font becoming too small or too big by setting 'min-font-size' and 'max-font-size'. It would only resize the text to fill a horizontal space (one line). There is currently no plan to fill a given vertical space. That is more difficult and less often used. Instead, you can put the text in an SVG file and scale that. That wouldn't reflow the text, but it is probably close enough. ('text-align-last' is for the alignment of the last line in a paragraph, which may be different from the other lines. Setting it to 'size' effectively says that the font size of the paragraph is adjusted so that the whole paragraph fits on one line and that line is fully justified. There are some tricky things to work out still, but at least when there are no sub-elements with absolute font-sizes, it should work as described.) But these are long-term plans. Don't expect either vh/vw or min/max-font-size to be fully specified, let alone implemented, within the next twelve months. (Of course, if somebody likes them, implements them experimentally in some browser and writes up precisely what they do, that may speed things up.) Bert -- Bert Bos ( W 3 C ) http://www.w3.org/ http://www.w3.org/people/bos W3C/ERCIM bert@w3.org 2004 Rt des Lucioles / BP 93 +33 (0)4 92 38 76 92 06902 Sophia Antipolis Cedex, France
Received on Friday, 15 April 2005 09:19:47 UTC