1
0
mirror of git://projects.qi-hardware.com/antorcha.git synced 2024-12-23 03:14:36 +02:00

tools/ant-txt/ant-txt.c: new option -F to add font directories

This commit is contained in:
Werner Almesberger 2012-07-01 21:03:51 -03:00
parent 685cd809db
commit 817145bcdc

View File

@ -14,6 +14,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <assert.h>
#include <libtxt/libtxt.h>
@ -23,14 +24,30 @@
#define H 16
static void usage(const char *name)
{
fprintf(stderr, "usage: %s [-F font_dir ...] [text]\n", name);
exit(1);
}
int main(int argc, char **argv)
{
struct edit *edits = NULL, **last = &edits;
uint8_t *canvas;
const char *err;
int i, x, y;
int c;
for (i = 1; i != argc; i++) {
while ((c = getopt(argc, argv, "F:")) != EOF)
switch (c) {
case 'F':
add_font_dir(optarg);
break;
default:
usage(*argv);
}
for (i = optind; i != argc; i++) {
while (*last)
last = &(*last)->next;
if (edits) {