2 A special output device which collects information about a PDF file,
3 like fonts, Type3 glyphs and so on.
5 This file is part of swftools.
7 Swftools is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 Swftools is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with swftools; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
21 #ifndef __infooutputdev_h__
22 #define __infooutputdev_h__
24 #include "popplercompat.h"
26 #include "OutputDev.h"
27 #include "SplashOutputDev.h"
31 #include <splash/SplashTypes.h>
32 #include <splash/SplashPath.h>
33 #include <splash/SplashFont.h>
34 #include <splash/SplashFontFile.h>
36 #include "xpdf/config.h"
37 #include "SplashTypes.h"
38 #include "SplashPath.h"
39 #include "SplashFont.h"
40 #include "SplashFontFile.h"
44 #include <goo/GooHash.h>
48 #include "../gfxdevice.h"
49 #include "../gfxtools.h"
50 #include "../gfxfont.h"
53 #define INTERNAL_FONT_SIZE 1024.0
54 #define GLYPH_IS_SPACE(g) ((!(g)->line || ((g)->line->type==gfx_moveTo && !(g)->line->next)) && (g)->advance)
76 gfxfont_t* getGfxFont();
82 double ascender,descender;
92 SplashFont*splash_font;
95 float average_advance;
98 extern char*getFontID(GfxFont*font);
100 class InfoOutputDev: public OutputDev
103 FontInfo* currentfont;
104 GlyphInfo* currentglyph;
105 SplashOutputDev*splash;
117 void dumpfonts(gfxdevice_t*dev);
119 InfoOutputDev(XRef*xref);
120 virtual ~InfoOutputDev();
121 virtual GBool useTilingPatternFill();
122 virtual GBool upsideDown();
123 virtual GBool useDrawChar();
124 virtual GBool interpretType3Chars();
125 virtual GBool checkPageSlice(Page *page, double hDPI, double vDPI,
126 int rotate, GBool useMediaBox, GBool crop,
127 int sliceX, int sliceY, int sliceW, int sliceH,
128 GBool printing, Catalog *catalog,
129 GBool (*abortCheckCbk)(void *data) = NULL,
130 void *abortCheckCbkData = NULL);
131 virtual void startPage(int pageNum, GfxState *state);
132 virtual void endPage();
133 virtual void drawLink(Link *link, Catalog *catalog);
134 virtual double getMaximumFontSize(char*id);
135 virtual void updateFont(GfxState *state);
137 virtual void saveState(GfxState *state);
138 virtual void restoreState(GfxState *state);
140 virtual GBool beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen);
141 virtual void type3D0(GfxState *state, double wx, double wy);
142 virtual void type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury);
143 virtual void endType3Char(GfxState *state);
145 virtual void fill(GfxState *state);
146 virtual void eoFill(GfxState *state);
148 virtual void drawChar(GfxState *state, double x, double y,
149 double dx, double dy,
150 double originX, double originY,
151 CharCode code, int nBytes, Unicode *u, int uLen);
153 virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
154 int width, int height, GBool invert,
157 virtual void drawImage(GfxState *state, Object *ref, Stream *str,
158 int width, int height, GfxImageColorMap *colorMap,
160 int *maskColors, GBool inlineImg);
161 virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
162 int width, int height,
163 GfxImageColorMap *colorMap,
166 int maskWidth, int maskHeight,
168 POPPLER_MASK_INTERPOLATE);
169 virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
170 int width, int height,
171 GfxImageColorMap *colorMap,
174 int maskWidth, int maskHeight,
175 GfxImageColorMap *maskColorMap
176 POPPLER_MASK_INTERPOLATE);
178 virtual FontInfo* getFont(char*id);
181 #endif //__infooutputdev_h__