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: Thu, 24 Jan 2008 17:51:02 +0000
To: www-style@w3.org
Message-ID: <a2f72587b531ae11da23cde81e222d4455a5806a@localhost>

On Wed, Jan 23, 2008 at 09:36:28PM -0800, David Perrell wrote:
> 
> 'text-vertical-position'
>     Value:          bbox | xheight | capheight | ascdesc | <length>
>     Initial:        bbox
>     Applies to:     block-level, table-cell, table-caption or inline-block elements
>     Inherited:      no
>     Percentages:    N/A
>     Media:          visual
>     Computed value: for <length> the absolute value; otherwise as specified
> 
> This property specifies the vertical position of text in line boxes within the element.
> 
> Values have the following meanings:
> 
> bbox
>     Align the midpoint between the top and bottom of the font's
>     bounding box with the vertical midpoint of the line box.
> 
> xheight
>     Align the vertical midpoint of lower case letters with the
>     vertical midpoint of the line box.
> 
> capheight
>     Align the vertical midpoint of upper case letters with the
>     vertical midpoint of the line box.
> 
> ascdesc
>     Align the midpoint between the font's ascender top and descender
>     bottom with the vertical midpoint of the line box.
> 
> <length>
>     Align a point above the font's baseline (positive values), below
>     the font's baseline (negative values), or the baseline itself
>     (zero), with the vertical midpoint of the line box.

I think this is really what vertical-align is already for.  More values
for vertical-align (various flavours of "middle"), in conjunction with a
tighter definition of how inline box heights are calculated, might be a
way to achieve this.

But the biggest practical problem is going to be getting the information
out of the font. Fonts just don't tell you things like the heights of
capital as opposed to lowercase letters.

-- 
Ben Cotterell
Senior Software Engineer, ANT Software Limited
Received on Thursday, 24 January 2008 17:51:18 GMT

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