X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2Fpdf2swf.cc;h=8dad398bbdd2501af78b132c133a1685794e3194;hb=8c45842937d727e37c34c675b4957d9bf31111d5;hp=dc860d12ab0f7c1c74a8813e5017938ba799931d;hpb=5b8967c13b987c6438c23e2e1a25ef45864f02d2;p=swftools.git diff --git a/pdf2swf/pdf2swf.cc b/pdf2swf/pdf2swf.cc index dc860d1..8dad398 100644 --- a/pdf2swf/pdf2swf.cc +++ b/pdf2swf/pdf2swf.cc @@ -224,7 +224,8 @@ void args_callback_usage(char*name) printf("-p --pages=range Convert only pages in range\n"); printf("-P --password=password Use password for deciphering the pdf\n"); printf("-s --shapes Don't use SWF Fonts, but store everything as shape\n"); - printf("-i --ignore Ignore draw order (makes the SWF file smaller)\n"); + printf("-i --ignore Ignore draw order (makes the SWF file smaller, but may produce\n"); + printf(" graphic errors)\n"); printf("-j --jpegquality=quality Set quality of embedded jpeg pictures (default:85)\n"); printf("-v --verbose Be verbose. Use more than one -v for greater effect\n"); printf("-w --samewindow Don't open a new Browser Window for Links in the SWF\n"); @@ -250,6 +251,7 @@ void addfontdir(FILE*database, char* dirname, int*numfonts, char*searchpath) strcat(searchpath, ":"); strcat(searchpath, dirname); } + logf(" Adding %s to search path\n", dirname); DIR*dir = opendir(dirname); if(!dir) { @@ -261,34 +263,32 @@ void addfontdir(FILE*database, char* dirname, int*numfonts, char*searchpath) ent = readdir (dir); if (!ent) break; - if(ent->d_type == DT_REG) + int l; + char*name = ent->d_name; + char type = 0; + if(!name) continue; + l=strlen(name); + if(l<4) + continue; + if(!strncasecmp(&name[l-4], ".afm", 4)) + type=1; + if(!strncasecmp(&name[l-4], ".ttf", 4)) + type=2; + if(type) { - int l; - char*name = ent->d_name; - char type = 0; - if(!name) continue; - l=strlen(name); - if(l<4) - continue; - if(!strncasecmp(&name[l-4], ".afm", 4)) - type=1; - if(!strncasecmp(&name[l-4], ".ttf", 4)) - type=2; - if(type) - { - if(database && type==1) { - char buf[256],a; - FILE*fi; - sprintf(buf, "%s/%s", dirname,name); - fi = fopen(buf, "rb"); - if(!fi || !fread(&a,1,1,fi)) { - logf(" Couldn't read from %s", buf); - } - fprintf(database, "%s\n", name); - } - if(numfonts) - (*numfonts)++; - } + if(database && type==1) { + char buf[256],a; + FILE*fi; + sprintf(buf, "%s/%s", dirname,name); + fi = fopen(buf, "rb"); + if(!fi || !fread(&a,1,1,fi)) { + logf(" Couldn't read from %s", buf); + } + fprintf(database, "%s\n", buf); + logf(" Found font %s\n", buf); + } + if(numfonts) + (*numfonts)++; } } closedir(dir);