comparison src/msdos.c @ 25214:acfe5b9d7233

(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.
author Eli Zaretskii <eliz@gnu.org>
date Tue, 10 Aug 1999 10:43:12 +0000
parents 4833aea1f1e7
children b7aa6ac26872
comparison
equal deleted inserted replaced
25213:11d01c90da6d 25214:acfe5b9d7233
668 { 668 {
669 struct face *fp = FACE_FROM_ID (selected_frame, face); 669 struct face *fp = FACE_FROM_ID (selected_frame, face);
670 unsigned long fg, bg; 670 unsigned long fg, bg;
671 671
672 if (!fp) 672 if (!fp)
673 fp = FACE_FROM_ID (selected_frame, DEFAULT_FACE_ID); 673 {
674 fp = FACE_FROM_ID (selected_frame, DEFAULT_FACE_ID);
675 /* The default face for the frame should always be realized and
676 cached. */
677 if (!fp)
678 abort ();
679 }
674 screen_face = face; 680 screen_face = face;
675 fg = fp->foreground; 681 fg = fp->foreground;
676 bg = fp->background; 682 bg = fp->background;
677 683
678 /* Don't use invalid colors. In particular, a color of -1 means use 684 /* Don't use invalid colors. In particular, a color of -1 means use
727 733
728 if (str_len == 0) return; 734 if (str_len == 0) return;
729 735
730 screen_buf = screen_bp = alloca (str_len * 2); 736 screen_buf = screen_bp = alloca (str_len * 2);
731 screen_buf_end = screen_buf + str_len * 2; 737 screen_buf_end = screen_buf + str_len * 2;
738
739 /* Since faces get cached and uncached behind our back, we can't
740 rely on their indices in the cache being consistent across
741 invocations. So always reset the screen face to the default
742 face of the frame, before writing glyphs, and let the glyphs
743 set the right face if it's different from the default. */
744 IT_set_face (DEFAULT_FACE_ID);
732 745
733 /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at 746 /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at
734 the tail. */ 747 the tail. */
735 terminal_coding.mode &= ~CODING_MODE_LAST_BLOCK; 748 terminal_coding.mode &= ~CODING_MODE_LAST_BLOCK;
736 while (sl) 749 while (sl)