Commit 71a91515 authored by Eli Zaretskii's avatar Eli Zaretskii

* src/character.c (char_width): Support glyphs with faces. (Bug#32276)

parent 0feb6733
......@@ -34,6 +34,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
#include "lisp.h"
#include "character.h"
#include "buffer.h"
#include "dispextern.h"
#include "composite.h"
#include "disptab.h"
......@@ -288,13 +289,15 @@ char_width (int c, struct Lisp_Char_Table *dp)
if (VECTORP (disp))
for (i = 0, width = 0; i < ASIZE (disp); i++)
{
int c;
ch = AREF (disp, i);
if (CHARACTERP (ch))
{
int w = CHARACTER_WIDTH (XFASTINT (ch));
if (INT_ADD_WRAPV (width, w, &width))
string_overflow ();
}
if (GLYPH_CODE_P (ch))
c = GLYPH_CODE_CHAR (ch);
else if (CHARACTERP (ch))
c = XFASTINT (ch);
int w = CHARACTER_WIDTH (c);
if (INT_ADD_WRAPV (width, w, &width))
string_overflow ();
}
}
return width;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment