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

Re: New CSS1 draft available

From: <lee@sq.com>
Date: Sun, 22 Sep 96 17:47:25 EDT
Message-Id: <9609222147.AA23571@sqrex.sq.com>
To: davidp@earthlink.net, lee@sq.com
Cc: www-style@w3.org

lee@sq.com wrote:
> Note that line height interacts with drop caps.

David Perrell <davidp@earthlink.net> wrote:
> Note that with the current interpretation of line-height, the effective
> line-height of a single line of text is always equal to the font-size.
> In order to get a typical drop cap, where the baseline of the cap lines
> up with the baseline of one of the lines in the main element and the
> following line doesn't wrap, a negative bottom margin is needed
> on the floated 'first-letter'.

It is not possible to use CSS to generte a drop cap properly.  Period.
Forget it.  Unless the spec is changed, you don't have enough information
available to specify a drop cap for anything other than the single screen
you are using at the time, with the fonts you are seeing at that time.

Even with embedded/referenced fonts, you still can't do it.

To get drop caps to look like something other than an amateur's mistake,
you have to do the following:
[1] Align the top (i.e. the cap height) of the drop cap with
    the cap height (not the ascender height) of the first line of text.

[2] Align the baseline of the drop cap with the baseline of the text.

Consider a 3-line drop cap.

The height of the drop cap is emphatically _not_ 3 times the size of
the text.  Neither is it three times the line-height.  The body size
(1) a small gap at the top (depending on the design)
(2) ascender height
(3) cap height
(4) x height
(5) baseline
(6) (underline position)
(7) descender depth
(8) a small gap at the bottom (depending on the design)

    At text sizes in most fonts, the ascender and cap height are the
    same (but look at a good Garamond, for example, where the ascenders
    are taller).

    At display sizes, there's often a difference of several screen pixels.

So, for a 3-line drop cap, we need cap-height to baseline to equal three
times line height (not body size) _minus_ the difference between line
height and cap height at the smaller size.

In CSS, you can't express the drop cap height in those terms.

If you could say
    drop-cap-lines: 3
it'd all be fine, because the browser could do the calculation, as it has
the information available.  I'll even donate some X Windows code if you like,
that uses binary search to find the right font size after an initial guess!
(Quark and other layout programs have sufficient access to font metrics that
they can calculate the size correctly first go)

Please consider either removing drop caps or fixng them; if we have a legacy
of "font-size 57pt" to get a 3-line drop cap with 18 on 21 pt text, no amount
of improvement in browsers won't ever be able to improve the appearance of
such imitation drop caps.

It is no harder to implement drop-cap-lines than the current draft, if you
don't do the cap-height stuff I've talked about, and you get something as
good as with the current method.  But then it can be improved dramatically
with relativelty little extra work.


Liam Quin, SoftQuad Inc    | lq-text freely available Unix text retrieval
lee@sq.com +1 416 544-9000 | FAQs: Metafont fonts, OPEN LOOK UI, OpenWindows
SGML: http://www.sq.com/   | We've moved; new 'phone number & postal address!
The barefoot programmer    | `who is my neighbour?'
Received on Sunday, 22 September 1996 17:47:40 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:41 UTC