]> git.tdb.fi Git - ttf2png.git/commitdiff
Add a default code point range if none were specified
authorMikko Rasa <tdb@tdb.fi>
Sat, 14 Apr 2018 14:17:30 +0000 (17:17 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sat, 14 Apr 2018 14:17:30 +0000 (17:17 +0300)
ttf2png.c

index 6224fc3419436c10c94bd2e1ec0198774fdc4270..236fe9e4ef3ad3e07c70e64ae3f6136027d0d06d 100644 (file)
--- a/ttf2png.c
+++ b/ttf2png.c
@@ -215,8 +215,17 @@ int main(int argc, char **argv)
                return 1;
        }
 
+       if(!n_ranges)
+       {
+               ranges = malloc(sizeof(Range));
+               ranges[0].first = 0;
+               ranges[0].last = 255;
+               n_ranges = 1;
+       }
+       else
+               sort_and_compact_ranges(ranges, &n_ranges);
+
        font.size = size;
-       sort_and_compact_ranges(ranges, &n_ranges);
        err = init_font(&font, face, ranges, n_ranges, autohinter);
        if(err)
                return 1;