Re: DSSSL

lee@sq.com wrote:
> David Perrell" <davidp@earthlink.net> wrote:
> > A CSS floated SPAN should make drop caps easy.
> 
> No, because you can't get the size right in CSS...

Theoretically you can as long as the specified font is available.
Substitutions will likely knock the alignment off a few pixels.
Difficult to say how bad without a browser that supports floated SPAN
and negative margins on floats.

> The best way to do drop caps is to have a built-in property, e.g.
> P { initial-letter: @drop-cap(lines: 3 font: xxx) }

Or perhaps a more general drop-lines property?

   P:first-letter { drop-lines: 3}
or
   SPAN           { drop-lines: 3; font: xxx; font-size: xx }
?

The drop-lines property would be special 'float' that would:

1. apply the float:left property

2. apply the font-family, font-weight, font-style, and
   font-variant properties as specified

3. compute a new default font-size for the floated element
   such that the cap height equals (parent's cap height)
   + (drop-lines * parent's line-height)

4. apply the font-size property, if given, (percentage values
   would refer to the computed default)

5. adjust the vertical alignment of the floated element, such that
   the baseline of the floated element aligns with the baseline of
   line [drop-lines + 1] in the parent element

6. adjust the default line-height of the float to coincide with
   the bottom of the lowest glyph (in the case of cap letters,
   this should allow the line following line [drop-lines + 1]
   in the parent to begin at the left margin, avoiding the 'hole'
   under the drop cap that would otherwise occur)

Note that a SPAN with drop-lines could be applied to any number of
characters. By specifying that the property determines _default_
font-size and line-height, the author still has the option of
specifying a larger size font (it's not an uncommon drop-cap style to
have the cap significantly taller than the following text) or of
changing the parent's text flow below the element. Also, a negative
left margin could be used to pull the character to the left of the
normal margin (also not an uncommon style)

The most important function of any drop cap property is to align
baselines. Don't force other properties into a specific stylistic
convention.

David Perrell

Received on Monday, 21 April 1997 18:42:08 UTC