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__
25 #include "OutputDev.h"
26 #include "SplashOutputDev.h"
28 #include <splash/SplashTypes.h>
29 #include <splash/SplashPath.h>
30 #include <splash/SplashFont.h>
31 #include <splash/SplashFontFile.h>
33 #include "SplashTypes.h"
34 #include "SplashPath.h"
35 #include "SplashFont.h"
36 #include "SplashFontFile.h"
40 #include <goo/GooHash.h>
44 #include "../gfxdevice.h"
45 #include "../gfxtools.h"
46 #include "../gfxfont.h"
49 #define INTERNAL_FONT_SIZE 1024.0
50 #define GLYPH_IS_SPACE(g) ((!(g)->line || ((g)->line->type==gfx_moveTo && !(g)->line->next)) && (g)->advance)
72 gfxfont_t* getGfxFont();
78 double ascender,descender;
88 SplashFont*splash_font;
91 float average_advance;
94 extern char*getFontID(GfxFont*font);
96 class InfoOutputDev: public OutputDev
99 FontInfo* currentfont;
100 GlyphInfo* currentglyph;
101 SplashOutputDev*splash;
112 void dumpfonts(gfxdevice_t*dev);
114 InfoOutputDev(XRef*xref);
115 virtual ~InfoOutputDev();
116 virtual GBool useTilingPatternFill();
117 virtual GBool upsideDown();
118 virtual GBool useDrawChar();
119 virtual GBool interpretType3Chars();
120 virtual void startPage(int pageNum, GfxState *state, double crop_x1, double crop_y1, double crop_x2, double crop_y2);
121 virtual void endPage();
122 virtual void drawLink(Link *link, Catalog *catalog);
123 virtual double getMaximumFontSize(char*id);
124 virtual void updateFont(GfxState *state);
126 virtual void saveState(GfxState *state);
127 virtual void restoreState(GfxState *state);
129 virtual GBool beginType3Char(GfxState *state, double x, double y, double dx, double dy, CharCode code, Unicode *u, int uLen);
130 virtual void type3D0(GfxState *state, double wx, double wy);
131 virtual void type3D1(GfxState *state, double wx, double wy, double llx, double lly, double urx, double ury);
132 virtual void endType3Char(GfxState *state);
134 virtual void fill(GfxState *state);
135 virtual void eoFill(GfxState *state);
137 virtual void drawChar(GfxState *state, double x, double y,
138 double dx, double dy,
139 double originX, double originY,
140 CharCode code, int nBytes, Unicode *u, int uLen);
141 virtual void drawImageMask(GfxState *state, Object *ref, Stream *str,
142 int width, int height, GBool invert,
144 virtual void drawImage(GfxState *state, Object *ref, Stream *str,
145 int width, int height, GfxImageColorMap *colorMap,
146 int *maskColors, GBool inlineImg);
147 virtual void drawMaskedImage(GfxState *state, Object *ref, Stream *str,
148 int width, int height,
149 GfxImageColorMap *colorMap,
151 int maskWidth, int maskHeight,
153 virtual void drawSoftMaskedImage(GfxState *state, Object *ref, Stream *str,
154 int width, int height,
155 GfxImageColorMap *colorMap,
157 int maskWidth, int maskHeight,
158 GfxImageColorMap *maskColorMap);
160 virtual FontInfo* getFont(char*id);
163 #endif //__infooutputdev_h__