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)
This commit is contained in:
Eli Zaretskii 2019-10-08 16:13:21 +03:00
parent 005ed49495
commit bdb04e9dd1

View 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));