From 909ee26e03d6a7f93b83fad9709139565a62629a Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 17 Nov 2021 11:39:18 +0100 Subject: Readd kerning --- src/graphics/font.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/graphics/font.c') diff --git a/src/graphics/font.c b/src/graphics/font.c index 1c3631d..17362f6 100644 --- a/src/graphics/font.c +++ b/src/graphics/font.c @@ -228,8 +228,6 @@ int mgl_font_get_glyph(mgl_font *self, uint32_t codepoint, mgl_font_glyph *glyph return res; } -int mgl_font_get_kerning(const mgl_font *self, uint32_t prev_codepoint, uint32_t codepoint) { - return 0; - /* TODO: */ - /*return stbtt_GetCodepointKernAdvance(self->font_info, prev_codepoint, codepoint);*/ +float mgl_font_get_kerning(const mgl_font *self, uint32_t prev_codepoint, uint32_t codepoint) { + return stbtt_GetCodepointKernAdvance(self->font_info, prev_codepoint, codepoint) * stbtt_ScaleForPixelHeight(self->font_info, self->character_size); } -- cgit v1.2.3