X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2FSWFOutputDev.cc;h=fd753d5515bc490eb406ce07cf3bdbe4b4da4040;hb=8451385a196293f2d9ce889040e649c310ee6632;hp=182fc28624654fdf501dae00765e12f5f0c7b317;hpb=38c5fe6bf5ef098a6c30df8e8215412f40a0634d;p=swftools.git diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index 182fc28..fd753d5 100644 --- a/pdf2swf/SWFOutputDev.cc +++ b/pdf2swf/SWFOutputDev.cc @@ -90,7 +90,7 @@ static int pagepos = 0; /* config */ static double caplinewidth = 3.0; static int zoom = 72; /* xpdf: 86 */ -static int forceType0Fonts = 0; +static int forceType0Fonts = 1; static void printInfoString(Dict *infoDict, char *key, char *fmt); static void printInfoDate(Dict *infoDict, char *key, char *fmt); @@ -303,7 +303,7 @@ class InfoOutputDev: public OutputDev GfxFont*font = state->getFont(); if(!font) return; - char*id = getFontID(font); + /*char*id = getFontID(font);*/ /* FIXME*/ num_fonts++; } @@ -862,6 +862,32 @@ GBool SWFOutputDev::useGradients() char*renderModeDesc[]= {"fill", "stroke", "fill+stroke", "invisible", "clip+fill", "stroke+clip", "fill+stroke+clip", "clip"}; +static char tmp_printstr[4096]; +char* makeStringPrintable(char*str) +{ + int len = strlen(str); + int dots = 0; + if(len>=80) { + len = 80; + dots = 1; + } + int t; + for(t=0;t124) { + c = '.'; + } + tmp_printstr[t] = c; + } + if(dots) { + tmp_printstr[len++] = '.'; + tmp_printstr[len++] = '.'; + tmp_printstr[len++] = '.'; + } + tmp_printstr[len] = 0; + return tmp_printstr; +} + void SWFOutputDev::beginString(GfxState *state, GString *s) { int render = state->getRender(); @@ -873,7 +899,7 @@ void SWFOutputDev::beginString(GfxState *state, GString *s) m21 *= state->getHorizScaling(); swfoutput_setfontmatrix(&output, m11, -m21, m12, -m22); if(render != 3 && render != 0) - msg(" Text rendering mode %d (%s) not fully supported yet (for text \"%s\")", render, renderModeDesc[render&7], s->getCString()); + msg(" Text rendering mode %d (%s) not fully supported yet (for text \"%s\")", render, renderModeDesc[render&7], makeStringPrintable(s->getCString())); states[statepos].textRender = render; } @@ -1658,8 +1684,8 @@ void SWFOutputDev::updateFont(GfxState *state) swfoutput_setfont(&output, fontid, fileName); - /*if(fileName && del) - unlinkfont(fileName);*/ + if(fileName && del) + unlinkfont(fileName); if(fileName) free(fileName); free(fontid);