Merge branch 'org.openembedded.dev' of git://git.openembedded.net/openembedded into...
[vuplus_openembedded] / packages / tuxbox / tuxbox-tuxtxt-32bpp / freetype2.patch
1 --- ~/tuxtxt.c  2008-09-03 20:07:53.000000000 +0200
2 +++ ~/tuxtxt.c  2008-09-04 10:54:47.000000000 +0200
3 @@ -243,7 +243,11 @@
4                 int i;
5                 fontwidth = newwidth;
6                 if (usettf)
7 +#if ((defined(FREETYPE_MAJOR)) && (((FREETYPE_MAJOR == 2) && (((FREETYPE_MINOR == 1) && (FREETYPE_PATCH >= 9)) || (FREETYPE_MINOR > 1))) || (FREETYPE_MAJOR > 2)))
8 +                       typettf.width  = (FT_UShort) fontwidth * TTFWidthFactor16 / 16;
9 +#else
10                         typettf.font.pix_width  = (FT_UShort) fontwidth * TTFWidthFactor16 / 16;
11 +#endif
12                 else
13                 {
14                         if (newwidth < 11)
15 @@ -252,7 +256,11 @@
16                                 newwidth = 22;
17                         else
18                                 newwidth = 23;
19 +#if ((defined(FREETYPE_MAJOR)) && (((FREETYPE_MAJOR == 2) && (((FREETYPE_MINOR == 1) && (FREETYPE_PATCH >= 9)) || (FREETYPE_MINOR > 1))) || (FREETYPE_MAJOR > 2)))
20 +                       typettf.width  = typettf.height = (FT_UShort) newwidth;
21 +#else
22                         typettf.font.pix_width  = typettf.font.pix_height = (FT_UShort) newwidth;
23 +#endif
24                 }
25                 for (i = 0; i <= 12; i++)
26                         axdrcs[i] = (fontwidth * i + 6) / 12;
27 @@ -808,22 +816,43 @@
28  
29         if (usettf)
30         {
31 +#if ((defined(FREETYPE_MAJOR)) && (((FREETYPE_MAJOR == 2) && (((FREETYPE_MINOR == 1) && (FREETYPE_PATCH >= 9)) || (FREETYPE_MINOR > 1))) || (FREETYPE_MAJOR > 2)))
32 +               typettf.face_id = (FTC_FaceID) TUXTXTTTFVAR;
33 +               typettf.height = (FT_UShort) fontheight * TTFHeightFactor16 / 16;
34 +#else
35                 typettf.font.face_id = (FTC_FaceID) TUXTXTTTFVAR;
36                 typettf.font.pix_height = (FT_UShort) fontheight * TTFHeightFactor16 / 16;
37 +#endif
38         }
39         else
40         {
41 +#if ((defined(FREETYPE_MAJOR)) && (((FREETYPE_MAJOR == 2) && (((FREETYPE_MINOR == 1) && (FREETYPE_PATCH >= 9)) || (FREETYPE_MINOR > 1))) || (FREETYPE_MAJOR > 2)))
42 +               typettf.face_id = (FTC_FaceID) TUXTXTOTBVAR;
43 +               typettf.width  = (FT_UShort) 23;
44 +               typettf.height = (FT_UShort) 23;
45 +#else
46                 typettf.font.face_id = (FTC_FaceID) TUXTXTOTBVAR;
47                 typettf.font.pix_width  = (FT_UShort) 23;
48                 typettf.font.pix_height = (FT_UShort) 23;
49 +#endif
50         }
51 -
52 +#if ((defined(FREETYPE_MAJOR)) && (((FREETYPE_MAJOR == 2) && (((FREETYPE_MINOR == 1) && (FREETYPE_PATCH >= 9)) || (FREETYPE_MINOR > 1))) || (FREETYPE_MAJOR > 2)))
53 +       typettf.flags = FT_LOAD_MONOCHROME;
54 +#else
55         typettf.image_type = ftc_image_mono;
56 +#endif
57  
58 +#if ((defined(FREETYPE_MAJOR)) && (((FREETYPE_MAJOR == 2) && (((FREETYPE_MINOR == 1) && (FREETYPE_PATCH >= 9)) || (FREETYPE_MINOR > 1))) || (FREETYPE_MAJOR > 2)))
59 +       if ((error = FTC_Manager_Lookup_Face(manager, typettf.face_id, &face)))
60 +       {
61 +               typettf.face_id = (usettf ? (FTC_FaceID) TUXTXTTTF : TUXTXTOTB);
62 +               if ((error = FTC_Manager_Lookup_Face(manager, typettf.face_id, &face)))
63 +#else
64         if ((error = FTC_Manager_Lookup_Face(manager, typettf.font.face_id, &face)))
65         {
66                 typettf.font.face_id = (usettf ? (FTC_FaceID) TUXTXTTTF : TUXTXTOTB);
67                 if ((error = FTC_Manager_Lookup_Face(manager, typettf.font.face_id, &face)))
68 +#endif
69                 {
70                         printf("TuxTxt <FTC_Manager_Lookup_Face failed with Errorcode 0x%.2X>\n", error);
71                         FTC_Manager_Done(manager);
72 --- ~/tuxtxt.h  2008-09-03 20:07:53.000000000 +0200
73 +++ ~/tuxtxt.h  2008-09-04 10:54:18.000000000 +0200
74 @@ -210,6 +210,13 @@
75  struct fb_fix_screeninfo fix_screeninfo;
76  
77  /* freetype stuff */
78 +#if ((defined(FREETYPE_MAJOR)) && (((FREETYPE_MAJOR == 2) && (((FREETYPE_MINOR == 1) && (FREETYPE_PATCH >= 9)) || (FREETYPE_MINOR > 1))) || (FREETYPE_MAJOR > 2)))
79 +typedef FTC_ImageTypeRec FTC_Image_Desc;
80 +typedef FTC_SBitCache FTC_SBit_Cache;
81 +#define FTC_SBit_Cache_New(a,b)                FTC_SBitCache_New(a,b)
82 +#define FTC_SBit_Cache_Lookup(a,b,c,d) FTC_SBitCache_Lookup(a,b,c,d,NULL)
83 +#define FTC_Manager_Lookup_Face(a,b,c) FTC_Manager_LookupFace(a,b,c)
84 +#endif
85  FT_Library      library;
86  FTC_Manager     manager;
87  FTC_SBitCache   cache;