]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix aborts when opening a new font after face-cache reset
authorEli Zaretskii <eliz@gnu.org>
Tue, 8 Oct 2019 13:13:21 +0000 (16:13 +0300)
committerEli Zaretskii <eliz@gnu.org>
Tue, 8 Oct 2019 13:13:21 +0000 (16:13 +0300)
* src/font.c (font_open_for_lface): Make sure the default face
is realized before using its height for the font to be open.
(Bug#37637)

src/font.c

index 935dd64e6485fea216ec82f7f2fc0b932077dc0f..6bc977fd68e855d5e2650a08bc8f8c2b54887b25 100644 (file)
@@ -3314,6 +3314,10 @@ font_open_for_lface (struct frame *f, Lisp_Object entity, Lisp_Object *attrs, Li
            pt = XFIXNUM (attrs[LFACE_HEIGHT_INDEX]);
          else
            {
+             /* We need the default face to be valid below.  */
+             if (FRAME_FACE_CACHE (f)->used == 0)
+               recompute_basic_faces (f);
+
              struct face *def = FACE_FROM_ID (f, DEFAULT_FACE_ID);
              Lisp_Object height = def->lface[LFACE_HEIGHT_INDEX];
              eassert (FIXNUMP (height));