generated from configure.in by autoconf.
[swftools.git] / pdf2swf / SWFOutputDev.cc
index 04676e1..b9454d0 100644 (file)
@@ -986,7 +986,8 @@ char*SWFOutputDev::writeEmbeddedFontToFile(XRef*ref, GfxFont*font)
       Type1CFontFile *cvt;
       Ref embRef;
       Object refObj, strObj;
-      tmpFileName = "/tmp/tmpfont";
+      char namebuf[512];
+      tmpFileName = mktmpname(namebuf);
       int ret;
 
       ret = font->getEmbeddedFontID(&embRef);
@@ -1055,25 +1056,25 @@ char*SWFOutputDev::writeEmbeddedFontToFile(XRef*ref, GfxFont*font)
              msg("<notice> File contains TrueType fonts");
              ttfinfo = 1;
          }
-         char name2[80];
+         char name2[512];
          char*tmp;
          tmp = strdup(mktmpname((char*)name2));
          sprintf(name2, "%s", tmp);
-         char*a[] = {"./ttf2pt1", "-W0",
+         char*a[] = {"./ttf2pt1", "-W", "0",
 #ifndef USE_FREETYPE
-             "-pttf",
+             "-p", "ttf",
 #else
-             "-pft",
+             "-p", "ft",
 #endif
              "-b", tmpFileName, name2};
-         msg("<verbose> Invoking %s %s %s %s %s %s",a[0],a[1],a[2],a[3],a[4],a[5]);
-         ttf2pt1_main(6,a);
+         msg("<verbose> Invoking %s %s %s %s %s %s %s %s",a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]);
+         ttf2pt1_main(8,a);
          unlink(tmpFileName);
          sprintf(name2,"%s.pfb",tmp);
          tmpFileName = strdup(name2);
       }
 
-    return tmpFileName;
+    return strdup(tmpFileName);
 }
 
 char* gfxFontName(GfxFont* gfxFont)
@@ -1292,7 +1293,7 @@ void SWFOutputDev::updateFont(GfxState *state)
        }
        this->t1id = T1_AddFont(fileName);
        if(this->t1id<0) {
-         msg("<error> Couldn't load font from file");
+         msg("<error> Couldn't load font from file %s", fileName);
          showFontError(gfxFont,0);
          unlinkfont(fileName);
          return ;