diff options
Diffstat (limited to 'hextobdf.c')
| -rw-r--r-- | hextobdf.c | 18 |
1 files changed, 15 insertions, 3 deletions
@@ -19,6 +19,13 @@ #include <wchar.h> #include <unistd.h> +#ifndef HASH +#define HASH "(undefined)" +#endif +#ifndef VERSION +#define VERSION "(undefined)" +#endif + #define PixelWidth 12 #define PixelHeight 22 #define MAX_LINE 1024 @@ -102,8 +109,8 @@ void output_bdf_preamble(void) { // Output data for a single STARTCHAR to stdout. // void output_bdf_char(int aChar) { - size_t hexdigits; - printf("STARTCHAR U+%04x\n", gGlyph[aChar].codepoint); + size_t hexdigits; + printf("STARTCHAR U%04x\n", gGlyph[aChar].codepoint); printf("ENCODING %d\n", gGlyph[aChar].codepoint); if (wcwidth(gGlyph[aChar].codepoint) == 2) { puts("SWIDTH 1000 0\nDWIDTH 24 0\nBBX 24 22 0 -5"); @@ -152,8 +159,12 @@ void parse_font_line(const char *aLine, struct glyph *aGlyph) { // void parse_options(int aArgc, char **aArgv) { int ch; - while ((ch = getopt(aArgc, aArgv, "w:h:")) != -1) { + while ((ch = getopt(aArgc, aArgv, "Vw:h:")) != -1) { switch (ch) { + case 'V': + printf("%s version %s, hash %s\n", aArgv[0], VERSION, HASH); + exit (EXIT_SUCCESS); + break; case 'h': if (sscanf(optarg, "%zu", &gHeight) != 1) errx("can't convert '%s' to height integer\n", optarg); @@ -195,6 +206,7 @@ void parse_font_dimensions(FILE *aFile) { void usage(int aStatus) { fprintf(stderr, "usage: hextobdf [options]\n"); fprintf(stderr, "Options [default]:\n"); + fprintf(stderr, " -V output version/hash and exit\n"); fprintf(stderr, " -h height height in pixels [%d]\n", PixelHeight); fprintf(stderr, " -w width width in pixels [%d]\n", PixelWidth); fprintf(stderr, "\nReads hex font from stdin and writes bdf font to stdout\n"); |
