diff options
| author | Kenichi Handa | 1997-05-10 03:37:01 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1997-05-10 03:37:01 +0000 |
| commit | 34910d41c1de3669e94f1a3deb5a1f335d5d002c (patch) | |
| tree | a0c7056c402ee7ae4878480c0f6c4655cfa2f1bb /src | |
| parent | 5b467a52344dc0d74f0d792a57ab7b8e9f750e21 (diff) | |
| download | emacs-34910d41c1de3669e94f1a3deb5a1f335d5d002c.tar.gz emacs-34910d41c1de3669e94f1a3deb5a1f335d5d002c.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/src/xterm.c b/src/xterm.c index e199af2302d..addaf5b2635 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -747,12 +747,26 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 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. */ |
| @@ -763,7 +777,8 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 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 | } |
| @@ -846,19 +861,15 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 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) |