diff options
| author | Kenichi Handa | 1997-06-09 13:00:24 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1997-06-09 13:00:24 +0000 |
| commit | 97210f4e3fbf5afd39c959d19b14d120885e4245 (patch) | |
| tree | 8c1be7408ee681b608e375b90268778335ea4a87 /src | |
| parent | 569e0c76bd411e04d8a699b94a62b330fa77a62f (diff) | |
| download | emacs-97210f4e3fbf5afd39c959d19b14d120885e4245.tar.gz emacs-97210f4e3fbf5afd39c959d19b14d120885e4245.zip | |
(dumpglyph): Shift baseline for such a font that is
shorter but ascent or descent exceed the line height.
For a larger font, draw a small hook at right-bottom edge instead
of a rectangle.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/src/xterm.c b/src/xterm.c index e1b7937bc2c..efa9c00ce27 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -703,6 +703,13 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 703 | = (font->max_byte1 != 0 | 703 | = (font->max_byte1 != 0 |
| 704 | ? (line_height + font->ascent - font->descent) / 2 | 704 | ? (line_height + font->ascent - font->descent) / 2 |
| 705 | : f->output_data.x->font_baseline - fontp->baseline_offset); | 705 | : f->output_data.x->font_baseline - fontp->baseline_offset); |
| 706 | if (FONT_HEIGHT (font) <= line_height | ||
| 707 | && (font->ascent > baseline | ||
| 708 | || font->descent > line_height - baseline)) | ||
| 709 | /* Adjust baseline for this font to show the whole | ||
| 710 | glyphs in a line. */ | ||
| 711 | baseline = line_height - font->descent; | ||
| 712 | |||
| 706 | if (cmpcharp && cmpcharp->cmp_rule == NULL) | 713 | if (cmpcharp && cmpcharp->cmp_rule == NULL) |
| 707 | { | 714 | { |
| 708 | relative_compose = fontp->relative_compose; | 715 | relative_compose = fontp->relative_compose; |
| @@ -863,7 +870,7 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 863 | 870 | ||
| 864 | /* The current code at first set foreground to background, | 871 | /* The current code at first set foreground to background, |
| 865 | fill the area, then recover the original foreground. | 872 | fill the area, then recover the original foreground. |
| 866 | Aren't there any more smart ways? */ | 873 | Aren't there any smarter ways? */ |
| 867 | 874 | ||
| 868 | XGetGCValues (FRAME_X_DISPLAY (f), gc, mask, &xgcv); | 875 | XGetGCValues (FRAME_X_DISPLAY (f), gc, mask, &xgcv); |
| 869 | XSetForeground (FRAME_X_DISPLAY (f), gc, xgcv.background); | 876 | XSetForeground (FRAME_X_DISPLAY (f), gc, xgcv.background); |
| @@ -1028,22 +1035,33 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 1028 | } | 1035 | } |
| 1029 | #endif | 1036 | #endif |
| 1030 | } | 1037 | } |
| 1031 | if (!font || require_clipping && !NILP (Vhighlight_wrong_size_font)) | 1038 | if (!font) |
| 1032 | { | 1039 | { |
| 1033 | /* Show rectangles to show that we found no font or a font | 1040 | /* Show rectangles to indicate that we found no font. */ |
| 1034 | of inappropriate size. */ | 1041 | int limit = cmpcharp ? 1 : len; |
| 1035 | 1042 | ||
| 1036 | if (cmpcharp) | 1043 | for (i = 0; i < limit; i++) |
| 1037 | XDrawRectangle | 1044 | XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, |
| 1038 | (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, | 1045 | left + glyph_width * i, top, |
| 1039 | left, top, run_width - 1, line_height - 1); | 1046 | glyph_width - 1, line_height - 1); |
| 1040 | else | 1047 | } |
| 1041 | for (i = 0; i < len; i++) | 1048 | else if (require_clipping && !NILP (Vhighlight_wrong_size_font)) |
| 1042 | XDrawRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, | 1049 | { |
| 1043 | left + glyph_width * i, top, | 1050 | /* Show ??? to indicate that we found a font of |
| 1044 | glyph_width -1, line_height - 1); | 1051 | inappropriate size. */ |
| 1052 | int limit = cmpcharp ? 1 : len; | ||
| 1053 | |||
| 1054 | for (i = 0; i < limit; i++) | ||
| 1055 | { | ||
| 1056 | XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, | ||
| 1057 | left + glyph_width * i, top + line_height - 1, | ||
| 1058 | left + glyph_width * i + 1, top + line_height - 1); | ||
| 1059 | XDrawLine (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), gc, | ||
| 1060 | left + glyph_width * i, top + line_height - 3, | ||
| 1061 | left + glyph_width * i, top + line_height - 1); | ||
| 1062 | } | ||
| 1045 | } | 1063 | } |
| 1046 | 1064 | ||
| 1047 | /* We should probably check for XA_UNDERLINE_POSITION and | 1065 | /* We should probably check for XA_UNDERLINE_POSITION and |
| 1048 | XA_UNDERLINE_THICKNESS properties on the font, but let's | 1066 | XA_UNDERLINE_THICKNESS properties on the font, but let's |
| 1049 | just get the thing working, and come back to that. */ | 1067 | just get the thing working, and come back to that. */ |