Commit 6fe2cb0f authored by Albert Astals Cid's avatar Albert Astals Cid

make it compile with freetype 2.2.0 preversions

parent 429d3521
2005-11-i17 Albert Astals Cid <aacid@kde.org>
* splash/SplashFTFont.cc: Make it compile using FreeType 2.2.0
preversions
2005-11-04 Albert Astals Cid <aacid@kde.org>
* glib/poppler-document.cc:
* glib/poppler-page.cc: Make it compile using --disable-cairo-output
......
......@@ -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 @@ SplashPath *SplashFTFont::getGlyphPath(int c) {
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 @@ static int glyphPathMoveTo(FT_Vector *pt, void *path) {
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 @@ static int glyphPathLineTo(FT_Vector *pt, void *path) {
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 @@ static int glyphPathConicTo(FT_Vector *ctrl, FT_Vector *pt, void *path) {
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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment