aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2008-02-17 02:01:43 +0000
committerKenichi Handa2008-02-17 02:01:43 +0000
commit9c9f2e85eb73a6aca17cfa7743eed873e6026f8c (patch)
treeb587a6769dc9e5f0bb8141c6f202020681d324e5 /src
parent19d4ac9360c47f8e1939cdc72964cd3c8294f95c (diff)
downloademacs-9c9f2e85eb73a6aca17cfa7743eed873e6026f8c.tar.gz
emacs-9c9f2e85eb73a6aca17cfa7743eed873e6026f8c.zip
(handle_composition_prop): Set it->c to the fist
characte of the composed region. (fill_composite_glyph_string): Set base_face->font_info to s->font_info. Get a face for ascii from base_face->ascii_face. (BUILD_COMPOSITE_GLYPH_STRING): Call fill_composite_glyph_string with a face already decided. (x_produce_glyphs): Be sure to set it->ascent and it->descent to non-negative. (x_produce_glyphs): If the composition method is ..._WITH_GLYPH_STRING, call font_prepare_composition unconditionally.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 65d63aa49a4..920862d8298 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -4676,15 +4676,20 @@ handle_composition_prop (it)
4676 4676
4677 if (STRINGP (it->string)) 4677 if (STRINGP (it->string))
4678 { 4678 {
4679 unsigned char *s;
4680
4679 pos = IT_STRING_CHARPOS (*it); 4681 pos = IT_STRING_CHARPOS (*it);
4680 pos_byte = IT_STRING_BYTEPOS (*it); 4682 pos_byte = IT_STRING_BYTEPOS (*it);
4681 string = it->string; 4683 string = it->string;
4684 s = SDATA (string) + pos_byte;
4685 it->c = STRING_CHAR (s, 0);
4682 } 4686 }
4683 else 4687 else
4684 { 4688 {
4685 pos = IT_CHARPOS (*it); 4689 pos = IT_CHARPOS (*it);
4686 pos_byte = IT_BYTEPOS (*it); 4690 pos_byte = IT_BYTEPOS (*it);
4687 string = Qnil; 4691 string = Qnil;
4692 it->c = FETCH_CHAR (pos_byte);
4688 } 4693 }
4689 4694
4690 /* If there's a valid composition and point is not inside of the 4695 /* If there's a valid composition and point is not inside of the
@@ -4740,8 +4745,6 @@ handle_composition_prop (it)
4740 Lisp_Object lgstring = AREF (XHASH_TABLE (composition_hash_table) 4745 Lisp_Object lgstring = AREF (XHASH_TABLE (composition_hash_table)
4741 ->key_and_value, 4746 ->key_and_value,
4742 cmp->hash_index * 2); 4747 cmp->hash_index * 2);
4743
4744 it->c = LGLYPH_CHAR (LGSTRING_GLYPH (lgstring, 0));
4745 } 4748 }
4746 else 4749 else
4747#endif /* USE_FONT_BACKEND */ 4750#endif /* USE_FONT_BACKEND */
@@ -19309,7 +19312,7 @@ fill_composite_glyph_string (s, base_face, overlaps)
19309 s->cmp->hash_index * 2); 19312 s->cmp->hash_index * 2);
19310 19313
19311 s->face = base_face; 19314 s->face = base_face;
19312 s->font_info = s->cmp->font; 19315 s->font_info = base_face->font_info;
19313 s->font = s->font_info->font; 19316 s->font = s->font_info->font;
19314 for (i = 0, s->nchars = 0; i < s->cmp->glyph_len; i++, s->nchars++) 19317 for (i = 0, s->nchars = 0; i < s->cmp->glyph_len; i++, s->nchars++)
19315 { 19318 {
@@ -19341,7 +19344,8 @@ fill_composite_glyph_string (s, base_face, overlaps)
19341 19344
19342 if (c != '\t') 19345 if (c != '\t')
19343 { 19346 {
19344 int face_id = FACE_FOR_CHAR (s->f, base_face, c, -1, Qnil); 19347 int face_id = FACE_FOR_CHAR (s->f, base_face->ascii_face, c,
19348 -1, Qnil);
19345 19349
19346 face = get_char_face_and_encoding (s->f, c, face_id, 19350 face = get_char_face_and_encoding (s->f, c, face_id,
19347 s->char2b + i, 1, 1); 19351 s->char2b + i, 1, 1);
@@ -19879,7 +19883,6 @@ compute_overhangs_and_x (s, x, backward_p)
19879 int n; \ 19883 int n; \
19880 \ 19884 \
19881 char2b = (XChar2b *) alloca ((sizeof *char2b) * cmp->glyph_len); \ 19885 char2b = (XChar2b *) alloca ((sizeof *char2b) * cmp->glyph_len); \
19882 base_face = base_face->ascii_face; \
19883 \ 19886 \
19884 /* Make glyph_strings for each glyph sequence that is drawable by \ 19887 /* Make glyph_strings for each glyph sequence that is drawable by \
19885 the same face, and append them to HEAD/TAIL. */ \ 19888 the same face, and append them to HEAD/TAIL. */ \
@@ -21095,6 +21098,11 @@ x_produce_glyphs (it)
21095 21098
21096 take_vertical_position_into_account (it); 21099 take_vertical_position_into_account (it);
21097 21100
21101 if (it->ascent < 0)
21102 it->ascent = 0;
21103 if (it->descent < 0)
21104 it->descent = 0;
21105
21098 if (it->glyph_row) 21106 if (it->glyph_row)
21099 append_glyph (it); 21107 append_glyph (it);
21100 } 21108 }
@@ -21119,8 +21127,8 @@ x_produce_glyphs (it)
21119#ifdef USE_FONT_BACKEND 21127#ifdef USE_FONT_BACKEND
21120 if (cmp->method == COMPOSITION_WITH_GLYPH_STRING) 21128 if (cmp->method == COMPOSITION_WITH_GLYPH_STRING)
21121 { 21129 {
21122 if (! cmp->font || cmp->font != font) 21130 PREPARE_FACE_FOR_DISPLAY (it->f, face);
21123 font_prepare_composition (cmp, it->f); 21131 font_prepare_composition (cmp, it->f);
21124 } 21132 }
21125 else 21133 else
21126#endif /* USE_FONT_BACKEND */ 21134#endif /* USE_FONT_BACKEND */
@@ -21399,11 +21407,7 @@ x_produce_glyphs (it)
21399 21407
21400 it->pixel_width = cmp->pixel_width; 21408 it->pixel_width = cmp->pixel_width;
21401 it->ascent = it->phys_ascent = cmp->ascent; 21409 it->ascent = it->phys_ascent = cmp->ascent;
21402 if (it->ascent < 0)
21403 it->ascent = it->phys_ascent = 0;
21404 it->descent = it->phys_descent = cmp->descent; 21410 it->descent = it->phys_descent = cmp->descent;
21405 if (it->descent < 0)
21406 it->descent = it->phys_descent = 0;
21407 if (face->box != FACE_NO_BOX) 21411 if (face->box != FACE_NO_BOX)
21408 { 21412 {
21409 int thick = face->box_line_width; 21413 int thick = face->box_line_width;
@@ -21428,6 +21432,10 @@ x_produce_glyphs (it)
21428 it->ascent += overline_margin; 21432 it->ascent += overline_margin;
21429 21433
21430 take_vertical_position_into_account (it); 21434 take_vertical_position_into_account (it);
21435 if (it->ascent < 0)
21436 it->ascent = 0;
21437 if (it->descent < 0)
21438 it->descent = 0;
21431 21439
21432 if (it->glyph_row) 21440 if (it->glyph_row)
21433 append_composite_glyph (it); 21441 append_composite_glyph (it);