summaryrefslogtreecommitdiff
path: root/x11/kdebase3/patches/patch-ai
blob: cf4e62b7ddbe83da8bfb2cee11dc8d4237e6bd6c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
$NetBSD: patch-ai,v 1.11 2004/05/01 07:32:15 tron Exp $

Fixes build with Freetype-2.1.8, see:
http://webcvs.kde.org/cgi-bin/cvsweb.cgi/kdebase/kcontrol/kfontinst/lib/FontEngine.h

--- kcontrol/kfontinst/lib/FontEngine.h	2003/11/29 01:41:14	1.5
+++ kcontrol/kfontinst/lib/FontEngine.h	2004/04/27 20:30:25	1.5.2.1
@@ -34,6 +34,7 @@
 #endif
 
 #include "Encodings.h"
+#include <kdeversion.h>
 #include <ft2build.h>
 #include FT_FREETYPE_H
 #include <qstring.h>
@@ -50,6 +51,10 @@
 #include <qpaintdevice.h>
 #endif
 
+// OK - some macros to make determining the FreeType version easier...
+#define KFI_FREETYPE_VERSION      KDE_MAKE_VERSION(FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH)
+#define KFI_FT_IS_GE(a,b,c)       (KFI_FREETYPE_VERSION >= KDE_MAKE_VERSION(a,b,c))
+
 class CFontEngine
 {
     public:
@@ -178,8 +183,15 @@ class CFontEngine
         bool            open;
 #ifdef HAVE_FT_CACHE
         FTC_Manager     cacheManager;
+
+#if KFI_FT_IS_GE(2, 1, 8)
+        FTC_ImageCache  imageCache;
+        FTC_SBitCache   sBitCache;
+#else
         FTC_Image_Cache imageCache;
         FTC_SBit_Cache  sBitCache;
+#endif
+
         QPtrList<TId>   ids;
         unsigned char   *buffer;
         int             bufferSize;
@@ -191,7 +203,8 @@ class CFontEngine
         int           width,
                       height,
                       greys,
-                      mod;
+                      pitch;
+        bool          mono;
         unsigned char *buffer;
     };
 
@@ -348,11 +361,25 @@ class CFontEngine
     private:
 
     FTC_FaceID getId(const QString &f, int faceNo); 
+
+#if KFI_FT_IS_GE(2, 1, 8)
+    bool       getGlyphBitmap(FTC_ImageTypeRec &font, FT_ULong index, Bitmap &target, int &left, int &top,
+                             int &xAdvance, FT_Pointer *ptr);
+#else
     bool       getGlyphBitmap(FTC_Image_Desc &font, FT_ULong index, Bitmap &target, int &left, int &top,
                              int &xAdvance, FT_Pointer *ptr);
+#endif
+
     void       align32(Bitmap &bmp);
-    bool       drawGlyph(QPixmap &pix, FTC_Image_Desc &font, FT_Size &size, int glyphNum, FT_F26Dot6 &x, FT_F26Dot6 &y,
+
+#if KFI_FT_IS_GE(2, 1, 8)
+    bool       drawGlyph(QPixmap &pix, FTC_ImageTypeRec &font, int glyphNum, FT_F26Dot6 &x, FT_F26Dot6 &y,
                          FT_F26Dot6 width, FT_F26Dot6 height, FT_F26Dot6 startX, FT_F26Dot6 stepY, int space=0);
+#else
+    bool       drawGlyph(QPixmap &pix, FTC_Image_Desc &font, int glyphNum, FT_F26Dot6 &x, FT_F26Dot6 &y,
+                         FT_F26Dot6 width, FT_F26Dot6 height, FT_F26Dot6 startX, FT_F26Dot6 stepY, int space=0);
+#endif
+
 #endif
 
     private: