From: Po Lu Date: Tue, 19 Apr 2022 01:15:33 +0000 (+0000) Subject: Fix display of glyphless characters on Haiku X-Git-Tag: emacs-29.0.90~1931^2~418 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ace1f32ac1185cad0c43e4b793fe53b54be95161;p=emacs.git Fix display of glyphless characters on Haiku * src/haikuterm.c (haiku_draw_glyph_string_foreground): Fix pen size when drawing composite string w/o font. (haiku_draw_glyphless_glyph_string_foreground): Correctly display glyphless character rectangle. --- diff --git a/src/haikuterm.c b/src/haikuterm.c index 203bfa3f81a..9cd1d0f0158 100644 --- a/src/haikuterm.c +++ b/src/haikuterm.c @@ -1059,6 +1059,8 @@ haiku_draw_glyph_string_foreground (struct glyph_string *s) for (i = 0; i < s->nchars; ++i) { struct glyph *g = s->first_glyph + i; + + BView_SetPenSize (view, 1); BView_StrokeRectangle (view, x, s->y, g->pixel_width, s->height); x += g->pixel_width; @@ -1090,6 +1092,7 @@ haiku_draw_glyphless_glyph_string_foreground (struct glyph_string *s) unsigned char2b[8]; int x, i, j; struct face *face = s->face; + unsigned long color; /* If first glyph of S has a left box line, start drawing the text of S to the right of that box line. */ @@ -1153,11 +1156,21 @@ haiku_draw_glyphless_glyph_string_foreground (struct glyph_string *s) s->ybase + glyph->slice.glyphless.lower_yoff, false); } + if (glyph->u.glyphless.method != GLYPHLESS_DISPLAY_THIN_SPACE) - BView_FillRectangle (FRAME_HAIKU_VIEW (s->f), - x, s->ybase - glyph->ascent, - glyph->pixel_width - 1, - glyph->ascent + glyph->descent - 1); + { + if (s->hl == DRAW_CURSOR) + haiku_merge_cursor_foreground (s, NULL, &color); + else + color = s->face->foreground; + + BView_SetHighColor (FRAME_HAIKU_VIEW (s->f), color); + BView_SetPenSize (FRAME_HAIKU_VIEW (s->f), 1); + BView_StrokeRectangle (FRAME_HAIKU_VIEW (s->f), + x, s->ybase - glyph->ascent, + glyph->pixel_width - 1, + glyph->ascent + glyph->descent - 1); + } x += glyph->pixel_width; } }