diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/font.c | 11 | ||||
-rw-r--r-- | src/font.h | 5 | ||||
-rw-r--r-- | src/main.c | 4 |
3 files changed, 20 insertions, 0 deletions
@@ -22,6 +22,7 @@ #include "font.h" #include <limits.h> +#include <stdio.h> #include <string.h> #include <png.h> @@ -47,6 +48,16 @@ static const struct font_desc *fonts[] = { &font_mplus_1mn_regular_16x22, }; +void +font_list(FILE *stream) +{ + size_t i; + + for (i = 0; i < *(&fonts + 1) - fonts; ++i) { + fprintf(stream, "%s\n", fonts[i]->name); + } +} + struct font * font_default(void) { @@ -22,10 +22,15 @@ #ifndef FONT_H_ #define FONT_H_ +#include <stdio.h> + #include <png.h> #include <linux/font.h> +void +font_list(FILE *stream); + struct font * font_default(void) __attribute__((pure)); @@ -60,6 +60,10 @@ main(int argc, char **argv) while ((opt = getopt(argc, argv, "f:w:h:")) != -1) { switch (opt) { case 'f': + if (strcmp(optarg, "list") == 0) { + font_list(stdout); + return 0; + } font = font_find(optarg); if (!font) { fprintf(stderr, _("Font \"%s\" not " |