From 5af2eb038322665d4bcc7875c549ead32d7ee67b Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Wed, 9 Feb 2022 06:56:14 +0200 Subject: Text: Double-wide Emoji in preformatted blocks Borrowed Emoji glyphs are laid out double-wide in monospace runs, because they most likely are wider than the monospace advance. --- src/ui/text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/text.c b/src/ui/text.c index e49034ca..c19aed2f 100644 --- a/src/ui/text.c +++ b/src/ui/text.c @@ -1450,7 +1450,7 @@ static void evenMonospaceAdvances_GlyphBuffer_(iGlyphBuffer *d, iFont *baseFont) if (d->glyphPos[i].x_advance > 0 && d->font != baseFont) { const iChar ch = d->logicalText[info->cluster]; if (isPictograph_Char(ch) || isEmoji_Char(ch)) { - const float dw = d->font->xScale * d->glyphPos[i].x_advance - monoAdvance; + const float dw = d->font->xScale * d->glyphPos[i].x_advance - (isEmoji_Char(ch) ? 2 : 1) * monoAdvance; d->glyphPos[i].x_offset -= dw / 2 / d->font->xScale - 1; d->glyphPos[i].x_advance -= dw / d->font->xScale - 1; } -- cgit v1.2.3