David Hyatt (2011-03-16):
> The biggest layout problem affecting iBooks today is one that occurs at the start of most chapters.
If thatâ€™s really the biggest one, CSS is more mature and more ready for e-books than I thought.
> It happens when a larger font is used on a line just to open a chapter, either with a single larger first letter, or with an entire sentence that is capitalized.
If this was the only use case, we should examine it using CSS best practice:
.chapter>p:first-child::first-words(2) {
text-transform: uppercase;
}
.chapter>p:first-child::first-letter {
font-size: xx-large; font-weight: bold;
}
Assuming the necessary properties are specced and implemented, line height behavior should be special-cased for the selectors used above in the user agent style sheet (substituting the one not existing yet with â€˜::first-lineâ€™):
::first-line, ::first-letter {
line-box-contain: glyphs;
}
I also wonder whether it would be helpful to be able to set the line-box/-height in absolute lengths, but using subparts:
::first-line {
text-transform: uppercase;
line-height-ascender: 24px;/* or â€˜autoâ€™ */
line-height-descender: 0;
line-height-accent: 0;
}
Uppercasing text with the â€˜text-transformâ€™ property and other stylings that remove descenders, such as â€˜small-capsâ€™, could even automatically influence such settings.