Re: font-size and accents, again

Todd Fahrner wrote:
> 
> At 2:50 PM -0800 11/18/99, Erik van der Poel wrote:
> >
> >So, given that style sheet authors can use font-size to specify the
> >"em", and given that some glyphs overflow their em, how can these
> >authors ensure that lines of text will not overlap each other?
> 
> They can't, unless they happen to know how the font is designed.

Does the font itself indicate the appropriate leading for a particular
em size? For example, do TrueType fonts contain any leading hints?

> Generally speaking, though, garden-variety fonts either don't overlap
> vertically at all when set solid, or do so only to an agreeable
> degree, as in the screen shots of a calligraphic font I provided
> earlier in this thread.

Just to confirm, when you say "when set solid", you mean making the
distance from baseline to baseline equal to the em, right?

> Unless you propose to analyze font metrics
> exhaustively and invent some rules in your implementation (not
> recommended), I can always design a (digital) font in which some
> glyph features overlap others vertically, no matter what the
> line-height.

In my implementation, it is not necessary to analyze font metrics
exhaustively to find the bounding box. The OS gives me that info if I
ask for it. For example, on X, it is simply
XFontStruct.max_bounds.ascent + descent.

So, if CSS had a way of referring to the bounding box when specifying
the line-height (or any other property), it should be easy to get that
info from the OS. CSS does have bbox, but that is a font *descriptor*
(not a property, and not a unit like "em").

> >I suppose
> >the line-height can be set to some value, but what value? If the author
> >is not sure which font will be selected on the user's system, are they
> >supposed to take some arbitrary value like 1.2 and just pray that it'll
> >all work out?
> 
> A little leading is almost always a good idea, and a little more is
> almost always even better, especially when you don't have to cut down
> trees to make room for it. :^)

Basically, you're saying that people ought to try several different
values of line-height on several platforms, perhaps both on screen and
paper, before deciding what value to put in their style sheet. Too
little leading is bad, and too much leading is bad too. You need to find
the right value.

The bottom of the following document suggests various values for the
leading, depending not only on the em, but also on the width of the
column of text:

  http://css.nu/articles/typograph1-en.html

Erik

Received on Friday, 19 November 1999 12:00:14 UTC