added median advance detection
[swftools.git] / lib / pdf / InfoOutputDev.h
index 13ba1e4..699c4c7 100644 (file)
 
 #include "GfxFont.h"
 #include "OutputDev.h"
-#include "SplashFont.h"
 #include "SplashOutputDev.h"
+#ifdef HAVE_POPPLER
+#include <splash/SplashTypes.h>
+#include <splash/SplashPath.h>
+#include <splash/SplashFont.h>
+#include <splash/SplashFontFile.h>
+#else
+#include "SplashTypes.h"
 #include "SplashPath.h"
+#include "SplashFont.h"
 #include "SplashFontFile.h"
+#endif
+
+#ifdef HAVE_POPPLER
+#include <goo/GooHash.h>
+#else
 #include "GHash.h"
+#endif
+
+struct AdvanceSample
+{
+    double advance;
+    struct AdvanceSample*next;
+};
 
 struct GlyphInfo
 {
     SplashPath*path;
     int unicode;
     int glyphid;
+    double advance;
     double x1,y1,x2,y2;
+
+    double estimateAdvance();
+
+    AdvanceSample*advance_samples;
 };
 
 struct FontInfo
 {
     FontInfo();
     ~FontInfo();
+
+    double lastx,lasty;
+    int lastchar;
+
+    double ascender,descender;
+
     void grow(int size);
 
     GfxFont*font;