[poppler] poppler/splash: SplashFTFont.cc,1.4,1.5

Albert Astals Cid aacid at freedesktop.org
Thu Nov 17 13:37:36 PST 2005


Update of /cvs/poppler/poppler/splash
In directory gabe:/tmp/cvs-serv1197/splash

Modified Files:
	SplashFTFont.cc 
Log Message:
make it compile with freetype 2.2.0 preversions


Index: SplashFTFont.cc
===================================================================
RCS file: /cvs/poppler/poppler/splash/SplashFTFont.cc,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- SplashFTFont.cc	16 Oct 2005 14:30:16 -0000	1.4
+++ SplashFTFont.cc	17 Nov 2005 21:37:34 -0000	1.5
@@ -12,6 +12,11 @@
 #pragma implementation
 #endif
 
+#define MAKE_VERSION( a,b,c ) (((a) << 16) | ((b) << 8) | (c))
+
+#define FREETYPE_VERSION \
+	MAKE_VERSION(FREETYPE_MAJOR,FREETYPE_MINOR,FREETYPE_PATCH)
+
 #include <ft2build.h>
 #include FT_OUTLINE_H
 #include FT_INTERNAL_OBJECTS_H // needed for FT_New_Size decl
@@ -25,11 +30,19 @@
 
 //------------------------------------------------------------------------
 
+#if ( FREETYPE_VERSION >= MAKE_VERSION(2,2,0) )
+static int glyphPathMoveTo(const FT_Vector *pt, void *path);
+static int glyphPathLineTo(const FT_Vector *pt, void *path);
+static int glyphPathConicTo(const FT_Vector *ctrl, const FT_Vector *pt, void *path);
+static int glyphPathCubicTo(const FT_Vector *ctrl1, const FT_Vector *ctrl2,
+			    const FT_Vector *pt, void *path);
+#else
 static int glyphPathMoveTo(FT_Vector *pt, void *path);
 static int glyphPathLineTo(FT_Vector *pt, void *path);
 static int glyphPathConicTo(FT_Vector *ctrl, FT_Vector *pt, void *path);
 static int glyphPathCubicTo(FT_Vector *ctrl1, FT_Vector *ctrl2,
 			    FT_Vector *pt, void *path);
+#endif
 
 //------------------------------------------------------------------------
 // SplashFTFont
@@ -249,7 +262,12 @@
   return path.path;
 }
 
-static int glyphPathMoveTo(FT_Vector *pt, void *path) {
+#if ( FREETYPE_VERSION >= MAKE_VERSION(2,2,0) )
+static int glyphPathMoveTo(const FT_Vector *pt, void *path)
+#else
+static int glyphPathMoveTo(FT_Vector *pt, void *path)
+#endif
+{
   SplashFTFontPath *p = (SplashFTFontPath *)path;
 
   if (p->needClose) {
@@ -260,7 +278,12 @@
   return 0;
 }
 
-static int glyphPathLineTo(FT_Vector *pt, void *path) {
+#if ( FREETYPE_VERSION >= MAKE_VERSION(2,2,0) )
+static int glyphPathLineTo(const FT_Vector *pt, void *path)
+#else
+static int glyphPathLineTo(FT_Vector *pt, void *path)
+#endif
+{
   SplashFTFontPath *p = (SplashFTFontPath *)path;
 
   p->path->lineTo(pt->x / 64.0, -pt->y / 64.0);
@@ -268,7 +291,12 @@
   return 0;
 }
 
-static int glyphPathConicTo(FT_Vector *ctrl, FT_Vector *pt, void *path) {
+#if ( FREETYPE_VERSION >= MAKE_VERSION(2,2,0) )
+static int glyphPathConicTo(const FT_Vector *ctrl, const FT_Vector *pt, void *path)
+#else
+static int glyphPathConicTo(FT_Vector *ctrl, FT_Vector *pt, void *path)
+#endif
+{
   SplashFTFontPath *p = (SplashFTFontPath *)path;
   SplashCoord x0, y0, x1, y1, x2, y2, x3, y3, xc, yc;
 
@@ -306,8 +334,12 @@
   return 0;
 }
 
-static int glyphPathCubicTo(FT_Vector *ctrl1, FT_Vector *ctrl2,
-			    FT_Vector *pt, void *path) {
+#if ( FREETYPE_VERSION >= MAKE_VERSION(2,2,0) )
+static int glyphPathCubicTo(const FT_Vector *ctrl1, const FT_Vector *ctrl2, const FT_Vector *pt, void *path)
+#else
+static int glyphPathCubicTo(FT_Vector *ctrl1, FT_Vector *ctrl2, FT_Vector *pt, void *path)
+#endif
+{
   SplashFTFontPath *p = (SplashFTFontPath *)path;
 
   p->path->curveTo(ctrl1->x / 64.0, -ctrl1->y / 64.0,



More information about the poppler mailing list