diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2022-02-09 06:56:14 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2022-02-09 06:56:14 +0200 |
commit | 5af2eb038322665d4bcc7875c549ead32d7ee67b (patch) | |
tree | 9ddbdffb0e49727480d301f2c8dcf6b62931f77e /src/ui | |
parent | 5f8b5693607e2bd65a99e7c589c69cee37925a33 (diff) |
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.
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/text.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) | |||
1450 | if (d->glyphPos[i].x_advance > 0 && d->font != baseFont) { | 1450 | if (d->glyphPos[i].x_advance > 0 && d->font != baseFont) { |
1451 | const iChar ch = d->logicalText[info->cluster]; | 1451 | const iChar ch = d->logicalText[info->cluster]; |
1452 | if (isPictograph_Char(ch) || isEmoji_Char(ch)) { | 1452 | if (isPictograph_Char(ch) || isEmoji_Char(ch)) { |
1453 | const float dw = d->font->xScale * d->glyphPos[i].x_advance - monoAdvance; | 1453 | const float dw = d->font->xScale * d->glyphPos[i].x_advance - (isEmoji_Char(ch) ? 2 : 1) * monoAdvance; |
1454 | d->glyphPos[i].x_offset -= dw / 2 / d->font->xScale - 1; | 1454 | d->glyphPos[i].x_offset -= dw / 2 / d->font->xScale - 1; |
1455 | d->glyphPos[i].x_advance -= dw / d->font->xScale - 1; | 1455 | d->glyphPos[i].x_advance -= dw / d->font->xScale - 1; |
1456 | } | 1456 | } |