aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2009-01-08 13:34:44 +0000
committerChong Yidong2009-01-08 13:34:44 +0000
commit50b0cd29f7989dfdb4dfd15c77fdea974f31d9da (patch)
tree25bfd941eb9519cb367a356bf3811f35f0a0c7af
parent14ccea62ca6ccef61df8fde404f430bbc8a5b898 (diff)
downloademacs-50b0cd29f7989dfdb4dfd15c77fdea974f31d9da.tar.gz
emacs-50b0cd29f7989dfdb4dfd15c77fdea974f31d9da.zip
(font_open_for_lface): Handle unspecified height attribute.
-rw-r--r--src/font.c13
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)
3382 size = font_pixel_size (f, spec); 3382 size = font_pixel_size (f, spec);
3383 else 3383 else
3384 { 3384 {
3385 double pt = XINT (attrs[LFACE_HEIGHT_INDEX]); 3385 double pt;
3386 if (INTEGERP (attrs[LFACE_HEIGHT_INDEX]))
3387 pt = XINT (attrs[LFACE_HEIGHT_INDEX]);
3388 else
3389 {
3390 struct face *def = FACE_FROM_ID (f, DEFAULT_FACE_ID);
3391 Lisp_Object height = def->lface[LFACE_HEIGHT_INDEX];
3392 if (INTEGERP (height))
3393 pt = XINT (height);
3394 else
3395 abort(); /* We should never end up here. */
3396 }
3386 3397
3387 pt /= 10; 3398 pt /= 10;
3388 size = POINT_TO_PIXEL (pt, f->resy); 3399 size = POINT_TO_PIXEL (pt, f->resy);