omit drawing of objects outside the page.
[swftools.git] / pdf2swf / SWFOutputDev.cc
index 52f00d0..770af0c 100644 (file)
@@ -88,6 +88,7 @@ static int pagepos = 0;
 /* config */
 static double caplinewidth = 3.0;
 static int zoom = 72; /* xpdf: 86 */
+static int forceType0Fonts = 0;
 
 static void printInfoString(Dict *infoDict, char *key, char *fmt);
 static void printInfoDate(Dict *infoDict, char *key, char *fmt);
@@ -1448,6 +1449,10 @@ char* SWFOutputDev::substituteFont(GfxFont*gfxFont, char* oldname)
        fontname = "Times-Roman";
     }
     filename = searchFont(fontname);
+    if(!filename) {
+       msg("<error> Couldn't find font %s- did you install the default fonts?");
+       return 0;
+    }
 
     if(substitutepos>=sizeof(substitutesource)/sizeof(char*)) {
        msg("<fatal> Too many fonts in file.");
@@ -1547,7 +1552,7 @@ void SWFOutputDev::updateFont(GfxState *state)
     if(embedded &&
        (gfxFont->getType() == fontType1 ||
        gfxFont->getType() == fontType1C ||
-       //gfxFont->getType() == fontCIDType0C ||
+       (gfxFont->getType() == fontCIDType0C && forceType0Fonts) ||
        gfxFont->getType() == fontTrueType ||
        gfxFont->getType() == fontCIDType2
        ))
@@ -1959,6 +1964,8 @@ void pdfswf_setparameter(char*name, char*value)
        caplinewidth = atof(value);
     } else if(!strcmp(name, "zoom")) {
        zoom = atoi(value);
+    } else if(!strcmp(name, "forceType0Fonts")) {
+       forceType0Fonts = atoi(value);
     } else if(!strcmp(name, "fontdir")) {
         pdfswf_addfontdir(value);
     } else if(!strcmp(name, "languagedir")) {