mirror of
git://projects.qi-hardware.com/antorcha.git
synced 2024-11-01 07:24:58 +02:00
tools/ant-txt/ant-txt.c: new option -F to add font directories
This commit is contained in:
parent
685cd809db
commit
817145bcdc
@ -14,6 +14,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <libtxt/libtxt.h>
|
#include <libtxt/libtxt.h>
|
||||||
@ -23,14 +24,30 @@
|
|||||||
#define H 16
|
#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)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
struct edit *edits = NULL, **last = &edits;
|
struct edit *edits = NULL, **last = &edits;
|
||||||
uint8_t *canvas;
|
uint8_t *canvas;
|
||||||
const char *err;
|
const char *err;
|
||||||
int i, x, y;
|
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)
|
while (*last)
|
||||||
last = &(*last)->next;
|
last = &(*last)->next;
|
||||||
if (edits) {
|
if (edits) {
|
||||||
|
Loading…
Reference in New Issue
Block a user