Browse Source

Fixes the kerning value for freetype.

This commit fixes issue #302 that the kerning value returned by freetype is not converted to integer properly.
shared-context
Olli Wang 8 years ago
parent
commit
39f7a369c7
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/fontstash.h

+ 1
- 1
src/fontstash.h View File

@@ -235,7 +235,7 @@ int fons__tt_getGlyphKernAdvance(FONSttFontImpl *font, int glyph1, int glyph2)
{ {
FT_Vector ftKerning; FT_Vector ftKerning;
FT_Get_Kerning(font->font, glyph1, glyph2, FT_KERNING_DEFAULT, &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 #else


Loading…
Cancel
Save