diff options
author | Kenichi Handa <[email protected]> | 2009-06-11 01:25:40 +0000 |
---|---|---|
committer | Kenichi Handa <[email protected]> | 2009-06-11 01:25:40 +0000 |
commit | 3561b6717a87de2561c73a4c12ea1627b5878c77 (patch) | |
tree | 6ec003d321c36def2d8d723ee030a08858559372 /src | |
parent | b5700de650026a978c13688f1a2c6289c4b97ec1 (diff) |
(x_compute_glyph_string_overhangs): Handle the automatic
composition case.
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/xterm.c | 25 |
2 files changed, 23 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 67bb245e71..37f160a040 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-06-11 YAMAMOTO Mitsuharu <[email protected]> + + * xterm.c (x_compute_glyph_string_overhangs): Handle the automatic + composition case. + 2009-06-10 Chong Yidong <[email protected]> * xdisp.c (get_next_display_element): When handling wrap-prefix diff --git a/src/xterm.c b/src/xterm.c index ec6c4d4011..4c51626490 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -1194,16 +1194,27 @@ x_compute_glyph_string_overhangs (s) struct glyph_string *s; { if (s->cmp == NULL - && s->first_glyph->type == CHAR_GLYPH) + && (s->first_glyph->type == CHAR_GLYPH + || s->first_glyph->type == COMPOSITE_GLYPH)) { - unsigned *code = alloca (sizeof (unsigned) * s->nchars); - struct font *font = s->font; struct font_metrics metrics; - int i; - for (i = 0; i < s->nchars; i++) - code[i] = (s->char2b[i].byte1 << 8) | s->char2b[i].byte2; - font->driver->text_extents (font, code, s->nchars, &metrics); + if (s->first_glyph->type == CHAR_GLYPH) + { + unsigned *code = alloca (sizeof (unsigned) * s->nchars); + struct font *font = s->font; + int i; + + for (i = 0; i < s->nchars; i++) + code[i] = (s->char2b[i].byte1 << 8) | s->char2b[i].byte2; + font->driver->text_extents (font, code, s->nchars, &metrics); + } + else + { + Lisp_Object gstring = composition_gstring_from_id (s->cmp_id); + + composition_gstring_width (gstring, s->cmp_from, s->cmp_to, &metrics); + } s->right_overhang = (metrics.rbearing > metrics.width ? metrics.rbearing - metrics.width : 0); s->left_overhang = metrics.lbearing < 0 ? - metrics.lbearing : 0; |