W3C home > Mailing lists > Public > www-style@w3.org > September 1996

Re: New CSS1 draft available

From: David Perrell <davidp@earthlink.net>
Date: Mon, 23 Sep 1996 01:44:55 -0700
Message-Id: <199609230846.BAA05927@austria.it.earthlink.net>
To: <lee@sq.com>
Cc: <www-style@w3.org>

lee@sq.com wrote:
> ...
> Er, no, because a PDF file isn't reformatted on the fly at varying
> resolutions.  A PDF file is like a resolution-independent bitmap...
> The drop caps work in PDF because they are aligned exactly in the
> first place.

How do you think elements are aligned? 'PDF' is an acronym, and the
whole point is resolution-independent rendering.
'Resolution-independent bitmap' is an oxymoron.

> ...
> I wanted to avoid the browser (or other agent) not being abe to
process
> the data because it didn't know that the intent was a drop cap; I
didn't
> want to insist on further refinement that might delay implementation.

You work for Netscape, right?

> ...
> But it doesn't work if the user has specified a larger type size --
it
> will just look silly in that case.  Defining it in terms of the
number of
> lines means it will always work.

Maybe 'raise' and 'drop' would be better than height and depth.

Adding lines as a measurement unit certainly works -
'first-letter-drop: 2li'. Percentage values of drop based on line
height of the parent element would work, too. 'first-letter-drop: 100%'
would extend the first-letter's baseline to the baseline of the second
line, 200% to the third, etc.

> ...
> I'm not sure I follow this, but allowing the max of the remainder of
the
> drop cap's depth (basline to bottom of the body) and the
corresponding
> amount on the text line with which the drop cap aligns is probably
sufficient
> for a first draft.  Additional initial-cap properties could be added
later,
> as far as I can tell, as long as you've identified drop caps
properly.

In order to correspond with the current CSS model, a drop cap must be a
floated element. The margin-bottom property of the floated element
should determine at which line the text in the parent element is no
longer displaced by the element's bounding box. A margin-bottom of 0
will cause the bounding box to correspond to the bottom of the cap's
font; this will force one extra line of text to wrap, leaving extra
space immediately below the cap.

> I would press for the minimum change that will make drop caps work,
and
> I think that's to specify the number of lines for them to span and
align.
> It would help impementors if the draft suggested an algorithm or if
it
> could include a diagram.

With the current model, the position of a first-letter's bounding box
will be fixed relative to the top and left margins of the parent
element. The position of the letter itself will be determined by the
top and left margins of the floated element. If the first-letter is
significantly larger than the text in the parent element, positioning
the letter to get the drop cap you describe will require a negative top
margin on the floated element. The algorithm would be an equation to
solve for the first-letter's margin-top and font-size relative to the
parent's font-size and line-height. If you say the parent element is 1,
first-letter element is 2, font size is F, baseline to top-of-font
distance is B, cap height is C, drop distance is D, raise distance is
R, and fontsize/capheight is FC, then first-letter font size F2 = (C1 +
D + R) * FC2. Top margin = C2 - C1 - B2 + B1 - R.

If anyone responsible for the CSS1 spec is interested, I'll diagram it
and put it up as a web page.

BTW, you mention 'removing drop caps" from the spec and refer to
'drop-cap' as if it were itself a pseudo-element. There are no drop
caps in the spec except as an example usage of 'first-letter.'

David Perrell
Received on Monday, 23 September 1996 05:38:48 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:45 GMT