From 9fde33bb6f8149cc8dee7ac626b8b56f9f1cd14e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20Ker=C3=A4nen?= Date: Thu, 3 Dec 2020 15:23:18 +0200 Subject: [PATCH 1/1] Fixed misaligned Unicode box lines IssueID #82 --- src/ui/text.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ui/text.c b/src/ui/text.c index a8be1778..686927b1 100644 --- a/src/ui/text.c +++ b/src/ui/text.c @@ -735,7 +735,8 @@ static iRect run_Font_(iFont *d, enum iRunMode mode, iRangecc text, size_t maxLe monoAdvance > 0 && !isJapanese_FontId(fontId_Text_(glyph->font)); const float advance = (useMonoAdvance ? monoAdvance : glyph->advance); if (!isMeasuring_(mode)) { - if (useMonoAdvance && dst.w > advance) { + if (useMonoAdvance && dst.w > advance && glyph->font != d) { + /* Glyphs from a different font may need recentering to look better. */ dst.x -= (dst.w - advance) / 2; } SDL_RenderCopy(text_.render, text_.cache, (const SDL_Rect *) &glyph->rect[hoff], &dst); -- 2.34.1