summaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-14 08:28:13 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-14 08:28:13 +0200
commit1613dd953fb8ad79d2d2b1e1a7181ec3c5704a70 (patch)
tree3009a84404e12345e5be7c379a5125927b2bc1b7 /src/ui
parent558fbc6e48c5c98a37ef38cdc9bafd173af955ac (diff)
Text: Monospace and zero-advance glyphs
Don't force the same advance on all glyphs, since some don't advance the position. IssueID #204
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/text.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ui/text.c b/src/ui/text.c
index 4a39bf72..abfefe80 100644
--- a/src/ui/text.c
+++ b/src/ui/text.c
@@ -1041,7 +1041,7 @@ static iRect run_Font_(iFont *d, const iRunArgs *args) {
1041 is monospaced. Except with Japanese script, that's larger than the normal monospace. */ 1041 is monospaced. Except with Japanese script, that's larger than the normal monospace. */
1042 const iBool useMonoAdvance = 1042 const iBool useMonoAdvance =
1043 monoAdvance > 0 && !isJapanese_FontId(fontId_Text_(glyph->font)); 1043 monoAdvance > 0 && !isJapanese_FontId(fontId_Text_(glyph->font));
1044 const float advance = (useMonoAdvance ? monoAdvance : glyph->advance); 1044 const float advance = (useMonoAdvance && glyph->advance > 0 ? monoAdvance : glyph->advance);
1045 if (!isMeasuring_(mode) && ch != 0x20 /* don't bother rendering spaces */) { 1045 if (!isMeasuring_(mode) && ch != 0x20 /* don't bother rendering spaces */) {
1046 if (useMonoAdvance && dst.w > advance && glyph->font != d && !isEmoji) { 1046 if (useMonoAdvance && dst.w > advance && glyph->font != d && !isEmoji) {
1047 /* Glyphs from a different font may need recentering to look better. */ 1047 /* Glyphs from a different font may need recentering to look better. */