X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=pdf2swf%2Fpdf2swf.cc;h=5558e4d0d66e948291bf3e32b9e737369e7becca;hb=e8aea812fa749bafe738f83c8ab76a33a00667a7;hp=551022684f6d3a26e684013454d637c1fdf40482;hpb=7acd26366eed088b19ac8ba51b916002f67fcf5b;p=swftools.git diff --git a/pdf2swf/pdf2swf.cc b/pdf2swf/pdf2swf.cc index 5510226..5558e4d 100644 --- a/pdf2swf/pdf2swf.cc +++ b/pdf2swf/pdf2swf.cc @@ -39,7 +39,6 @@ #include "SWFOutputDev.h" #include "log.h" -#define FONTDIR concatPaths(getInstallationPath(), "fonts") #define SWFDIR concatPaths(getInstallationPath(), "swfs") static char * outputname = 0; @@ -439,17 +438,24 @@ int main(int argn, char *argv[]) char t1searchpath[1024]; int nup_pos = 0; int x,y; + char* installPath = getInstallationPath(); + char* fontdir = 0; initLog(0,-1,0,0,-1,loglevel); #if defined(WIN32) && defined(HAVE_STAT) && defined(HAVE_SYS_STAT_H) - FILE*test = fopen(concatPaths(FONTDIR,"\\d050000l.afm"), "rb"); - if(!test) { - fprintf(stderr, "Couldn't find file %s - pdf2swf not installed properly? OS says:\n", concatPaths(FONTDIR, "\\d050000l.afm")); - perror("open"); - exit(1); + if(installPath) { + fontdir = concatPaths(installPath, "fonts"); + FILE*test = fopen(concatPaths(fontdir,"\\d050000l.afm"), "rb"); + if(!test) { + fprintf(stderr, "Couldn't find file %s - pdf2swf not installed properly? OS says:\n", concatPaths(fontdir, "\\d050000l.afm")); + perror("open"); + exit(1); + } + fclose(test); } - fclose(test); +#else + fontdir = concatPaths(installPath, "fonts"); #endif #ifdef HAVE_SRAND48 @@ -490,7 +496,9 @@ int main(int argn, char *argv[]) } /* add fonts */ - pdfswf_addfontdir(FONTDIR); + if(fontdir) { + pdfswf_addfontdir(fontdir); + } for(t=0;t