0
0
mirror of https://github.com/mpv-player/mpv.git synced 2024-09-20 12:02:23 +02:00

--outdir added

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4936 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
alex 2002-03-03 19:18:42 +00:00
parent c0b53cbd69
commit f9a117db99

View File

@ -46,6 +46,8 @@ double thickness = 1.5; /* outline thickness */
char* font_desc = "font.desc";
//char* font_desc = "/dev/stdout";
char *outdir = ".";
//// constants
int const colors = 256;
int const maxcolor = 255;
@ -122,7 +124,7 @@ void write_bitmap(void *buffer, char type) {
int const max_name = 128;
char name[max_name];
snprintf(name, max_name, "%s-%c.raw", encoding_name, type);
snprintf(name, max_name, "%s/%s-%c.raw", outdir, encoding_name, type);
f = fopen(name, "wb");
if (f==NULL) ERROR("fopen failed.");
write_header(f);
@ -228,7 +230,13 @@ void render() {
/* create font.desc */
f = fopen(font_desc, append_mode ? "a":"w");
{
int const max_name = 128;
char name[max_name];
snprintf(name, max_name, "%s/%s", outdir, font_desc);
f = fopen(name, append_mode ? "a":"w");
}
if (f==NULL) ERROR("fopen failed.");
@ -668,10 +676,11 @@ void alpha() {
void usage() {
printf("Usage: %s [--append] [--unicode] [--blur b] [--outline o] encoding ppem font\n", command);
printf("Usage: %s [--outdir dir] [--append] [--unicode] [--blur b] [--outline o] encoding ppem font\n", command);
printf("\n"
" Program creates 3 files: font.desc, <encoding>-a.raw, <encoding>-b.raw.\n"
"\n"
" --outdir output directory to place files.\n"
" --append append results to existing font.desc, suppress info header.\n"
" --unicode use Unicode in font.desc. This will work with -utf8 option of mplayer.\n"
" --blur b specify blur radius, float.\n"
@ -694,6 +703,14 @@ void parse_args(int argc, char **argv) {
else ++command;
++a; --argc;
if (argc>=1 && strcmp(argv[a], "--outdir")==0) {
++a; --argc;
if (argc==0) usage();
outdir = strdup(argv[a]);
++a; --argc;
}
if (argc>=1 && strcmp(argv[a], "--append")==0) {
append_mode = 1;
++a; --argc;