Mercurial > emacs
diff src/xdisp.c @ 90309:d863760fdf88
(fill_composite_glyph_string): Check s->face is NULL or
not.
(BUILD_COMPOSITE_GLYPH_STRING): If C is TAB, set s->face to NULL.
(x_produce_glyphs): If CH is TAB, set cmp->offsets properly.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Tue, 21 Feb 2006 11:45:17 +0000 |
parents | 0e4cba8d42b4 |
children | d1c5430c5bff |
line wrap: on
line diff
--- a/src/xdisp.c Tue Feb 21 11:42:19 2006 +0000 +++ b/src/xdisp.c Tue Feb 21 11:45:17 2006 +0000 @@ -18535,14 +18535,24 @@ s->for_overlaps = overlaps; s->face = faces[s->gidx]; - s->font = s->face->font; - s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id); + if (s->face == NULL) + { + s->font = NULL; + s->font_info = NULL; + } + else + { + s->font = s->face->font; + s->font_info = FONT_INFO_FROM_ID (s->f, s->face->font_info_id); + } /* For all glyphs of this composition, starting at the offset S->gidx, until we reach the end of the definition or encounter a glyph that requires the different face, add it to S. */ ++s->nchars; - for (i = s->gidx + 1; i < s->cmp->glyph_len && faces[i] == s->face; ++i) + for (i = s->gidx + 1; + i < s->cmp->glyph_len && (faces[i] == s->face || ! faces[i] || ! s->face); + ++i) ++s->nchars; /* All glyph strings for the same composition has the same width, @@ -18563,8 +18573,6 @@ /* Adjust base line for subscript/superscript text. */ s->ybase += s->first_glyph->voffset; - xassert (s->face && s->face->gc); - /* This glyph string must always be drawn with 16-bit functions. */ s->two_byte_p = 1; @@ -19100,10 +19108,16 @@ for (n = 0; n < glyph_len; n++) \ { \ int c = COMPOSITION_GLYPH (cmp, n); \ - int this_face_id = FACE_FOR_CHAR (f, base_face, c, -1, Qnil); \ - faces[n] = FACE_FROM_ID (f, this_face_id); \ - get_char_face_and_encoding (f, c, this_face_id, \ + \ + if (c == '\t') \ + faces[n] = NULL; \ + else \ + { \ + int this_face_id = FACE_FOR_CHAR (f, base_face, c, -1, Qnil); \ + faces[n] = FACE_FROM_ID (f, this_face_id); \ + get_char_face_and_encoding (f, c, this_face_id, \ char2b + n, 1, 1); \ + } \ } \ \ /* Make glyph_strings for each glyph sequence that is drawable by \ @@ -20462,6 +20476,8 @@ if (ch == '\t') { fully_padded = 1; + cmp->offsets[i * 2] = 0; + cmp->offsets[i * 2 + 1] = boff; continue; }