From 65a1786c01a70b5e254eeff71b70357f8c581b63 Mon Sep 17 00:00:00 2001 From: arpi Date: Mon, 6 Aug 2001 00:22:13 +0000 Subject: [PATCH] DATADIR/font/ patch by Adam Tla/lka atlka@pg.gda.pl git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1447 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/font_load.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libvo/font_load.c b/libvo/font_load.c index 6204bee3f3..c19c432537 100644 --- a/libvo/font_load.c +++ b/libvo/font_load.c @@ -2,6 +2,9 @@ #include #include #include +#include +#include +#include #include "config.h" #include "font_load.h" @@ -42,6 +45,7 @@ unsigned char sor[1024]; 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 @@ int version=0; 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;