Em's, ex's and %ages

Subject: Em's, ex's and %ages
From: Paul Prescod <papresco@xxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Sat, 19 Apr 1997 17:16:46 -0400
I converted a CSS stylesheet to DSSSL as an educational exercise and
to compare the difficulty. Most things are easy. One thing that is hard
is units. CSS uses "em"s:

H1 { margin: 0.5em }      /* ems, the height of the element's font */
H1 { margin: 1ex }        /* x-height, ~ the height of the letter 'x' */

The first could be calculated based on the font-size characterstic, but
must be recalculated for each element, and so could not use the regular
DSSSL quantity notation. What about the latter? Can I get that
information from the font-property? Is ISO/ IEC 9541-1 available online?
Aren't variable-sized em's and ex's were pretty standard in the
publishing world?

CSS users also often use sizes in terms of the containing flow object:
e.g. width: 100% . I believe there to be no easy way to do that in
DSSSL, even if I give up the quantity notation. Am I correct? I'm
looking for something like (parent-display-size) or a "generated"
(delayed) version of it. Wouldn't access to context make rules more

 Paul Prescod

Current Thread