# HG changeset patch # User Eli Zaretskii # Date 934281792 0 # Node ID acfe5b9d7233fce7e53876aa6f5c96e6326a4d37 # Parent 11d01c90da6d9787bbce69a9b2dadb39e4ee2c91 (IT_set_face): Abort if the default face is not realized and cached. (IT_write_glyphs): Reset the screen face to the default face before writing glyphs. diff -r 11d01c90da6d -r acfe5b9d7233 src/msdos.c --- a/src/msdos.c Tue Aug 10 10:38:37 1999 +0000 +++ b/src/msdos.c Tue Aug 10 10:43:12 1999 +0000 @@ -670,7 +670,13 @@ unsigned long fg, bg; if (!fp) - fp = FACE_FROM_ID (selected_frame, DEFAULT_FACE_ID); + { + fp = FACE_FROM_ID (selected_frame, DEFAULT_FACE_ID); + /* The default face for the frame should always be realized and + cached. */ + if (!fp) + abort (); + } screen_face = face; fg = fp->foreground; bg = fp->background; @@ -729,6 +735,13 @@ screen_buf = screen_bp = alloca (str_len * 2); screen_buf_end = screen_buf + str_len * 2; + + /* Since faces get cached and uncached behind our back, we can't + rely on their indices in the cache being consistent across + invocations. So always reset the screen face to the default + face of the frame, before writing glyphs, and let the glyphs + set the right face if it's different from the default. */ + IT_set_face (DEFAULT_FACE_ID); /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at the tail. */