diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2009-01-08 13:34:44 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2009-01-08 13:34:44 +0000 |
commit | 50b0cd29f7989dfdb4dfd15c77fdea974f31d9da (patch) | |
tree | 25bfd941eb9519cb367a356bf3811f35f0a0c7af | |
parent | 14ccea62ca6ccef61df8fde404f430bbc8a5b898 (diff) | |
download | emacs-50b0cd29f7989dfdb4dfd15c77fdea974f31d9da.tar.gz emacs-50b0cd29f7989dfdb4dfd15c77fdea974f31d9da.tar.bz2 emacs-50b0cd29f7989dfdb4dfd15c77fdea974f31d9da.zip |
(font_open_for_lface): Handle unspecified height attribute.
-rw-r--r-- | src/font.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/font.c b/src/font.c index b82a4d2a045..d88b1c592ff 100644 --- a/src/font.c +++ b/src/font.c @@ -3382,7 +3382,18 @@ font_open_for_lface (f, entity, attrs, spec) 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); |