Re: A proposal for units in GTK+
- From: Noah Levitt <nlevitt columbia edu>
- To: Shahms King <shahms shahms com>
- Cc: gtk-devel-list gnome org
- Subject: Re: A proposal for units in GTK+
- Date: Mon, 3 Feb 2003 19:16:27 -0500
I've just had a discussion about this in #mozilla.
In CSS, an em is the "font-size", exactly as the spec says.
Thus, for a 12pt font, 1em = 12pt.
Noah
On Mon, Feb 03, 2003 at 14:55:29 -0800, Shahms King wrote:
> On Mon, 2003-02-03 at 14:30, Noah Levitt wrote:
> > CSS seems to define an em as the font's height.
> > http://www.w3.org/TR/REC-CSS1#length-units
> >
> > H1 { margin: 0.5em } /* ems, the height of the element's font */
> >
> > Noah
>
> Then that comment is wrong. en's and em's should not be the same, but
> using the "height" measure, they would be. CSS2, however defines them
> as:
>
> Relative units are:
>
> * em: the 'font-size' of the relevant font
> * ex: the 'x-height' of the relevant font
> * px: pixels, relative to the viewing device
> Example(s):
>
>
> H1 { margin: 0.5em } /* em */
> H1 { margin: 1ex } /* ex */
> P { font-size: 12px } /* px */
>
> The 'em' unit is equal to the computed value of the 'font-size' property
> of the element on which it is used. The exception is when 'em' occurs in
> the value of the 'font-size' property itself, in which case it refers to
> the font size of the parent element. It may be used for vertical or
> horizontal measurement. (This unit is also sometimes called the
> quad-width in typographic texts.)
>
> The 'ex' unit is defined by the font's 'x-height'. The x-height is so
> called because it is often equal to the height of the lowercase "x".
> However, an 'ex' is defined even for fonts that don't contain an "x".
>
> _________________________________
>
> To me, this definition implies that 'ex' directly relates to font height
> and 'em' (more) directly relates to font width.
>
> my $0.02
>
> --
> Shahms King <shahms shahms com>
>
> _______________________________________________
> gtk-devel-list mailing list
> gtk-devel-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtk-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]