W3C home > Mailing lists > Public > www-style@w3.org > March 2011

Re: line-height limitations

From: Christoph Päper <christoph.paeper@crissov.de>
Date: Thu, 17 Mar 2011 10:52:42 +0100
Message-Id: <9C6A3078-6F82-4231-B3BA-3D6A56ECE59F@crissov.de>
To: "www-style@w3.org list" <www-style@w3.org>
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.
Received on Thursday, 17 March 2011 09:53:18 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:38 GMT