From: Eli Zaretskii Date: Tue, 8 Oct 2019 13:13:21 +0000 (+0300) Subject: Fix aborts when opening a new font after face-cache reset X-Git-Tag: emacs-27.0.90~1222 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bdb04e9dd182436a08fc80d5f7bda6432439271a;p=emacs.git Fix aborts when opening a new font after face-cache reset * 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) --- diff --git a/src/font.c b/src/font.c index 935dd64e648..6bc977fd68e 100644 --- a/src/font.c +++ b/src/font.c @@ -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));