]> git.tdb.fi Git - ttf2png.git/commitdiff
Slightly refactor how the font size is set
authorMikko Rasa <tdb@tdb.fi>
Fri, 4 May 2018 21:06:54 +0000 (00:06 +0300)
committerMikko Rasa <tdb@tdb.fi>
Fri, 4 May 2018 21:06:54 +0000 (00:06 +0300)
ttf2png.c

index bf9f8d2c728a78f41032078661b88de8960c7f46..1c17c6b16b11795d07a58e524e800a68d6e263df 100644 (file)
--- 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;