From d7364c7589542039d662589f654518ff628217db Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 14 Apr 2018 17:17:30 +0300 Subject: [PATCH] Add a default code point range if none were specified --- ttf2png.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ttf2png.c b/ttf2png.c index 6224fc3..236fe9e 100644 --- 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; -- 2.45.2