Re: Proposal: font-size: auto

David Woolley wrote:
>
>
> Windy Road wrote:
>
> > I would like to propose a new "auto" value for the "font-size"
> > property.  When set the broswer would try to automatically set the
> > font-size, based on the element width, margins and padding ( (e.g.
> > width: 50em; margin: 1em; padding: 1em).
>
> em is defined in terms of the (new) font size!!


Yes.  That's the point. It wouldn't make sense to have width 400px and
font-size:auto ad it leaves no way for a browser to calculate a correct
font-size.

This is likely to result in very small fonts


How so? Just say you have a browser window, which is 1024px across.  If the
properties above were applied to the body, the width of the body (including
the margins) would be 54em, resulting in a font size of  ~ 19px.  At a width
of 800px, the font-size would be ~ 15px and at 640px it would be ~12px.  In
the example I provided, the text is actually more readable on large/high
resolution displays because it can take advantage of the available space by
increasing the font size accordingly (my mum still uses 800 x 600 because
the fonts become too small when she increases the resolution).

, which will increase the
> number of people turning off author font sizing, if not also accompanied
> by a minimum font size.


There is no reason why "font-size: auto" should not respect the minimum font
size set in the browser preferences.  The demonstration does this and simple
scrolls horizontally when the browser window is reduced to the point where
the calculated font size is less than the minimum.

  The minimum font size will mean that you cannot
> rely on the content fitting the container.


So if the  calculated font size is say 3px and the minimum is  8px, then the
font size would be 8px.  If the size of the element is specified using font
relative measurements (I don't see how font-size: auto could work
otherwise), then that should be relative to 8px, not 3px.

As you know, I'm new here, so I'm probably using all the wrong terminology.
To get a proper understanding of what I'm suggesting, please have a look at
(with javascript enabled):

http://windyroad.org/static/resolution-independence/

Like many recent proposals, it is incompatible with incremental
> rendering (whilst noting that some accepted proposals are also
> incompatible).


I don't know much about how browsers perform incremental rendering, so
please excuse my ignorance. How would an element would font-size: auto be
different to a block element with no width specified?  In both cases, the
width is determined by the parent, it's just with font-size:auto the
font-size is determined by that same width.

Overall, my feeling is that this is a page description language feature,
> where layout is much more fixed than authors  should reasonably expect
> for HTML/CSS.


I don't expect the layout of (X)HTML/CSS to be as precise as PDL, but I also
don't think it hurts try try to give authors more control over their pages.
I think the smattering or flash based websites are exactly that, a cry for
more control.

Cheers,

-- 
Tom Howard
http://windyroad.org

Received on Monday, 4 June 2007 13:14:43 UTC