From 03d9d18513b6ec50d0022f09d040ce330c918fff Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 5 Feb 2023 13:57:10 +0200 Subject: [PATCH] Fix display of raised/lowered composed text * src/xdisp.c (fill_gstring_glyph_string): Adjust the base line of the glyph string due to subscript/superscript. (Bug#61290) --- src/xdisp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/xdisp.c b/src/xdisp.c index d2c91e5847b..a19c9908616 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -29317,6 +29317,7 @@ fill_gstring_glyph_string (struct glyph_string *s, int face_id, int start, int end, int overlaps) { struct glyph *glyph, *last; + int voffset; Lisp_Object lgstring; int i; bool glyph_not_available_p; @@ -29324,6 +29325,7 @@ fill_gstring_glyph_string (struct glyph_string *s, int face_id, s->for_overlaps = overlaps; glyph = s->row->glyphs[s->area] + start; last = s->row->glyphs[s->area] + end; + voffset = glyph->voffset; glyph_not_available_p = glyph->glyph_not_available_p; s->cmp_id = glyph->u.cmp.id; s->cmp_from = glyph->slice.cmp.from; @@ -29374,6 +29376,9 @@ fill_gstring_glyph_string (struct glyph_string *s, int face_id, if (glyph_not_available_p) s->font_not_found_p = true; + /* Adjust base line for subscript/superscript text. */ + s->ybase += voffset; + return glyph - s->row->glyphs[s->area]; }