X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2FSWFOutputDev.cc;h=2728dcb24d87889f252dc3e0a713b89bdbfbef2e;hb=eea310f329b7409684f825c92a58dcc22b1de506;hp=52f00d04a88938dc46cdc6bf91b42cd5e5af03fe;hpb=89de887d9a11f7b8a42dcf68c13a1ffd384ced21;p=swftools.git diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index 52f00d0..2728dcb 100644 --- a/pdf2swf/SWFOutputDev.cc +++ b/pdf2swf/SWFOutputDev.cc @@ -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); @@ -1260,9 +1261,11 @@ char*SWFOutputDev::writeEmbeddedFontToFile(XRef*ref, GfxFont*font) } #ifdef XPDF_101 Type1CFontFile *cvt = new Type1CFontFile(fontBuf, fontLen); + if(!cvt) return 0; cvt->convertToType1(f); #else FoFiType1C *cvt = FoFiType1C::make(fontBuf, fontLen); + if(!cvt) return 0; cvt->convertToType1(NULL, gTrue, FoFiWrite, f); #endif //cvt->convertToCIDType0("test", f); @@ -1448,6 +1451,10 @@ char* SWFOutputDev::substituteFont(GfxFont*gfxFont, char* oldname) fontname = "Times-Roman"; } filename = searchFont(fontname); + if(!filename) { + msg(" Couldn't find font %s- did you install the default fonts?"); + return 0; + } if(substitutepos>=sizeof(substitutesource)/sizeof(char*)) { msg(" Too many fonts in file."); @@ -1547,7 +1554,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 +1966,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")) {