X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=pdf2swf%2FSWFOutputDev.cc;h=fd753d5515bc490eb406ce07cf3bdbe4b4da4040;hb=cce86d4b24360a411145935ab6375e324ebec1c1;hp=384ca7547f08f7fc77378e3a0e1fcff9a4bc4447;hpb=87cb7adfdd62489ece9ebf4f17723608086e262d;p=swftools.git diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index 384ca75..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); @@ -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);