From: Mikko Rasa Date: Fri, 4 May 2018 21:06:54 +0000 (+0300) Subject: Slightly refactor how the font size is set X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=ab24ffddf38d00bdb474fb140cbd7001e4453608;p=ttf2png.git Slightly refactor how the font size is set --- diff --git a/ttf2png.c b/ttf2png.c index bf9f8d2..1c17c6b 100644 --- a/ttf2png.c +++ b/ttf2png.c @@ -220,7 +220,11 @@ int main(int argc, char **argv) printf("Glyphs: %ld\n", face->num_glyphs); } - err = FT_Set_Pixel_Sizes(face, 0, (distfield ? size*distfield : size)); + font.size = size; + if(distfield) + size *= distfield; + + err = FT_Set_Pixel_Sizes(face, 0, size); if(err) { fprintf(stderr, "Couldn't set size\n"); @@ -237,7 +241,6 @@ int main(int argc, char **argv) else sort_and_compact_ranges(ranges, &n_ranges); - font.size = size; err = init_font(&font, face, ranges, n_ranges, autohinter, distfield); if(err) return 1;