1 Submitted By: Igor Zivkovic <igor@linuxfromscratch.org>
3 Initial Package Version: 0.8
4 Upstream Status: Submitted (http://bugzilla.mozilla.org/show_bug.cgi?id=234035).
5 Origin: Peter Kovar's 0.9 patch.
6 Description: Fixes compilation against freetype >= 2.1.8.
8 --- mozilla/gfx/idl/nsIFreeType2.idl.orig 2004-07-10 18:21:23.000000000 +0000
9 +++ mozilla/gfx/idl/nsIFreeType2.idl 2004-07-10 18:27:25.000000000 +0000
11 native FT_Sfnt_Tag(FT_Sfnt_Tag);
12 native FT_Size(FT_Size);
14 -[ptr] native FTC_Image_Desc_p(FTC_Image_Desc);
15 +[ptr] native FTC_ImageType_p(FTC_ImageType);
16 native FTC_Face_Requester(FTC_Face_Requester);
17 native FTC_Font(FTC_Font);
18 -native FTC_Image_Cache(FTC_Image_Cache);
19 +native FTC_FaceID(FTC_FaceID);
20 +native FTC_ImageCache(FTC_ImageCache);
21 native FTC_Manager(FTC_Manager);
26 readonly attribute FT_Library library;
27 readonly attribute FTC_Manager FTCacheManager;
28 - readonly attribute FTC_Image_Cache ImageCache;
29 + readonly attribute FTC_ImageCache ImageCache;
31 void doneFace(in FT_Face face);
32 void doneFreeType(in FT_Library lib);
34 void outlineDecompose(in FT_Outline_p outline,
35 in const_FT_Outline_Funcs_p funcs, in voidPtr p);
36 void setCharmap(in FT_Face face, in FT_CharMap charmap);
37 - void imageCacheLookup(in FTC_Image_Cache cache, in FTC_Image_Desc_p desc,
38 + void imageCacheLookup(in FTC_ImageCache cache, in FTC_ImageType_p desc,
39 in FT_UInt gindex, out FT_Glyph glyph);
40 - void managerLookupSize(in FTC_Manager manager, in FTC_Font font,
41 - out FT_Face face, out FT_Size size);
42 + void managerLookupFace(in FTC_Manager manager, in FTC_FaceID face_id,
44 void managerDone(in FTC_Manager manager);
45 void managerNew(in FT_Library lib, in FT_UInt max_faces,
46 in FT_UInt max_sizes, in FT_ULong max_bytes,
47 in FTC_Face_Requester requester, in FT_Pointer req_data,
48 out FTC_Manager manager);
49 - void imageCacheNew(in FTC_Manager manager, out FTC_Image_Cache cache);
50 + void imageCacheNew(in FTC_Manager manager, out FTC_ImageCache cache);
52 FT_ULong getFirstChar(in FT_Face face, out FT_UInt gindex);
53 FT_ULong getNextChar(in FT_Face face, in FT_ULong charcode, out FT_UInt gindex);
54 --- mozilla/gfx/src/freetype/nsFreeType.cpp.orig 2004-07-10 18:29:59.000000000 +0000
55 +++ mozilla/gfx/src/freetype/nsFreeType.cpp 2004-07-10 18:42:26.000000000 +0000
57 {"FT_New_Face", NS_FT2_OFFSET(nsFT_New_Face), PR_TRUE},
58 {"FT_Outline_Decompose", NS_FT2_OFFSET(nsFT_Outline_Decompose), PR_TRUE},
59 {"FT_Set_Charmap", NS_FT2_OFFSET(nsFT_Set_Charmap), PR_TRUE},
60 - {"FTC_Image_Cache_Lookup", NS_FT2_OFFSET(nsFTC_Image_Cache_Lookup), PR_TRUE},
61 - {"FTC_Manager_Lookup_Size", NS_FT2_OFFSET(nsFTC_Manager_Lookup_Size), PR_TRUE},
62 + {"FTC_ImageCache_Lookup", NS_FT2_OFFSET(nsFTC_Image_Cache_Lookup), PR_TRUE},
63 + {"FTC_Manager_LookupFace", NS_FT2_OFFSET(nsFTC_Manager_LookupFace), PR_TRUE},
64 {"FTC_Manager_Done", NS_FT2_OFFSET(nsFTC_Manager_Done), PR_TRUE},
65 {"FTC_Manager_New", NS_FT2_OFFSET(nsFTC_Manager_New), PR_TRUE},
66 - {"FTC_Image_Cache_New", NS_FT2_OFFSET(nsFTC_Image_Cache_New), PR_TRUE},
67 + {"FTC_ImageCache_New", NS_FT2_OFFSET(nsFTC_Image_Cache_New), PR_TRUE},
68 {"FT_Get_First_Char", NS_FT2_OFFSET(nsFT_Get_First_Char), PR_FALSE},
69 {"FT_Get_Next_Char", NS_FT2_OFFSET(nsFT_Get_Next_Char), PR_FALSE},
75 -nsFreeType2::ImageCacheLookup(FTC_Image_Cache cache, FTC_Image_Desc *desc,
76 +nsFreeType2::ImageCacheLookup(FTC_ImageCache cache, FTC_ImageType *desc,
77 FT_UInt glyphID, FT_Glyph *glyph)
79 // call the FreeType2 function via the function pointer
84 -nsFreeType2::ManagerLookupSize(FTC_Manager manager, FTC_Font font,
85 - FT_Face *face, FT_Size *size)
86 +nsFreeType2::ManagerLookupFace(FTC_Manager manager, FTC_FaceID face_id,
89 // call the FreeType2 function via the function pointer
90 - FT_Error error = nsFTC_Manager_Lookup_Size(manager, font, face, size);
91 + FT_Error error = nsFTC_Manager_LookupFace(manager, face_id, face);
92 return error ? NS_ERROR_FAILURE : NS_OK;
99 -nsFreeType2::ImageCacheNew(FTC_Manager manager, FTC_Image_Cache *cache)
100 +nsFreeType2::ImageCacheNew(FTC_Manager manager, FTC_ImageCache *cache)
102 // call the FreeType2 function via the function pointer
103 FT_Error error = nsFTC_Image_Cache_New(manager, cache);
108 -nsFreeType2::GetImageCache(FTC_Image_Cache *aCache)
109 +nsFreeType2::GetImageCache(FTC_ImageCache *aCache)
111 *aCache = mImageCache;
113 --- mozilla/gfx/src/freetype/nsFreeType.h.orig 2004-07-10 18:43:11.000000000 +0000
114 +++ mozilla/gfx/src/freetype/nsFreeType.h 2004-07-10 18:47:12.000000000 +0000
115 @@ -104,13 +104,13 @@
116 typedef FT_Error (*FT_New_Face_t)(FT_Library, const char*, FT_Long, FT_Face*);
117 typedef FT_Error (*FT_Set_Charmap_t)(FT_Face face, FT_CharMap charmap);
118 typedef FT_Error (*FTC_Image_Cache_Lookup_t)
119 - (FTC_Image_Cache, FTC_Image_Desc*, FT_UInt, FT_Glyph*);
120 -typedef FT_Error (*FTC_Manager_Lookup_Size_t)
121 - (FTC_Manager, FTC_Font, FT_Face*, FT_Size*);
122 + (FTC_ImageCache, FTC_ImageType*, FT_UInt, FT_Glyph*);
123 +typedef FT_Error (*FTC_Manager_LookupFace_t)
124 + (FTC_Manager, FTC_FaceID, FT_Face*);
125 typedef FT_Error (*FTC_Manager_Done_t)(FTC_Manager);
126 typedef FT_Error (*FTC_Manager_New_t)(FT_Library, FT_UInt, FT_UInt, FT_ULong,
127 FTC_Face_Requester, FT_Pointer, FTC_Manager*);
128 -typedef FT_Error (*FTC_Image_Cache_New_t)(FTC_Manager, FTC_Image_Cache*);
129 +typedef FT_Error (*FTC_Image_Cache_New_t)(FTC_Manager, FTC_ImageCache*);
131 typedef FT_ULong (*FT_Get_First_Char_t)(FT_Face, FT_UInt*);
132 typedef FT_ULong (*FT_Get_Next_Char_t)(FT_Face, FT_ULong, FT_UInt*);
134 FT_Outline_Decompose_t nsFT_Outline_Decompose;
135 FT_Set_Charmap_t nsFT_Set_Charmap;
136 FTC_Image_Cache_Lookup_t nsFTC_Image_Cache_Lookup;
137 - FTC_Manager_Lookup_Size_t nsFTC_Manager_Lookup_Size;
138 + FTC_Manager_LookupFace_t nsFTC_Manager_LookupFace;
139 FTC_Manager_Done_t nsFTC_Manager_Done;
140 FTC_Manager_New_t nsFTC_Manager_New;
141 FTC_Image_Cache_New_t nsFTC_Image_Cache_New;
143 PRLibrary *mSharedLib;
144 FT_Library mFreeTypeLibrary;
145 FTC_Manager mFTCacheManager;
146 - FTC_Image_Cache mImageCache;
147 + FTC_ImageCache mImageCache;
149 static nsHashtable *sFontFamilies;
150 static nsHashtable *sRange1CharSetNames;
151 --- mozilla/gfx/src/ps/nsFontMetricsPS.cpp.orig 2004-07-10 18:48:23.000000000 +0000
152 +++ mozilla/gfx/src/ps/nsFontMetricsPS.cpp 2004-07-10 18:57:02.000000000 +0000
153 @@ -1126,10 +1126,10 @@
155 mPixelSize = NSToIntRound(app2dev * mFont->size);
157 - mImageDesc.font.face_id = (void*)mEntry;
158 - mImageDesc.font.pix_width = mPixelSize;
159 - mImageDesc.font.pix_height = mPixelSize;
160 - mImageDesc.image_type = 0;
161 + mImageDesc->face_id = (FTC_FaceID)&mEntry;
162 + mImageDesc->width = mPixelSize;
163 + mImageDesc->height = mPixelSize;
164 + mImageDesc->flags = 0;
167 mFt2 = do_GetService(NS_FREETYPE2_CONTRACTID, &rv);
168 @@ -1175,7 +1175,7 @@
172 - FTC_Image_Cache iCache;
173 + FTC_ImageCache iCache;
174 nsresult rv = mFt2->GetImageCache(&iCache);
176 NS_ERROR("Failed to get Image Cache");
177 @@ -1213,8 +1213,8 @@
179 FTC_Manager cManager;
180 mFt2->GetFTCacheManager(&cManager);
181 - nsresult rv = mFt2->ManagerLookupSize(cManager, &mImageDesc.font,
183 + nsresult rv = mFt2->ManagerLookupFace(cManager, mImageDesc->face_id,
185 NS_ASSERTION(rv==0, "failed to get face/size");
188 @@ -1609,16 +1609,16 @@
189 mEntry->GetFamilyName(fontName);
190 mEntry->GetStyleName(styleName);
192 - mImageDesc.font.face_id = (void*)mEntry;
193 + mImageDesc->face_id = (FTC_FaceID)&mEntry;
194 // TT glyph has no relation to size
195 - mImageDesc.font.pix_width = 16;
196 - mImageDesc.font.pix_height = 16;
197 - mImageDesc.image_type = 0;
198 + mImageDesc->width = 16;
199 + mImageDesc->height = 16;
200 + mImageDesc->flags = 0;
201 FT_Face face = nsnull;
202 FTC_Manager cManager;
203 mFt2->GetFTCacheManager(&cManager);
204 - nsresult rv = mFt2->ManagerLookupSize(cManager, &mImageDesc.font,
206 + nsresult rv = mFt2->ManagerLookupFace(cManager, mImageDesc->face_id,
211 --- mozilla/gfx/src/ps/nsFontMetricsPS.h.orig 2004-07-10 18:58:54.000000000 +0000
212 +++ mozilla/gfx/src/ps/nsFontMetricsPS.h 2004-07-10 19:00:11.000000000 +0000
214 nsCOMPtr<nsITrueTypeFontCatalogEntry> mFaceID;
215 nsCOMPtr<nsIFreeType2> mFt2;
217 - FTC_Image_Desc mImageDesc;
218 + FTC_ImageType mImageDesc;
221 static PRBool AddUserPref(nsIAtom *aLang, const nsFont& aFont,
224 nsCOMPtr<nsITrueTypeFontCatalogEntry> mEntry;
225 nsCOMPtr<nsIFreeType2> mFt2;
226 - FTC_Image_Desc mImageDesc;
227 + FTC_ImageType mImageDesc;
231 --- mozilla/gfx/src/x11shared/nsFontFreeType.cpp.orig 2004-07-10 19:01:13.000000000 +0000
232 +++ mozilla/gfx/src/x11shared/nsFontFreeType.cpp 2004-07-10 19:05:19.000000000 +0000
236 mFt2->GetFTCacheManager(&mgr);
237 - rv = mFt2->ManagerLookupSize(mgr, &mImageDesc.font, &face, nsnull);
238 + rv = mFt2->ManagerLookupFace(mgr, mImageDesc->face_id, &face);
239 NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get face/size");
242 @@ -191,22 +191,15 @@
243 PRBool embedded_bimap = PR_FALSE;
245 mPixelSize = aPixelSize;
246 - mImageDesc.font.face_id = (void*)mFaceID;
247 - mImageDesc.font.pix_width = aPixelSize;
248 - mImageDesc.font.pix_height = aPixelSize;
249 - mImageDesc.image_type = 0;
250 + mImageDesc->face_id = (FTC_FaceID)&mFaceID;
251 + mImageDesc->width = aPixelSize;
252 + mImageDesc->height = aPixelSize;
253 + mImageDesc->flags = 0;
255 if (aPixelSize < nsFreeType2::gAntiAliasMinimum) {
256 - mImageDesc.image_type |= ftc_image_mono;
257 anti_alias = PR_FALSE;
260 - if (nsFreeType2::gFreeType2Autohinted)
261 - mImageDesc.image_type |= ftc_image_flag_autohinted;
263 - if (nsFreeType2::gFreeType2Unhinted)
264 - mImageDesc.image_type |= ftc_image_flag_unhinted;
266 PRUint32 num_embedded_bitmaps, i;
267 PRInt32* embedded_bitmapheights;
268 mFaceID->GetEmbeddedBitmapHeights(&num_embedded_bitmaps,
270 if (embedded_bitmapheights[i] == aPixelSize) {
271 embedded_bimap = PR_TRUE;
272 // unhinted must be set for embedded bitmaps to be used
273 - mImageDesc.image_type |= ftc_image_flag_unhinted;
279 return NS_ERROR_FAILURE;
281 - FTC_Image_Cache icache;
282 + FTC_ImageCache icache;
283 mFt2->GetImageCache(&icache);
285 return NS_ERROR_FAILURE;
290 - FTC_Image_Cache icache;
291 + FTC_ImageCache icache;
292 mFt2->GetImageCache(&icache);
296 if (y%4==0) (*blendPixelFunc)(sub_image, y, ascent-1, black, 255/2);
299 - FTC_Image_Cache icache;
300 + FTC_ImageCache icache;
301 mFt2->GetImageCache(&icache);
304 --- mozilla/gfx/src/x11shared/nsFontFreeType.h.orig 2004-07-10 19:05:31.000000000 +0000
305 +++ mozilla/gfx/src/x11shared/nsFontFreeType.h 2004-07-10 19:05:59.000000000 +0000
307 XImage *GetXImage(PRUint32 width, PRUint32 height);
308 nsITrueTypeFontCatalogEntry *mFaceID;
310 - FTC_Image_Desc mImageDesc;
311 + FTC_ImageType mImageDesc;
312 nsCOMPtr<nsIFreeType2> mFt2;