* only store fonts with valid names in substitute table.
authorkramm <kramm>
Fri, 23 Nov 2001 16:45:53 +0000 (16:45 +0000)
committerkramm <kramm>
Fri, 23 Nov 2001 16:45:53 +0000 (16:45 +0000)
* in updateFont, do return if we would call swfoutput_setfont with a
  negative t1id.

pdf2swf/SWFOutputDev.cc

index 5d53fbd..41eda26 100644 (file)
@@ -973,10 +973,12 @@ char* SWFOutputDev::substituteFont(GfxFont*gfxFont, char* oldname)
          logf("<fatal> Too many fonts in file.");
          exit(1);
       }
-      substitutesource[substitutepos] = oldname;
-      substitutetarget[substitutepos] = fontname;
-      logf("<verbose> substituting %s -> %s", oldname, fontname);
-      substitutepos ++;
+      if(oldname) {
+         substitutesource[substitutepos] = oldname;
+         substitutetarget[substitutepos] = fontname;
+         logf("<verbose> substituting %s -> %s", oldname, fontname);
+         substitutepos ++;
+      }
       return fontname;
 }
 
@@ -1080,6 +1082,7 @@ void SWFOutputDev::updateFont(GfxState *state)
 
   if(t1id<0) {
       showFontError(gfxFont,0);
+      return;
   }
  
   /* we may have done some substitutions here, so check