Re: [css-inline] i18n-ISSUE-408: Boxed characters and initial letter properties

> On 11 Feb 2015, at 01:29, Richard Ishida <ishida@w3.org> wrote:
> 
> hi Florian,

Hi Richard,

> One concern I have is related to handling of combining marks and ensuring that they are neatly tucked in with the area that remains after padding. Firefox's implementation of box-sizing doesn't do a good job of getting these inside the box.

box-sizing in firefox isn't currently combined with initial-letter, so it sizes the content box in the traditional way, not in the glyph-fitting way that is needed for initial letter.

> What concerned me was that the combining characters leaked outside the box.  I think that one could add enough padding to avoid this, but it is a messy job for an author, and may require different settings for each initial-letter (not all have combining characters).  With my  author hat on, i'd just want to say 'make it all fit', and have combining character accounted for too. I think we'd need to fix that.
> 
> Note also that there is a gap in the English example where the beard of the type is empty (because there's no descender).

We need to define the content box to be the bounding box of the glyph, otherwise, it will not "just work". To account for combining characters, empty beard, etc, we would have to make it the physical bounding box of the grapheme cluster, not the one defined in the font for the character.

Unlike the music typesetting software mentioned by Arle, since we're only typesetting a single character this way, rather than entire lines, I don't think this will look ugly, but rather think it actually is the only reasonable thing to do, assuming the the concerns with regards to speed or complexity of implementation do not turn out to be blocking issues.


As an aside, we've discussed this topic some more at the CSS Sydney F2F (on and off record), and came to the conclusion that while the values 'content-box' 'padding-box' and 'border-box' were indeed what we needed, reusing the box-sizing property to trigger all this was problematic. It's usual purpose is different and authors who set it to handle other parts of their page may not expect it to have any effect on initial letters. Also, it is inherited, which is not appropriate here.

What we plan to do instead is to add these values to the initial-letter-align property, resulting in something like this:

Name: initial-letter-align
Value: [ auto | alphabetic | hanging | ideographic ] || [ content-box | padding-box | border-box ]
Initial: auto content-box

When the *-box part is omitted, content-box is implied; when the baseline part is missing, auto is implied.

 - Florian

Received on Tuesday, 17 February 2015 08:45:48 UTC