comparison src/xterm.c @ 17720:530ee47cb56b

(dumpglyphs): Even if font (not fontset) is used, display Latin1 characters correctly if the font contains glyphs for them. Fix bug of displaying cursor on a composite character.
author Kenichi Handa <handa@m17n.org>
date Sat, 10 May 1997 03:37:01 +0000
parents 251e103f2d53
children 281d99590839
comparison
equal deleted inserted replaced
17719:78ec737e7154 17720:530ee47cb56b
745 cp->byte2 |= 0x80; 745 cp->byte2 |= 0x80;
746 } 746 }
747 } 747 }
748 else 748 else
749 { 749 {
750 font = FACE_FONT (face);
751 if (font == (XFontStruct *) FACE_DEFAULT)
752 font = f->output_data.x->font;
753 baseline = FONT_BASE (font);
754 font_not_found: 750 font_not_found:
755 gc = FACE_GC (face); 751 if (charset == CHARSET_ASCII || charset == charset_latin_iso8859_1)
752 {
753 font = FACE_FONT (face);
754 if (font == (XFontStruct *) FACE_DEFAULT)
755 font = f->output_data.x->font;
756 baseline = FONT_BASE (font);
757 if (charset == charset_latin_iso8859_1)
758 {
759 if (font->max_char_or_byte2 < 0x80)
760 /* This font can't display Latin1 characters. */
761 font = NULL;
762 else
763 {
764 for (cp = buf; cp < buf + len; cp++)
765 cp->byte2 |= 0x80;
766 }
767 }
768 }
769 gc = FACE_GC (face);
756 } 770 }
757 771
758 /* Now override that if the cursor's on this character. */ 772 /* Now override that if the cursor's on this character. */
759 if (hl == 2) 773 if (hl == 2)
760 { 774 {
761 /* The cursor overrides stippling. */ 775 /* The cursor overrides stippling. */
762 stippled = 0; 776 stippled = 0;
763 777
764 if (font == f->output_data.x->font 778 if (font == f->output_data.x->font
765 && face->background == f->output_data.x->background_pixel 779 && face->background == f->output_data.x->background_pixel
766 && face->foreground == f->output_data.x->foreground_pixel) 780 && face->foreground == f->output_data.x->foreground_pixel
781 && !cmpcharp)
767 { 782 {
768 gc = f->output_data.x->cursor_gc; 783 gc = f->output_data.x->cursor_gc;
769 } 784 }
770 /* Cursor on non-default face: must merge. */ 785 /* Cursor on non-default face: must merge. */
771 else 786 else
844 /* Fill a area for the current run in background pixle of GC. */ 859 /* Fill a area for the current run in background pixle of GC. */
845 XGCValues xgcv; 860 XGCValues xgcv;
846 unsigned long mask = GCForeground | GCBackground; 861 unsigned long mask = GCForeground | GCBackground;
847 unsigned long fore, back; 862 unsigned long fore, back;
848 863
849 /* The current code at first exchange foreground and 864 /* The current code at first set foreground to background,
850 background of GC, fill the area, then recover the 865 fill the area, then recover the original foreground.
851 original foreground and background of GC.
852 Aren't there any more smart ways? */ 866 Aren't there any more smart ways? */
853 867
854 XGetGCValues (FRAME_X_DISPLAY (f), gc, mask, &xgcv); 868 XGetGCValues (FRAME_X_DISPLAY (f), gc, mask, &xgcv);
855 fore = xgcv.foreground, back = xgcv.background; 869 XSetForeground (FRAME_X_DISPLAY (f), gc, xgcv.background);
856 xgcv.foreground = back, xgcv.background = fore;
857 XChangeGC (FRAME_X_DISPLAY (f), gc, mask, &xgcv);
858 XFillRectangle (FRAME_X_DISPLAY (f), window, gc, 870 XFillRectangle (FRAME_X_DISPLAY (f), window, gc,
859 left, top, run_width, line_height); 871 left, top, run_width, line_height);
860 xgcv.foreground = fore, xgcv.background = back; 872 XSetForeground (FRAME_X_DISPLAY (f), gc, xgcv.foreground);
861 XChangeGC (FRAME_X_DISPLAY (f), gc, mask, &xgcv);
862 873
863 background_filled = 1; 874 background_filled = 1;
864 if (cmpcharp) 875 if (cmpcharp)
865 /* To assure not to fill background while drawing 876 /* To assure not to fill background while drawing
866 remaining components. */ 877 remaining components. */