X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=pdf2swf%2FSWFOutputDev.cc;h=b9454d01522f9d3cc18118b91de5cb526cba5f62;hb=100b970fba13286c2c160f876738a5b525581117;hp=b0472ba053d40fac9dd9c4ef61a290a23b0b154f;hpb=c8e0d0bd8cc515f60ab6a1248caf6fdc8945d89e;p=swftools.git diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index b0472ba..b9454d0 100644 --- a/pdf2swf/SWFOutputDev.cc +++ b/pdf2swf/SWFOutputDev.cc @@ -663,6 +663,7 @@ void SWFOutputDev::drawChar(GfxState *state, double x, double y, swfoutput_drawchar(&output, x1, y1, name, c); else msg(" couldn't get name for CID character %02x from Encoding", c); + swfoutput_drawchar(&output, x1, y1, "", c); } else { Gfx8BitFont*font8; font8 = (Gfx8BitFont*)font; @@ -672,6 +673,7 @@ void SWFOutputDev::drawChar(GfxState *state, double x, double y, swfoutput_drawchar(&output, x1, y1, enc[c], c); else { msg(" couldn't get name for character %02x from Encoding", c); + swfoutput_drawchar(&output, x1, y1, "", c); } } } @@ -708,6 +710,7 @@ void SWFOutputDev::startPage(int pageNum, GfxState *state) state->transform(state->getX1(),state->getY1(),&x1,&y1); state->transform(state->getX2(),state->getY2(),&x2,&y2); if(!outputstarted) { + msg(" Bounding box is (%f,%f)-(%f,%f)", x1,y1,x2,y2); swfoutput_init(&output, swffilename, abs((int)(x2-x1)),abs((int)(y2-y1))); outputstarted = 1; } @@ -888,6 +891,8 @@ int SWFOutputDev::searchT1Font(char*name) int i; int mapid=-1; char*filename=0; + + msg(" SearchT1Font(%s)", name); for(i=0;igetEmbeddedFontID(&embRef); @@ -1050,25 +1056,25 @@ char*SWFOutputDev::writeEmbeddedFontToFile(XRef*ref, GfxFont*font) msg(" File contains TrueType fonts"); ttfinfo = 1; } - char name2[80]; + char name2[512]; char*tmp; tmp = strdup(mktmpname((char*)name2)); sprintf(name2, "%s", tmp); - char*a[] = {"./ttf2pt1", "-W0", + char*a[] = {"./ttf2pt1", "-W", "0", #ifndef USE_FREETYPE - "-pttf", + "-p", "ttf", #else - "-pft", + "-p", "ft", #endif "-b", tmpFileName, name2}; - msg(" Invoking ttf2pt1..."); - ttf2pt1_main(6,a); + msg(" Invoking %s %s %s %s %s %s %s %s",a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]); + ttf2pt1_main(8,a); unlink(tmpFileName); sprintf(name2,"%s.pfb",tmp); tmpFileName = strdup(name2); } - return tmpFileName; + return strdup(tmpFileName); } char* gfxFontName(GfxFont* gfxFont) @@ -1277,7 +1283,7 @@ void SWFOutputDev::updateFont(GfxState *state) if (gfxFont->getType() == fontType1 || gfxFont->getType() == fontType1C || gfxFont->getType() == fontTrueType || - gfxFont->getType() == fontCIDType2) + gfxFont->getType() == fontCIDType2) { fileName = writeEmbeddedFontToFile(xref, gfxFont); if(!fileName) { @@ -1287,7 +1293,7 @@ void SWFOutputDev::updateFont(GfxState *state) } this->t1id = T1_AddFont(fileName); if(this->t1id<0) { - msg(" Couldn't load font from file"); + msg(" Couldn't load font from file %s", fileName); showFontError(gfxFont,0); unlinkfont(fileName); return ;