From 39f7a369c701565b6418cc9d0a32c1ad489b887d Mon Sep 17 00:00:00 2001 From: Olli Wang Date: Tue, 23 Aug 2016 10:24:32 +0800 Subject: [PATCH] Fixes the kerning value for freetype. This commit fixes issue #302 that the kerning value returned by freetype is not converted to integer properly. --- src/fontstash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fontstash.h b/src/fontstash.h index b797ef1..35dfb0f 100644 --- a/src/fontstash.h +++ b/src/fontstash.h @@ -235,7 +235,7 @@ int fons__tt_getGlyphKernAdvance(FONSttFontImpl *font, int glyph1, int glyph2) { FT_Vector ftKerning; FT_Get_Kerning(font->font, glyph1, glyph2, FT_KERNING_DEFAULT, &ftKerning); - return (int)ftKerning.x; + return (int)((ftKerning.x + 32) >> 6); // Round up and convert to integer } #else