Re: Proposal: font-size: auto

* 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).

I often encounter similar problems and would agree that something should
be added to CSS or at the least the CSS Object Model, to help with this.
However, the problem, at least in my cases, is simply "Here is a box and
text; make the text fill the box and make it look good". Font size is a
factor, but I generally would not mind and often appreciate if spacing,
line height, hyphenation, and other things would similarily be adjusted.

A typical application would be treemaps as http://codecubed.com/map.html
http://www.roomformilk.com/ and http://www.marumushi.com/apps/newsmap/
use them. I am not entirely sure whether this is in line with what you
are trying to solve, your example document basically scales a block as
a whole to fit certain dimensions while preserving the aspect ratio. It
seems your problem is better addressed by a dedicated feature doing just
that. You could, if user agents implemented it, just do it using XHTML+
SVG, going

  <body>
    <svg>
      <foreignObject>
        <div>
          ...

detailing dimensions, scaling, and aspect ratio preservation behavior
on the way.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Wednesday, 6 June 2007 01:19:39 UTC