From 6def1722d1157378ddd6c6ef53673865510e3ed0 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 23 Nov 2012 21:23:52 +0200 Subject: [PATCH] Correctly interpret a single number given to -c --- Readme | 9 +++++---- ttf2png.c | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Readme b/Readme index 36728d7..111f53c 100644 --- a/Readme +++ b/Readme @@ -22,10 +22,11 @@ Command-line options Number of characters to put in one line. Defaults to autodetect. Ignored if -p is used. - -c - Character cell size. The special values auto and autorect may be used to - choose an autodetected square or rectangle cell, respectively. Defaults to - autodetected square. Ignored if -p is used. + -c [x] + Character cell size. If only a single number is given, a square cell is + used. The special values auto and autorect may be used to choose an + autodetected square or rectangle cell, respectively. The default is auto. + Ignored if -p is used. -o Output file name. Use - for stdout; the output is a png image, so it's diff --git a/ttf2png.c b/ttf2png.c index ebc0ccc..1b1106a 100644 --- a/ttf2png.c +++ b/ttf2png.c @@ -159,6 +159,8 @@ int main(int argc, char **argv) cellw = strtol(optarg, &ptr, 0); if(ptr[0]=='x' && isdigit(ptr[1])) cellh = strtol(ptr+1, NULL, 0); + else + cellh = cellw; } break; case 'o': -- 2.45.2