From: kramm Date: Sat, 30 Apr 2005 12:52:57 +0000 (+0000) Subject: * re-inserted font deletion X-Git-Tag: release-0-7-0~106 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=914bf80496d7fb81b0df3c5287f9ebbba16850a5;p=swftools.git * re-inserted font deletion * make sure we only log printable characters --- diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index 384ca75..38a746f 100644 --- a/pdf2swf/SWFOutputDev.cc +++ b/pdf2swf/SWFOutputDev.cc @@ -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);