Re: CSS character width unit missing: an oversight, methinks?

At 22:50 07/12/1999 +0100, Bert Bos wrote:
>> In the Mozilla engine you can use the 'ch' unit. ie:
<snip>
>> I believe this has been proposed (at least informally) for CSS3. You can
>> take this as a formal proposal if you want...
>
>Yes, it has been proposed, but never in enough detail. What is clear
>is that there are two reasons for wanting this unit:
>
>   1. styling monospace text (including TTY and ideographs)
>   2. styling braille
>
>What is not clear is how to define the unit.

I think this unit is definitely needed, and would be of great help.


>If the font is monospaced, then 'ch' has an obvious definition, at
>least for horizontal distances. But the question is what the fallback
>is if 'ch' is used for vertical distances, or for elements with a
>proportional font:
>
>   a. it is an error and the declaration is ignored
>   b. ch is (arbitrarily) defined as 0.5em
>   c. ch is defined as the average width over certain (all?) glyphs
>   d. ch is defined as the width of a normal space
>   e. ch is defined as the width of a full-width ideograph
>   f. combination of the above (with conflict resolution rules)

For vertical measures, would it make sense to use ex value ? or the
bounding box size ?

And for horizontal ones, I know it may be far fetched, but could it be
possible to specify it as:
- if the content has more characters than the specified n ch size, give it
the width of the n first characters
- otherwise, approximate using one of the above rules


>If we take c-e, should the (actual) value of 'letter-spacing' be
>included in 'ch'? (Leads to cycle if somebody sets 'letter-spacing:
>0.5ch'...) That would make setting certain styles of Japanese easier,
>since Japanese typography likes to specify line lengths in units of
>character cells.

And it would imho make for less surprise. If I set the width to 80ch, then
whatever value I give for letter-spacing I'd expect to fit 80 characters on
a line. Especially if it's a monospaced font.



.Robin
You can tune a piano, but you can't tuna fish.

Received on Wednesday, 8 December 1999 01:03:35 UTC