diff options
| author | Kenichi Handa | 1997-02-27 06:53:04 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1997-02-27 06:53:04 +0000 |
| commit | f78798dfeb5550a8f691480b6031196149039303 (patch) | |
| tree | a82973cbfd2609f9ec12c3acd25039a9f0f9d633 /src | |
| parent | 1312cff577e40ff84badabdf5bfe15173d12167d (diff) | |
| download | emacs-f78798dfeb5550a8f691480b6031196149039303.tar.gz emacs-f78798dfeb5550a8f691480b6031196149039303.zip | |
(dumpglyphs): Pay attention to characters registered in
use-default-ascent.
Fill background in advance if font has
non-zero _MULE_BASELINE_OFFSET property.
(x_load_font, x_term_init): Handle font property _MULE_DEFAULT_ASCENT.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/src/xterm.c b/src/xterm.c index 6bd821c1011..b990f8a5bd1 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -557,7 +557,7 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 557 | /* Get the face-code of the next GLYPH. */ | 557 | /* Get the face-code of the next GLYPH. */ |
| 558 | int cf, len; | 558 | int cf, len; |
| 559 | GLYPH g = *gp; | 559 | GLYPH g = *gp; |
| 560 | int ch, charset; | 560 | int ch, first_ch, charset; |
| 561 | /* HIGHEST and LOWEST are used while drawing a composite | 561 | /* HIGHEST and LOWEST are used while drawing a composite |
| 562 | character. The meanings are described later. */ | 562 | character. The meanings are described later. */ |
| 563 | int highest, lowest; | 563 | int highest, lowest; |
| @@ -565,6 +565,7 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 565 | GLYPH_FOLLOW_ALIASES (tbase, tlen, g); | 565 | GLYPH_FOLLOW_ALIASES (tbase, tlen, g); |
| 566 | cf = (cmpcharp ? cmpcharp->face_work : FAST_GLYPH_FACE (g)); | 566 | cf = (cmpcharp ? cmpcharp->face_work : FAST_GLYPH_FACE (g)); |
| 567 | ch = FAST_GLYPH_CHAR (g); | 567 | ch = FAST_GLYPH_CHAR (g); |
| 568 | if (gidx == 0) first_ch = ch; | ||
| 568 | charset = CHAR_CHARSET (ch); | 569 | charset = CHAR_CHARSET (ch); |
| 569 | if (charset == CHARSET_COMPOSITION) | 570 | if (charset == CHARSET_COMPOSITION) |
| 570 | { | 571 | { |
| @@ -635,12 +636,14 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 635 | 1) A face has stipple. | 636 | 1) A face has stipple. |
| 636 | 2) A height of font is different from that of the current line. | 637 | 2) A height of font is different from that of the current line. |
| 637 | 3) Drawing a composite character. | 638 | 3) Drawing a composite character. |
| 639 | 4) Font has non-zero _MULE_BASELINE_OFFSET property. | ||
| 638 | After filling background, we draw glyphs by XDrawString16. */ | 640 | After filling background, we draw glyphs by XDrawString16. */ |
| 639 | int background_filled; | 641 | int background_filled; |
| 640 | /* Baseline position of a character, offset from TOP. */ | 642 | /* Baseline position of a character, offset from TOP. */ |
| 641 | int baseline; | 643 | int baseline; |
| 642 | /* The property value of `_MULE_RELATIVE_COMPOSE'. */ | 644 | /* The property value of `_MULE_RELATIVE_COMPOSE' and |
| 643 | int relative_compose = 0; | 645 | `_MULE_DEFAULT_ASCENT'. */ |
| 646 | int relative_compose = 0, default_ascent = 0; | ||
| 644 | 647 | ||
| 645 | /* HL = 3 means use a mouse face previously chosen. */ | 648 | /* HL = 3 means use a mouse face previously chosen. */ |
| 646 | if (hl == 3) | 649 | if (hl == 3) |
| @@ -695,7 +698,10 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 695 | baseline = (f->output_data.x->font_baseline | 698 | baseline = (f->output_data.x->font_baseline |
| 696 | - fontp->baseline_offset); | 699 | - fontp->baseline_offset); |
| 697 | if (cmpcharp && cmpcharp->cmp_rule == NULL) | 700 | if (cmpcharp && cmpcharp->cmp_rule == NULL) |
| 698 | relative_compose = fontp->relative_compose; | 701 | { |
| 702 | relative_compose = fontp->relative_compose; | ||
| 703 | default_ascent = fontp->default_ascent; | ||
| 704 | } | ||
| 699 | 705 | ||
| 700 | /* We have to change code points in the following cases. */ | 706 | /* We have to change code points in the following cases. */ |
| 701 | if (fontp->font_encoder) | 707 | if (fontp->font_encoder) |
| @@ -812,7 +818,8 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 812 | else if (!font | 818 | else if (!font |
| 813 | || stippled | 819 | || stippled |
| 814 | || f->output_data.x->line_height != FONT_HEIGHT (font) | 820 | || f->output_data.x->line_height != FONT_HEIGHT (font) |
| 815 | || cmpcharp) | 821 | || cmpcharp |
| 822 | || baseline != f->output_data.x->font_baseline) | ||
| 816 | { | 823 | { |
| 817 | if (!stippled) | 824 | if (!stippled) |
| 818 | /* This is to fill a rectangle with background color. */ | 825 | /* This is to fill a rectangle with background color. */ |
| @@ -853,9 +860,19 @@ dumpglyphs (f, left, top, gp, n, hl, just_foreground, cmpcharp) | |||
| 853 | written, LOWEST the lowest position. */ | 860 | written, LOWEST the lowest position. */ |
| 854 | int x_offset = 0; | 861 | int x_offset = 0; |
| 855 | 862 | ||
| 856 | pcm = PER_CHAR_METRIC (font, buf); | 863 | if (default_ascent |
| 857 | highest = pcm->ascent + 1; | 864 | && CHAR_TABLE_P (Vuse_default_ascent) |
| 858 | lowest = - pcm->descent; | 865 | && !NILP (Faref (Vuse_default_ascent, first_ch))) |
| 866 | { | ||
| 867 | highest = default_ascent; | ||
| 868 | lowest = 0; | ||
| 869 | } | ||
| 870 | else | ||
| 871 | { | ||
| 872 | pcm = PER_CHAR_METRIC (font, buf); | ||
| 873 | highest = pcm->ascent + 1; | ||
| 874 | lowest = - pcm->descent; | ||
| 875 | } | ||
| 859 | 876 | ||
| 860 | if (cmpcharp->cmp_rule) | 877 | if (cmpcharp->cmp_rule) |
| 861 | x_offset = (cmpcharp->col_offset[0] | 878 | x_offset = (cmpcharp->col_offset[0] |
| @@ -6380,6 +6397,9 @@ x_load_font (f, fontname, size) | |||
| 6380 | fontp->relative_compose | 6397 | fontp->relative_compose |
| 6381 | = (XGetFontProperty (font, dpyinfo->Xatom_MULE_RELATIVE_COMPOSE, &value) | 6398 | = (XGetFontProperty (font, dpyinfo->Xatom_MULE_RELATIVE_COMPOSE, &value) |
| 6382 | ? (long) value : 0); | 6399 | ? (long) value : 0); |
| 6400 | fontp->default_ascent | ||
| 6401 | = (XGetFontProperty (font, dpyinfo->Xatom_MULE_DEFAULT_ASCENT, &value) | ||
| 6402 | ? (long) value : 0); | ||
| 6383 | 6403 | ||
| 6384 | UNBLOCK_INPUT; | 6404 | UNBLOCK_INPUT; |
| 6385 | dpyinfo->n_fonts++; | 6405 | dpyinfo->n_fonts++; |
| @@ -6678,6 +6698,8 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 6678 | = XInternAtom (dpyinfo->display, "_MULE_BASELINE_OFFSET", False); | 6698 | = XInternAtom (dpyinfo->display, "_MULE_BASELINE_OFFSET", False); |
| 6679 | dpyinfo->Xatom_MULE_RELATIVE_COMPOSE | 6699 | dpyinfo->Xatom_MULE_RELATIVE_COMPOSE |
| 6680 | = XInternAtom (dpyinfo->display, "_MULE_RELATIVE_COMPOSE", False); | 6700 | = XInternAtom (dpyinfo->display, "_MULE_RELATIVE_COMPOSE", False); |
| 6701 | dpyinfo->Xatom_MULE_DEFAULT_ASCENT | ||
| 6702 | = XInternAtom (dpyinfo->display, "_MULE_DEFAULT_ASCENT", False); | ||
| 6681 | 6703 | ||
| 6682 | dpyinfo->cut_buffers_initialized = 0; | 6704 | dpyinfo->cut_buffers_initialized = 0; |
| 6683 | 6705 | ||