added check against bad fonts.
authorkramm <kramm>
Thu, 12 Aug 2004 12:57:29 +0000 (12:57 +0000)
committerkramm <kramm>
Thu, 12 Aug 2004 12:57:29 +0000 (12:57 +0000)
pdf2swf/swfoutput.cc

index 7fc1b3a..525b1e2 100644 (file)
@@ -1059,6 +1059,12 @@ void swfoutput_setfont(struct swfoutput*obj, char*fontid, char*filename)
     swf_SetLoadFontParameters(32, 0);
 
     SWFFONT *swffont = swf_LoadFont(filename);
+
+    if(!swffont) {
+       msg("<error> Coudln't load font %s (%s)", fontid, filename);
+       swffont = swf_LoadFont(0);
+    }
+
     swf_FontSetID(swffont, ++currentswfid);
     
     if(screenloglevel >= LOGLEVEL_DEBUG)  {