aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2009-06-11 01:25:40 +0000
committerKenichi Handa2009-06-11 01:25:40 +0000
commit3561b6717a87de2561c73a4c12ea1627b5878c77 (patch)
tree6ec003d321c36def2d8d723ee030a08858559372 /src
parentb5700de650026a978c13688f1a2c6289c4b97ec1 (diff)
downloademacs-3561b6717a87de2561c73a4c12ea1627b5878c77.tar.gz
emacs-3561b6717a87de2561c73a4c12ea1627b5878c77.zip
(x_compute_glyph_string_overhangs): Handle the automatic
composition case.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/xterm.c25
2 files changed, 23 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 67bb245e71f..37f160a040b 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12009-06-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2
3 * xterm.c (x_compute_glyph_string_overhangs): Handle the automatic
4 composition case.
5
12009-06-10 Chong Yidong <cyd@stupidchicken.com> 62009-06-10 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * xdisp.c (get_next_display_element): When handling wrap-prefix 8 * xdisp.c (get_next_display_element): When handling wrap-prefix
diff --git a/src/xterm.c b/src/xterm.c
index ec6c4d4011f..4c516264902 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -1194,16 +1194,27 @@ x_compute_glyph_string_overhangs (s)
1194 struct glyph_string *s; 1194 struct glyph_string *s;
1195{ 1195{
1196 if (s->cmp == NULL 1196 if (s->cmp == NULL
1197 && s->first_glyph->type == CHAR_GLYPH) 1197 && (s->first_glyph->type == CHAR_GLYPH
1198 || s->first_glyph->type == COMPOSITE_GLYPH))
1198 { 1199 {
1199 unsigned *code = alloca (sizeof (unsigned) * s->nchars);
1200 struct font *font = s->font;
1201 struct font_metrics metrics; 1200 struct font_metrics metrics;
1202 int i;
1203 1201
1204 for (i = 0; i < s->nchars; i++) 1202 if (s->first_glyph->type == CHAR_GLYPH)
1205 code[i] = (s->char2b[i].byte1 << 8) | s->char2b[i].byte2; 1203 {
1206 font->driver->text_extents (font, code, s->nchars, &metrics); 1204 unsigned *code = alloca (sizeof (unsigned) * s->nchars);
1205 struct font *font = s->font;
1206 int i;
1207
1208 for (i = 0; i < s->nchars; i++)
1209 code[i] = (s->char2b[i].byte1 << 8) | s->char2b[i].byte2;
1210 font->driver->text_extents (font, code, s->nchars, &metrics);
1211 }
1212 else
1213 {
1214 Lisp_Object gstring = composition_gstring_from_id (s->cmp_id);
1215
1216 composition_gstring_width (gstring, s->cmp_from, s->cmp_to, &metrics);
1217 }
1207 s->right_overhang = (metrics.rbearing > metrics.width 1218 s->right_overhang = (metrics.rbearing > metrics.width
1208 ? metrics.rbearing - metrics.width : 0); 1219 ? metrics.rbearing - metrics.width : 0);
1209 s->left_overhang = metrics.lbearing < 0 ? - metrics.lbearing : 0; 1220 s->left_overhang = metrics.lbearing < 0 ? - metrics.lbearing : 0;