implemented '-s detectspace' functionality
[swftools.git] / lib / pdf / InfoOutputDev.h
index 532e2ed..04e98f7 100644 (file)
@@ -46,6 +46,7 @@
 #include "../gfxfont.h"
 
 #define INTERNAL_FONT_SIZE 1024.0
+#define GLYPH_IS_SPACE(g) ((!(g)->line || ((g)->line->type==gfx_moveTo && !(g)->line->next)) && (g)->advance)
 
 struct GlyphInfo
 {
@@ -58,11 +59,17 @@ struct GlyphInfo
     double advance_max;
 };
 
-struct FontInfo
+class FontInfo
 {
-    FontInfo();
+    gfxfont_t*gfxfont;
+
+    char*id;
+public:
+    FontInfo(char*id);
     ~FontInfo();
 
+    gfxfont_t* getGfxFont();
+
     double lastx,lasty;
     int lastchar;
 
@@ -70,7 +77,6 @@ struct FontInfo
 
     void grow(int size);
 
-    gfxfont_t*gfxfont;
     GfxFont*font;
     double max_size;
     int num_glyphs;
@@ -78,6 +84,7 @@ struct FontInfo
     int*charid2glyph;
     SplashFont*splash_font;
     char seen;
+    int space_char;
 };
 
 extern char*getFontID(GfxFont*font);
@@ -89,8 +96,6 @@ class InfoOutputDev: public OutputDev
     GlyphInfo* currentglyph;
     SplashOutputDev*splash;
 
-    gfxfont_t* createGfxFont(GfxFont*xpdffont, FontInfo*src);
-
     public:
     int x1,y1,x2,y2;
     int num_links;
@@ -100,7 +105,8 @@ class InfoOutputDev: public OutputDev
     int num_polygons;
     int num_textfields;
 
-    gfxfontlist_t*fonts;
+    void finish();
+    void dumpfonts(gfxdevice_t*dev);
 
     InfoOutputDev(XRef*xref);
     virtual ~InfoOutputDev(); 
@@ -144,6 +150,7 @@ class InfoOutputDev: public OutputDev
                                      Stream *maskStr,
                                      int maskWidth, int maskHeight,
                                      GfxImageColorMap *maskColorMap);
+
     virtual FontInfo* getFont(char*id);
 };