From 9bb0eb0e59ef6857da8932ea35833773a5374dc7 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 14 Apr 2018 13:40:46 +0300 Subject: [PATCH] Minor polishing of usage message and readme --- Readme | 19 ++++++++++--------- ttf2png.c | 18 +++++++++--------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Readme b/Readme index 436e6b3..3e9eb40 100644 --- a/Readme +++ b/Readme @@ -1,25 +1,25 @@ ttf2png - True Type Font to PNG converter -Copyright (c) 2004-2008 Mikko Rasa, Mikkosoft Productions +Copyright (c) 2004-2018 Mikko Rasa, Mikkosoft Productions Software requirements FreeType 2 -libpng 1.2 +libpng 1.6 C compiler (preferably GCC) Command-line options -r , - Range of characters to convert, specified as unicode code points. The + Range of code points to convert, specified as unicode code points. The default is 0,255, matching the ISO-8859-1 (Latin-1) character set. -s Font size to use. The default is 10 pixels. -l - Number of characters to put in one line. Defaults to autodetect. Ignored + Number of glyphs to put in one line. Defaults to autodetect. Ignored if -p is used. -c [x] @@ -42,7 +42,8 @@ Command-line options -i Invert colors of the glyphs. When rendering to alpha channel, only the - alpha channel is inverted. + alpha channel is inverted. The default is to render black glyphs on a + white background. -v Increase the level of verbosity. @@ -52,10 +53,10 @@ Command-line options each glyph is determined by its code point. Ignored if -p is used. -p - Pack the glyphs tightly in the image. One-pixel gaps are left between - glyphs. By default glyphs are rendered in a regular grid. Creating a - definition file is recommended, as the resulting image can seem rather - messy. + Pack the glyphs tightly in the image. Small gaps are left between glyphs, + controlled by the -n option. By default glyphs are rendered in a regular + grid. Creating a definition file is recommended, as the resulting image + can seem rather messy. -m Leave a margin around the edges of the generated image. By default glyphs diff --git a/ttf2png.c b/ttf2png.c index 96c3254..e8d794c 100644 --- a/ttf2png.c +++ b/ttf2png.c @@ -61,7 +61,7 @@ typedef struct sFont Image image; } Font; -void usage(); +void usage(void); unsigned round_to_pot(unsigned); void *alloc_image_data(size_t, size_t); int init_font(Font *, FT_Face, unsigned, unsigned, int); @@ -279,28 +279,28 @@ int main(int argc, char **argv) return 0; } -void usage() +void usage(void) { printf("ttf2png 1.1 - True Type Font to PNG converter\n" - "Copyright (c) 2004-2008 Mikko Rasa, Mikkosoft Productions\n" + "Copyright (c) 2004-2018 Mikko Rasa, Mikkosoft Productions\n" "Distributed under the GNU General Public License\n\n"); printf("Usage: ttf2png [options] \n\n"); printf("Accepted options (default values in [brackets])\n" - " -r Range of characters to convert [0,255]\n" + " -r Range of code points to convert [0,255]\n" " -s Font size to use, in pixels [10]\n" - " -l Number of characters to put in one line [auto]\n" - " -c Character cell size, in pixels [auto]\n" + " -l Number of glyphs to put in one line [auto]\n" + " -c Glyph cell size, in pixels (grid mode only) [auto]\n" " -o Output file name (or - for stdout) [font.png]\n"); printf(" -a Force autohinter\n" " -t Render glyphs to alpha channel\n" " -i Invert colors of the glyphs\n" " -v Increase the level of verbosity\n" - " -e Use cells in sequence, without gaps\n" + " -e Use cells in sequence, without gaps (grid mode only)\n" " -p Pack the glyphs tightly instead of in a grid\n" - " -m Margin around image edges in packed mode [0]\n" - " -n Padding between packed glyphs [1]\n" + " -m Margin around image edges (packed mode only) [0]\n" + " -n Padding between glyphs (packed mode only) [1]\n" " -d File name for writing glyph definitions\n" " -h Print this message\n"); } -- 2.43.0