1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-20 05:42:19 +00:00

if not found using fpath try to load font bitmaps from default dir

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2239 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
atlka 2001-10-17 15:15:30 +00:00
parent 9e5dde93d4
commit e0501da664

View File

@ -139,6 +139,7 @@ while(fgets(sor,1020,f)){
} else
if(strcmp(section,"[files]")==0){
char *default_dir=DATADIR"/font";
if(pdb==2 && strcmp(p[0],"alpha")==0){
char *cp;
if (!(cp=malloc(strlen(desc->fpath)+strlen(p[1])+2))) return NULL;
@ -146,9 +147,16 @@ while(fgets(sor,1020,f)){
snprintf(cp,strlen(desc->fpath)+strlen(p[1])+2,"%s/%s",
desc->fpath,p[1]);
if(!((desc->pic_a[fontdb]=load_raw(cp,verbose)))){
printf("Can't load font bitmap: %s\n",p[1]);
free(cp);
return NULL;
if (!(cp=malloc(strlen(default_dir)+strlen(p[1])+2)))
return NULL;
snprintf(cp,strlen(default_dir)+strlen(p[1])+2,"%s/%s",
default_dir,p[1]);
if (!((desc->pic_a[fontdb]=load_raw(cp,verbose)))){
printf("Can't load font bitmap: %s\n",p[1]);
free(cp);
return NULL;
}
}
free(cp);
continue;
@ -160,9 +168,16 @@ while(fgets(sor,1020,f)){
snprintf(cp,strlen(desc->fpath)+strlen(p[1])+2,"%s/%s",
desc->fpath,p[1]);
if(!((desc->pic_b[fontdb]=load_raw(cp,verbose)))){
printf("Can't load font bitmap: %s\n",p[1]);
free(cp);
return NULL;
if (!(cp=malloc(strlen(default_dir)+strlen(p[1])+2)))
return NULL;
snprintf(cp,strlen(default_dir)+strlen(p[1])+2,"%s/%s",
default_dir,p[1]);
if (!((desc->pic_b[fontdb]=load_raw(cp,verbose)))){
printf("Can't load font bitmap: %s\n",p[1]);
free(cp);
return NULL;
}
}
free(cp);
continue;