From: Mikko Rasa Date: Fri, 23 Nov 2012 19:23:52 +0000 (+0200) Subject: Correctly interpret a single number given to -c X-Git-Tag: 1.0~5 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=6def1722d1157378ddd6c6ef53673865510e3ed0;p=ttf2png.git Correctly interpret a single number given to -c --- 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':