|
|
|
|
@ -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_SIZES_H |
|
|
|
|
@ -26,11 +31,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
|
|
|
|
|
@ -243,7 +256,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) { |
|
|
|
|
@ -254,7 +272,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); |
|
|
|
|
@ -262,7 +285,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; |
|
|
|
|
|
|
|
|
|
@ -300,8 +328,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, |
|
|
|
|
|