]> git.tdb.fi Git - ttf2png.git/commitdiff
Round kerning values to nearest integer rather than down
authorMikko Rasa <tdb@tdb.fi>
Thu, 3 May 2018 16:18:31 +0000 (19:18 +0300)
committerMikko Rasa <tdb@tdb.fi>
Thu, 3 May 2018 16:18:31 +0000 (19:18 +0300)
ttf2png.c

index eabe1ca93b588f6419c6ac76479cd44b4b99eef4..e890e33643084f7784c8d23e280555c425e8fec4 100644 (file)
--- a/ttf2png.c
+++ b/ttf2png.c
@@ -543,7 +543,7 @@ int init_font(Font *font, FT_Face face, const Range *ranges, unsigned n_ranges,
                                kern = &font->kerning[font->n_kerning++];
                                kern->left_code = font->glyphs[i].code;
                                kern->right_code = font->glyphs[j].code;
-                               kern->distance = kerning.x/64;
+                               kern->distance = (kerning.x+32)/64;
                        }
                }