summaryrefslogtreecommitdiff
path: root/src/assets.c
diff options
context:
space:
mode:
authorAldrik Ramaekers <aldrik.ramaekers@protonmail.com>2020-02-04 14:53:49 +0100
committerAldrik Ramaekers <aldrik.ramaekers@protonmail.com>2020-02-04 14:53:49 +0100
commite271c4518fd02c8dac2343ef0b9fd2cecd0812be (patch)
tree74b79885021d97ef83dd25bb596f8a20b090c4ce /src/assets.c
parent3cb8d5ce252c246e2218a05968dc10db38116994 (diff)
fix text calculation and rendering floating error
Diffstat (limited to 'src/assets.c')
-rw-r--r--src/assets.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/assets.c b/src/assets.c
index 0ba6192..d5f1540 100644
--- a/src/assets.c
+++ b/src/assets.c
@@ -129,6 +129,10 @@ bool assets_queue_worker_load_font(font *font)
new_glyph.xoff = xoff;
new_glyph.yoff = yoff;
+ stbtt_GetCodepointHMetrics(&info, i, &new_glyph.advance, &new_glyph.lsb);
+ new_glyph.advance *= scale;
+ new_glyph.lsb *= scale;
+
if (i == 'M') font->px_h = -yoff;
font->glyphs[i-TEXT_CHARSET_START] = new_glyph;