From: kramm Date: Sun, 9 Sep 2007 17:53:23 +0000 (+0000) Subject: added experimental splashoutputdev code X-Git-Tag: buttons-working~555 X-Git-Url: http://git.asbjorn.it/?a=commitdiff_plain;h=5e1686223c09f4c1860a47f45d7f9750426154b7;p=swftools.git added experimental splashoutputdev code --- diff --git a/lib/pdf/InfoOutputDev.cc b/lib/pdf/InfoOutputDev.cc index 830776d..2bcbdaa 100644 --- a/lib/pdf/InfoOutputDev.cc +++ b/lib/pdf/InfoOutputDev.cc @@ -1,14 +1,19 @@ +#include "SplashTypes.h" +#include "SplashOutputDev.h" #include "InfoOutputDev.h" #include "GfxState.h" #include "../log.h" #include -InfoOutputDev::InfoOutputDev() +InfoOutputDev::InfoOutputDev(XRef*xref) { num_links = 0; num_images = 0; num_fonts = 0; id2font = new GHash(); + SplashColor white = {255,255,255}; + splash = new SplashOutputDev(splashModeRGB8,320,0,white,0,0); + splash->startDoc(xref); } InfoOutputDev::~InfoOutputDev() { @@ -58,7 +63,6 @@ static char*getFontID(GfxFont*font) return strdup(buf); } - void InfoOutputDev::updateFont(GfxState *state) { GfxFont*font = state->getFont(); @@ -77,6 +81,10 @@ void InfoOutputDev::updateFont(GfxState *state) num_fonts++; } currentfont = info; + + splash->doUpdateFont(state); + SplashFont* splash_font = splash->font; + //printf("%s: %d chars\n", id, splash_font->getNumChars()); } void InfoOutputDev::drawChar(GfxState *state, double x, double y, diff --git a/lib/pdf/InfoOutputDev.h b/lib/pdf/InfoOutputDev.h index 82fa082..deed876 100644 --- a/lib/pdf/InfoOutputDev.h +++ b/lib/pdf/InfoOutputDev.h @@ -3,6 +3,8 @@ #include "GfxFont.h" #include "OutputDev.h" +#include "SplashFont.h" +#include "SplashOutputDev.h" #include "GHash.h" struct FontInfo @@ -15,14 +17,15 @@ class InfoOutputDev: public OutputDev { GHash* id2font; FontInfo* currentfont; + SplashOutputDev*splash; public: int x1,y1,x2,y2; int num_links; int num_images; int num_fonts; - InfoOutputDev(); - virtual ~InfoOutputDev(); + InfoOutputDev(XRef*xref); + virtual ~InfoOutputDev(); virtual GBool upsideDown(); virtual GBool useDrawChar(); virtual GBool interpretType3Chars();