aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2018-07-27 12:33:29 +0300
committerEli Zaretskii2018-07-27 12:33:29 +0300
commit71a915153a5b4818f0a3cdebb7a1afb4fe6de374 (patch)
treeb2818b16109e5eaefd0580eb13831f5656c31689 /src
parent0feb6733d4bea5f360abc3f64bfc5b9b29087c48 (diff)
downloademacs-71a915153a5b4818f0a3cdebb7a1afb4fe6de374.tar.gz
emacs-71a915153a5b4818f0a3cdebb7a1afb4fe6de374.zip
* src/character.c (char_width): Support glyphs with faces. (Bug#32276)
Diffstat (limited to 'src')
-rw-r--r--src/character.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/character.c b/src/character.c
index deac1fa22ec..48268e04947 100644
--- a/src/character.c
+++ b/src/character.c
@@ -34,6 +34,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
34#include "lisp.h" 34#include "lisp.h"
35#include "character.h" 35#include "character.h"
36#include "buffer.h" 36#include "buffer.h"
37#include "dispextern.h"
37#include "composite.h" 38#include "composite.h"
38#include "disptab.h" 39#include "disptab.h"
39 40
@@ -288,13 +289,15 @@ char_width (int c, struct Lisp_Char_Table *dp)
288 if (VECTORP (disp)) 289 if (VECTORP (disp))
289 for (i = 0, width = 0; i < ASIZE (disp); i++) 290 for (i = 0, width = 0; i < ASIZE (disp); i++)
290 { 291 {
292 int c;
291 ch = AREF (disp, i); 293 ch = AREF (disp, i);
292 if (CHARACTERP (ch)) 294 if (GLYPH_CODE_P (ch))
293 { 295 c = GLYPH_CODE_CHAR (ch);
294 int w = CHARACTER_WIDTH (XFASTINT (ch)); 296 else if (CHARACTERP (ch))
295 if (INT_ADD_WRAPV (width, w, &width)) 297 c = XFASTINT (ch);
296 string_overflow (); 298 int w = CHARACTER_WIDTH (c);
297 } 299 if (INT_ADD_WRAPV (width, w, &width))
300 string_overflow ();
298 } 301 }
299 } 302 }
300 return width; 303 return width;