From ab24ffddf38d00bdb474fb140cbd7001e4453608 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 5 May 2018 00:06:54 +0300 Subject: [PATCH] Slightly refactor how the font size is set --- ttf2png.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; -- 2.45.2