# HG changeset patch # User arpi # Date 997057333 0 # Node ID a49fd85fc4315252356ce0033e42729385fe083f # Parent 577061920134b5a5d79884fd919df68ceb1cf0bc DATADIR/font/ patch by Adam Tla/lka atlka@pg.gda.pl diff -r 577061920134 -r a49fd85fc431 libvo/font_load.c --- 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 #include #include +#include +#include +#include #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;