Mercurial > emacs
changeset 100985:f82bae05534c
(font_open_for_lface): Handle unspecified height attribute.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Thu, 08 Jan 2009 13:34:44 +0000 |
parents | 27c62295213b |
children | 55aea246d319 |
files | src/font.c |
diffstat | 1 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/font.c Thu Jan 08 13:34:35 2009 +0000 +++ b/src/font.c Thu Jan 08 13:34:44 2009 +0000 @@ -3382,7 +3382,18 @@ size = font_pixel_size (f, spec); else { - double pt = XINT (attrs[LFACE_HEIGHT_INDEX]); + double pt; + if (INTEGERP (attrs[LFACE_HEIGHT_INDEX])) + pt = XINT (attrs[LFACE_HEIGHT_INDEX]); + else + { + struct face *def = FACE_FROM_ID (f, DEFAULT_FACE_ID); + Lisp_Object height = def->lface[LFACE_HEIGHT_INDEX]; + if (INTEGERP (height)) + pt = XINT (height); + else + abort(); /* We should never end up here. */ + } pt /= 10; size = POINT_TO_PIXEL (pt, f->resy);