From e271c4518fd02c8dac2343ef0b9fd2cecd0812be Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Tue, 4 Feb 2020 14:53:49 +0100 Subject: fix text calculation and rendering floating error --- src/assets.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/assets.c') 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; -- cgit v1.2.3-70-g09d2