Mercurial > mplayer.hg
changeset 1446:a49fd85fc431
DATADIR/font/ patch by Adam Tla/lka atlka@pg.gda.pl
author | arpi |
---|---|
date | Mon, 06 Aug 2001 00:22:13 +0000 |
parents | 577061920134 |
children | e82fbd67ae60 |
files | libvo/font_load.c |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/libvo/font_load.c Mon Aug 06 00:11:41 2001 +0000 +++ b/libvo/font_load.c Mon Aug 06 00:22:13 2001 +0000 @@ -2,6 +2,9 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> #include "config.h" #include "font_load.h" @@ -42,6 +45,7 @@ unsigned char sor2[1024]; font_desc_t *desc; FILE *f; +struct stat fstate; char section[64]; int i,j; int chardb=0; @@ -51,10 +55,12 @@ desc=malloc(sizeof(font_desc_t));if(!desc) return NULL; memset(desc,0,sizeof(font_desc_t)); -desc->fpath=get_path("font/"); - f=fopen(fname,"rt");if(!f){ printf("font: can't open file: %s\n",fname); return NULL;} +desc->fpath=get_path("font/"); + +if (stat(desc->fpath, &fstate)!=0) desc->fpath=DATADIR"/font"; + // set up some defaults, and erase table desc->charspace=2; desc->spacewidth=12;