aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/character.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/character.c b/src/character.c
index 60424fab71e..e44ab8d43b1 100644
--- a/src/character.c
+++ b/src/character.c
@@ -376,9 +376,13 @@ lisp_string_width (Lisp_Object string, ptrdiff_t from, ptrdiff_t to,
376 && find_automatic_composition (i, -1, &ignore, &end, &val, string) 376 && find_automatic_composition (i, -1, &ignore, &end, &val, string)
377 && end > i) 377 && end > i)
378 { 378 {
379 int pixelwidth = composition_gstring_width (val, 0, 379 int j;
380 LGSTRING_GLYPH_LEN (val), 380 for (j = 0; j < LGSTRING_GLYPH_LEN (val); j++)
381 NULL); 381 if (NILP (LGSTRING_GLYPH (val, j)))
382 break;
383
384 int pixelwidth = composition_gstring_width (val, 0, j, NULL);
385
382 /* The below is somewhat expensive, so compute it only once 386 /* The below is somewhat expensive, so compute it only once
383 for the entire loop, and only if needed. */ 387 for the entire loop, and only if needed. */
384 if (font_width < 0) 388 if (font_width < 0)