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

Re: FW: Proposal: text-vertical-position property

From: Ben Cotterell <ben.cotterell@antplc.com>
Date: Sun, 27 Jan 2008 10:20:58 +0000
To: W3C Style List <www-style@w3.org>
Message-ID: <f21445d6199b6d167fd53213c3244aec3c2620e5@localhost>

On Sat, Jan 26, 2008 at 08:44:35PM -0800, David Perrell wrote:
> "User agents center glyphs vertically in an inline box, adding half-leading
> on the top and bottom. For example, if a piece of text is '12px' high and
> the 'line-height' value is '14px', 2pxs of extra space should be added: 1px
> above and 1px below the letters."
> Half-leading is added to (or subtracted from if line-height is less than the
> height of the font) the *inline box*.

Yes. I thought you wanted to centre inline boxes without altering their
dimensions (i.e. leaving that fairly arbitrary as 10.6.1 does at the
moment). The only way to do that without glyphs overflowing their inline
boxes would be to redefine their "centre"s and add different amounts of
leading above and below.

> | 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.
> No. (My original proposal needs editing; I'll repost it after some work.)
> What I am proposing is a means to specify a subset of a font's character
> set - or an arbitrary offset from the font's baseline - to be
> vertically-centered in the inline box . Though I didn't know it at the time,
> I'm not alone in thinking this is a good thing. From 10.6.1:
> "Note: level 3 of CSS will probably include a property to select which
> measure of the font is used for the content height."
> I've been referring to the inline box rather than content height, but I
> believe the intent is the same.

I actually almost suggested that a property to set exactly how inline
box height was calculated would be another way to achieve what you want.

All the same I still think it's going to be difficult for many
implementations to get information like cap-height out of the font.

I also don't think you want to encourage glyphs to overflow inline
boxes, because that looks bad if the inline boxes have backgrounds or

You could say the various new properties define inline box height by
setting its vertical midpoint with the added constraints that the inline
box extends up and down equal distances from that midpoint by the
minimum amount necessary to enclose the font bbox.

This would mean that for some values of text-vertical-position, the
inline box will extend above or below the font bbox by a bit.

Ben Cotterell
Senior Software Engineer, ANT Software Limited
Received on Sunday, 27 January 2008 10:21:20 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:33 UTC