summaryrefslogtreecommitdiff
path: root/txttopng.c
diff options
context:
space:
mode:
authorJens Schweikhardt <schweikh@schweikhardt.net>2025-08-31 11:19:44 +0200
committerJens Schweikhardt <schweikh@schweikhardt.net>2025-08-31 11:19:44 +0200
commit1ba7b3a044045ea2aa91dd46acc3a1b4531a8bc1 (patch)
treef09f7fbc3f8d1c600ca03e7350aeea445c51b3e4 /txttopng.c
parent1abec752a5f4d50ff1e77c870a63a2a194ab8374 (diff)
Replace renumber.pl with hextosrc.c. Improved TTF.
* Introduce VERSION and HASH for utility programs. * Fontlint complained about the + in BDF U+1234 character names, so I changed them to U1234.
Diffstat (limited to 'txttopng.c')
-rw-r--r--txttopng.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/txttopng.c b/txttopng.c
index bac5900..22371ed 100644
--- a/txttopng.c
+++ b/txttopng.c
@@ -27,6 +27,13 @@
/* From libpng; on FreeBSD: /usr/ports/graphics/png. */
#include <png.h>
+#ifndef HASH
+#define HASH "(undefined)"
+#endif
+#ifndef VERSION
+#define VERSION "(undefined)"
+#endif
+
/* Default option values. */
#define TextFilename "input.txt"
#define FontFilename "jsgallant.hex"
@@ -112,8 +119,12 @@ int main(int aArgc, char **aArgv) {
//
void parse_options(int aArgc, char **aArgv) {
int ch;
- while ((ch = getopt(aArgc, aArgv, "f:hip:T:t:")) != -1) {
+ while ((ch = getopt(aArgc, aArgv, "f:hip:T:t:V")) != -1) {
switch (ch) {
+ case 'V':
+ printf("%s version %s, hash %s\n", aArgv[0], VERSION, HASH);
+ exit (EXIT_SUCCESS);
+ break;
case 'f':
gFontFilename = optarg;
break;