From: kramm Date: Mon, 27 May 2002 21:16:55 +0000 (+0000) Subject: more xpdf 1.01 fixes. X-Git-Tag: release-0-4-0~82 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=a4d5d87844a72f61db923cffdd654dc05d5cc066 more xpdf 1.01 fixes. --- diff --git a/pdf2swf/SWFOutputDev.cc b/pdf2swf/SWFOutputDev.cc index d5d0d94..5c21a98 100644 --- a/pdf2swf/SWFOutputDev.cc +++ b/pdf2swf/SWFOutputDev.cc @@ -176,9 +176,9 @@ public: virtual void beginString(GfxState *state, GString *s) ; virtual void endString(GfxState *state) ; virtual void drawChar(GfxState *state, double x, double y, - double dx, double dy, Guchar c) ; - virtual void drawChar16(GfxState *state, double x, double y, - double dx, double dy, int c) ; + double dx, double dy, + double originX, double originY, + CharCode code, Unicode *u, int uLen); //----- image drawing virtual void drawImageMask(GfxState *state, Object *ref, Stream *str, @@ -186,7 +186,7 @@ public: GBool inlineImg); virtual void drawImage(GfxState *state, Object *ref, Stream *str, int width, int height, GfxImageColorMap *colorMap, - GBool inlineImg); + int *maskColors, GBool inlineImg); private: void drawGeneralImage(GfxState *state, Object *ref, Stream *str, @@ -355,7 +355,7 @@ void dumpFontInfo(char*loglevel, GfxFont*font) if(gstr) logf("%sTag: %s\n", loglevel, FIXNULL(gstr->getCString())); - //if(font->is16Bit()) logf("%sis 16 bit\n", loglevel); //FIXME: not existing in xpdf 1.01 + if(font->isCIDFont()) logf("%sis CID font\n", loglevel); GfxFontType type=font->getType(); switch(type) { @@ -416,6 +416,7 @@ SWFOutputDev::SWFOutputDev() clippos = 0; clipping[clippos] = 0; outputstarted = 0; + xref = 0; // printf("SWFOutputDev::SWFOutputDev() \n"); }; @@ -566,7 +567,10 @@ void SWFOutputDev::beginString(GfxState *state, GString *s) } int charcounter = 0; -void SWFOutputDev::drawChar(GfxState *state, double x, double y, double dx, double dy, Guchar c) +void SWFOutputDev::drawChar(GfxState *state, double x, double y, + double dx, double dy, + double originX, double originY, + CharCode c, Unicode *u, int uLen) { logf(" drawChar(%f,%f,%f,%f,'%c')\n",x,y,dx,dy,c); // check for invisible text -- this is used by Acrobat Capture @@ -575,7 +579,7 @@ void SWFOutputDev::drawChar(GfxState *state, double x, double y, double dx, doub GfxFont*font = state->getFont(); Gfx8BitFont*font8; if(font->isCIDFont()) { - logf(" CID Font\n"); + logf(" CID Font"); return; } font8 = (Gfx8BitFont*)font; @@ -594,12 +598,6 @@ void SWFOutputDev::drawChar(GfxState *state, double x, double y, double dx, doub } } -void SWFOutputDev::drawChar16(GfxState *state, double x, double y, double dx, double dy, int c) -{ - printf(" drawChar16(%f,%f,%f,%f,%08x)\n",x,y,dx,dy,c); - exit(1); -} - void SWFOutputDev::endString(GfxState *state) { logf(" endstring\n"); @@ -1135,7 +1133,7 @@ void SWFOutputDev::updateFont(GfxState *state) Ref embRef; GBool embedded = gfxFont->getEmbeddedFontID(&embRef); if(embedded) { - if (//!gfxFont->is16Bit() && FIXME: not in xpdf 1.01 + if (!gfxFont->isCIDFont() && (gfxFont->getType() == fontType1 || gfxFont->getType() == fontType1C || gfxFont->getType() == fontTrueType)) { @@ -1401,11 +1399,13 @@ void SWFOutputDev::drawImageMask(GfxState *state, Object *ref, Stream *str, } void SWFOutputDev::drawImage(GfxState *state, Object *ref, Stream *str, - int width, int height, - GfxImageColorMap *colorMap, GBool inlineImg) + int width, int height, GfxImageColorMap *colorMap, + int *maskColors, GBool inlineImg) { - logf(" drawImage %dx%d, %s, inline=%d", width, height, - colorMap?"colorMap":"no colorMap", inlineImg); + logf(" drawImage %dx%d, %s %s, inline=%d", width, height, + colorMap?"colorMap":"no colorMap", + maskColors?"maskColors":"no maskColors", + inlineImg); if(colorMap) logf(" colorMap pixcomps:%d bits:%d mode:%d\n", colorMap->getNumPixelComps(), colorMap->getBits(),colorMap->getColorSpace()->getMode()); @@ -1461,8 +1461,6 @@ void pdfswf_init(char*filename, char*userPassword) GString *fileName = new GString(filename); GString *userPW; Object info; - // init error file - //errorInit(); FIXME xpdf 1.01 // read config file globalParams = new GlobalParams("");