Re: scale: font-size to % of client window?

[Thu, 11 Jul 2002 07:18:04 +0000] jonathan chetwynd:
>Is it possible to scale font-size to % of client window size?
>
>as for instance : img {width: 15%} does for images
>
>This might ensure that a defined text remains visible, for instance a 
>virtual keyboard.
>(can users over-ride this?)
>
>If this is not possible, has it been considered?

I'm going to chime in here, because this one "hits home" with me.
In particular, I think it demonstrates one of the fundamental things
that is "wrong" (in my opinion, obviously) with current thinking
about the languages in which we must express web page designs.

Note that the problem is:
     Ensure that a defined text remains visible.
and yet the suggested solution asks the designer to guess at text-length
calculations: a task for which the client software is far better suited.

There are many ways a "percentage font size" might fail to accomplish its
intent when rendered by a particular user agent on a particular platform.

How come no one thinks of solving the problem in its own terms?
For example, suppose we had this construction:

     DIV.bigchart {white-space: nowrap; font-size: fit(13px,x-large)}

which would mean the user agent should choose a computed value for the
font-size which:
     1.  Is at least 13px.
     2. Is no larger than the computed value corresponding to x-large.
     3. Within those constraints, is as large as possible without causing
        any of the content to overflow the content area of the element.

Then you could write what you mean, instead of guessing at what might work.

Early HTML was directed at the *logic* of document structure.  Then along
came presentational HTML; then we tried to rectify the mess that made by
moving the presentational control to CSS.  Unfortunately (in my opinion),
this misses the more important point: that presentational *logic* is poorly
represented by HTML *or* CSS.  It's easy to be a "pixel engineer," but
that's exactly what should be discouraged.  Web authors need a language
that describes the *logic* of presentation, not the details (which, as in
early HTML, are better left to the user agent).  This would place a lot of
additional burden on user agents; but if it could be done, it would enable
us to write web pages that are *really* inter-operable, without arcane and
unreliable dependencies on fonts, screen sizes and resolutions, etc.
-- 
Randall Joseph Fellmy aka Randy@Coises.com

Received on Thursday, 11 July 2002 23:41:26 UTC