W3C home > Mailing lists > Public > www-style@w3.org > January 2008

Re: Proposal: text-vertical-position property

From: Ben Cotterell <ben.cotterell@antplc.com>
Date: Sun, 27 Jan 2008 00:19:30 +0000
To: www-style@w3.org
Message-ID: <ddd48a2fb3335e9da2a14c596390f0f398de6377@localhost>

On Fri, Jan 25, 2008 at 09:32:43AM -0800, David Perrell wrote:
> 
> Ben Cotterell wrote:
> 
> | An inline box has a baseline, ascent, descent, x-height etc. Those
> | reference points are used to align child inline boxes within it
> | depending on the child inline boxes' values of vertical-align.
> 
> The position of the baseline, etc., depend on the font and the
> y-coordinate within the font that is used to position the text
> relative to the vertical center of the inline box.

When is text ever positioned relative to the vertical centre of an
inline box?

Perhaps you mean line box. Text gets vertically centered in a line box
because leading is divided in two and applied equally above and below.
So which vertical pixel of the inline box ends up at the line box
midpoint depends on how the top and bottom edges of the inline box
relate to the font.

> Currently, that y-coordinate is a point halfway between the top and
> bottom y-coordinates of the font's bounding box. I contend that
> authors should be able to specify the relative position of that
> y-coordinate.

If you can set a height there's a bit of room for things to move around,
and so setting the position starts to make more sense.

[...]
> | ...
> | If you had a property to align text in inline boxes, then I think you
> | would also need to tighten the definition of inline box height (10.6.1),
> | and probably to allow height or min-height to be set on them.
> 
> The vertical position of the text within the inline box does not affect the
> height of the inline box.

Well wouldn't the text then have a possibility of overflowing the inline
box?

If you had a background-color or an outline etc. on your inline boxes it
wouldn't look good if the text spilled out of them.

> How would allowing authors to change that position necessitate
> tightening definitions or changing allowances?

Well I thought the idea was you'd achieve the effect something like
this:

    <span style="height: 100px; text-vertical-position: bbox"> ...

having changed the rules to allow height to be set on inline boxes.

But looking back at your original suggestion, I think I see now more
what you mean. You want to change the reference point used for centering
inline boxes in a line.

So you don't want to actually _move_ the text relative to the inline
box, you just want to redefine where its vertical midpoint is, so as to
affect the position of the inline box in the line box.

This would therefore have to cause leading not to be divided exactly in
half as it as at the moment, but to be divided between top and bottom in
whatever ratio was necessary to keep the author-defined midpoint in the
centre of the line box.

-- 
Ben Cotterell
Senior Software Engineer, ANT Software Limited
Received on Sunday, 27 January 2008 00:19:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:00 GMT