OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

329 lines
13 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../thunderbird/freetype.patch
  5. # Copyright (C) 2004 - 2006 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. diff -Naur mozilla_orig/gfx/idl/nsIFreeType2.idl mozilla/gfx/idl/nsIFreeType2.idl
  17. --- mozilla_orig/gfx/idl/nsIFreeType2.idl 2004-04-16 03:09:33.000000000 +0200
  18. +++ mozilla/gfx/idl/nsIFreeType2.idl 2005-09-10 11:45:04.739957520 +0200
  19. @@ -76,10 +76,11 @@
  20. native FT_Sfnt_Tag(FT_Sfnt_Tag);
  21. native FT_Size(FT_Size);
  22. -[ptr] native FTC_Image_Desc_p(FTC_Image_Desc);
  23. +[ptr] native FTC_ImageType_p(FTC_ImageType);
  24. native FTC_Face_Requester(FTC_Face_Requester);
  25. native FTC_Font(FTC_Font);
  26. -native FTC_Image_Cache(FTC_Image_Cache);
  27. +native FTC_FaceID(FTC_FaceID);
  28. +native FTC_ImageCache(FTC_ImageCache);
  29. native FTC_Manager(FTC_Manager);
  30. // #ifdef MOZ_SVG
  31. @@ -99,7 +100,7 @@
  32. readonly attribute FT_Library library;
  33. readonly attribute FTC_Manager FTCacheManager;
  34. - readonly attribute FTC_Image_Cache ImageCache;
  35. + readonly attribute FTC_ImageCache ImageCache;
  36. void doneFace(in FT_Face face);
  37. void doneFreeType(in FT_Library lib);
  38. @@ -115,16 +116,16 @@
  39. void outlineDecompose(in FT_Outline_p outline,
  40. in const_FT_Outline_Funcs_p funcs, in voidPtr p);
  41. void setCharmap(in FT_Face face, in FT_CharMap charmap);
  42. - void imageCacheLookup(in FTC_Image_Cache cache, in FTC_Image_Desc_p desc,
  43. + void imageCacheLookup(in FTC_ImageCache cache, in FTC_ImageType_p desc,
  44. in FT_UInt gindex, out FT_Glyph glyph);
  45. - void managerLookupSize(in FTC_Manager manager, in FTC_Font font,
  46. - out FT_Face face, out FT_Size size);
  47. + void managerLookupFace(in FTC_Manager manager, in FTC_FaceID face_id,
  48. + out FT_Face face);
  49. void managerDone(in FTC_Manager manager);
  50. void managerNew(in FT_Library lib, in FT_UInt max_faces,
  51. in FT_UInt max_sizes, in FT_ULong max_bytes,
  52. in FTC_Face_Requester requester, in FT_Pointer req_data,
  53. out FTC_Manager manager);
  54. - void imageCacheNew(in FTC_Manager manager, out FTC_Image_Cache cache);
  55. + void imageCacheNew(in FTC_Manager manager, out FTC_ImageCache cache);
  56. /* #ifdef MOZ_SVG */
  57. void glyphTransform(in FT_Glyph glyph, in FT_Matrix_p matrix,
  58. in FT_Vector_p delta);
  59. diff -Naur mozilla_orig/gfx/src/freetype/nsFreeType.cpp mozilla/gfx/src/freetype/nsFreeType.cpp
  60. --- mozilla_orig/gfx/src/freetype/nsFreeType.cpp 2004-02-07 16:22:30.000000000 +0100
  61. +++ mozilla/gfx/src/freetype/nsFreeType.cpp 2005-09-10 11:45:04.741957216 +0200
  62. @@ -110,11 +110,11 @@
  63. {"FT_New_Face", NS_FT2_OFFSET(nsFT_New_Face), PR_TRUE},
  64. {"FT_Outline_Decompose", NS_FT2_OFFSET(nsFT_Outline_Decompose), PR_TRUE},
  65. {"FT_Set_Charmap", NS_FT2_OFFSET(nsFT_Set_Charmap), PR_TRUE},
  66. - {"FTC_Image_Cache_Lookup", NS_FT2_OFFSET(nsFTC_Image_Cache_Lookup), PR_TRUE},
  67. - {"FTC_Manager_Lookup_Size", NS_FT2_OFFSET(nsFTC_Manager_Lookup_Size), PR_TRUE},
  68. + {"FTC_ImageCache_Lookup", NS_FT2_OFFSET(nsFTC_Image_Cache_Lookup), PR_TRUE},
  69. + {"FTC_Manager_LookupFace", NS_FT2_OFFSET(nsFTC_Manager_LookupFace), PR_TRUE},
  70. {"FTC_Manager_Done", NS_FT2_OFFSET(nsFTC_Manager_Done), PR_TRUE},
  71. {"FTC_Manager_New", NS_FT2_OFFSET(nsFTC_Manager_New), PR_TRUE},
  72. - {"FTC_Image_Cache_New", NS_FT2_OFFSET(nsFTC_Image_Cache_New), PR_TRUE},
  73. + {"FTC_ImageCache_New", NS_FT2_OFFSET(nsFTC_Image_Cache_New), PR_TRUE},
  74. // #ifdef MOZ_SVG
  75. {"FT_Glyph_Transform", NS_FT2_OFFSET(nsFT_Glyph_Transform), PR_TRUE},
  76. {"FT_Get_Kerning", NS_FT2_OFFSET(nsFT_Get_Kerning), PR_TRUE},
  77. @@ -282,7 +282,7 @@
  78. }
  79. NS_IMETHODIMP
  80. -nsFreeType2::ImageCacheLookup(FTC_Image_Cache cache, FTC_Image_Desc *desc,
  81. +nsFreeType2::ImageCacheLookup(FTC_ImageCache cache, FTC_ImageType *desc,
  82. FT_UInt glyphID, FT_Glyph *glyph)
  83. {
  84. // call the FreeType2 function via the function pointer
  85. @@ -291,11 +291,11 @@
  86. }
  87. NS_IMETHODIMP
  88. -nsFreeType2::ManagerLookupSize(FTC_Manager manager, FTC_Font font,
  89. - FT_Face *face, FT_Size *size)
  90. +nsFreeType2::ManagerLookupFace(FTC_Manager manager, FTC_FaceID face_id,
  91. + FT_Face *face)
  92. {
  93. // call the FreeType2 function via the function pointer
  94. - FT_Error error = nsFTC_Manager_Lookup_Size(manager, font, face, size);
  95. + FT_Error error = nsFTC_Manager_LookupFace(manager, face_id, face);
  96. return error ? NS_ERROR_FAILURE : NS_OK;
  97. }
  98. @@ -320,7 +320,7 @@
  99. }
  100. NS_IMETHODIMP
  101. -nsFreeType2::ImageCacheNew(FTC_Manager manager, FTC_Image_Cache *cache)
  102. +nsFreeType2::ImageCacheNew(FTC_Manager manager, FTC_ImageCache *cache)
  103. {
  104. // call the FreeType2 function via the function pointer
  105. FT_Error error = nsFTC_Image_Cache_New(manager, cache);
  106. @@ -389,7 +389,7 @@
  107. }
  108. NS_IMETHODIMP
  109. -nsFreeType2::GetImageCache(FTC_Image_Cache *aCache)
  110. +nsFreeType2::GetImageCache(FTC_ImageCache *aCache)
  111. {
  112. *aCache = mImageCache;
  113. return NS_OK;
  114. diff -Naur mozilla_orig/gfx/src/freetype/nsFreeType.h mozilla/gfx/src/freetype/nsFreeType.h
  115. --- mozilla_orig/gfx/src/freetype/nsFreeType.h 2004-04-16 23:31:42.000000000 +0200
  116. +++ mozilla/gfx/src/freetype/nsFreeType.h 2005-09-10 11:45:04.744956760 +0200
  117. @@ -104,13 +104,13 @@
  118. typedef FT_Error (*FT_New_Face_t)(FT_Library, const char*, FT_Long, FT_Face*);
  119. typedef FT_Error (*FT_Set_Charmap_t)(FT_Face face, FT_CharMap charmap);
  120. typedef FT_Error (*FTC_Image_Cache_Lookup_t)
  121. - (FTC_Image_Cache, FTC_Image_Desc*, FT_UInt, FT_Glyph*);
  122. -typedef FT_Error (*FTC_Manager_Lookup_Size_t)
  123. - (FTC_Manager, FTC_Font, FT_Face*, FT_Size*);
  124. + (FTC_ImageCache, FTC_ImageType*, FT_UInt, FT_Glyph*);
  125. +typedef FT_Error (*FTC_Manager_LookupFace_t)
  126. + (FTC_Manager, FTC_FaceID, FT_Face*);
  127. typedef FT_Error (*FTC_Manager_Done_t)(FTC_Manager);
  128. typedef FT_Error (*FTC_Manager_New_t)(FT_Library, FT_UInt, FT_UInt, FT_ULong,
  129. FTC_Face_Requester, FT_Pointer, FTC_Manager*);
  130. -typedef FT_Error (*FTC_Image_Cache_New_t)(FTC_Manager, FTC_Image_Cache*);
  131. +typedef FT_Error (*FTC_Image_Cache_New_t)(FTC_Manager, FTC_ImageCache*);
  132. // #ifdef MOZ_SVG
  133. typedef FT_Error (*FT_Glyph_Transform_t)(FT_Glyph, FT_Matrix*, FT_Vector*);
  134. typedef FT_Error (*FT_Get_Kerning_t)
  135. @@ -165,7 +165,7 @@
  136. FT_Outline_Decompose_t nsFT_Outline_Decompose;
  137. FT_Set_Charmap_t nsFT_Set_Charmap;
  138. FTC_Image_Cache_Lookup_t nsFTC_Image_Cache_Lookup;
  139. - FTC_Manager_Lookup_Size_t nsFTC_Manager_Lookup_Size;
  140. + FTC_Manager_LookupFace_t nsFTC_Manager_LookupFace;
  141. FTC_Manager_Done_t nsFTC_Manager_Done;
  142. FTC_Manager_New_t nsFTC_Manager_New;
  143. FTC_Image_Cache_New_t nsFTC_Image_Cache_New;
  144. @@ -213,7 +213,7 @@
  145. PRLibrary *mSharedLib;
  146. FT_Library mFreeTypeLibrary;
  147. FTC_Manager mFTCacheManager;
  148. - FTC_Image_Cache mImageCache;
  149. + FTC_ImageCache mImageCache;
  150. static nsHashtable *sFontFamilies;
  151. static nsHashtable *sRange1CharSetNames;
  152. diff -Naur mozilla_orig/gfx/src/ps/nsFontMetricsPS.cpp mozilla/gfx/src/ps/nsFontMetricsPS.cpp
  153. --- mozilla_orig/gfx/src/ps/nsFontMetricsPS.cpp 2004-02-05 02:57:05.000000000 +0100
  154. +++ mozilla/gfx/src/ps/nsFontMetricsPS.cpp 2005-09-10 11:45:04.747956304 +0200
  155. @@ -1141,10 +1141,10 @@
  156. 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;
  165. nsresult rv;
  166. mFt2 = do_GetService(NS_FREETYPE2_CONTRACTID, &rv);
  167. @@ -1190,7 +1190,7 @@
  168. if (!face)
  169. return 0;
  170. - FTC_Image_Cache iCache;
  171. + FTC_ImageCache iCache;
  172. nsresult rv = mFt2->GetImageCache(&iCache);
  173. if (NS_FAILED(rv)) {
  174. NS_ERROR("Failed to get Image Cache");
  175. @@ -1228,8 +1228,8 @@
  176. FTC_Manager cManager;
  177. mFt2->GetFTCacheManager(&cManager);
  178. - nsresult rv = mFt2->ManagerLookupSize(cManager, &mImageDesc.font,
  179. - &face, nsnull);
  180. + nsresult rv = mFt2->ManagerLookupFace(cManager, mImageDesc->face_id,
  181. + &face);
  182. NS_ASSERTION(rv==0, "failed to get face/size");
  183. if (rv)
  184. return nsnull;
  185. @@ -1622,16 +1622,16 @@
  186. mEntry->GetFamilyName(fontName);
  187. mEntry->GetStyleName(styleName);
  188. - mImageDesc.font.face_id = (void*)mEntry;
  189. + mImageDesc->face_id = (FTC_FaceID)&mEntry;
  190. // TT glyph has no relation to size
  191. - mImageDesc.font.pix_width = 16;
  192. - mImageDesc.font.pix_height = 16;
  193. - mImageDesc.image_type = 0;
  194. + mImageDesc->width = 16;
  195. + mImageDesc->height = 16;
  196. + mImageDesc->flags = 0;
  197. FT_Face face = nsnull;
  198. FTC_Manager cManager;
  199. mFt2->GetFTCacheManager(&cManager);
  200. - nsresult rv = mFt2->ManagerLookupSize(cManager, &mImageDesc.font,
  201. - &face, nsnull);
  202. + nsresult rv = mFt2->ManagerLookupFace(cManager, mImageDesc->face_id,
  203. + &face);
  204. if (NS_FAILED(rv))
  205. return;
  206. diff -Naur mozilla_orig/gfx/src/ps/nsFontMetricsPS.h mozilla/gfx/src/ps/nsFontMetricsPS.h
  207. --- mozilla_orig/gfx/src/ps/nsFontMetricsPS.h 2003-04-22 18:25:09.000000000 +0200
  208. +++ mozilla/gfx/src/ps/nsFontMetricsPS.h 2005-09-10 11:45:04.748956152 +0200
  209. @@ -424,7 +424,7 @@
  210. nsCOMPtr<nsITrueTypeFontCatalogEntry> mFaceID;
  211. nsCOMPtr<nsIFreeType2> mFt2;
  212. PRUint16 mPixelSize;
  213. - FTC_Image_Desc mImageDesc;
  214. + FTC_ImageType mImageDesc;
  215. nsCString mFontNameBase; // the base name of type 1 (sub) fonts
  216. nscoord mHeight;
  217. @@ -493,7 +493,7 @@
  218. protected:
  219. nsCOMPtr<nsITrueTypeFontCatalogEntry> mEntry;
  220. nsCOMPtr<nsIFreeType2> mFt2;
  221. - FTC_Image_Desc mImageDesc;
  222. + FTC_ImageType mImageDesc;
  223. };
  224. #endif // MOZ_ENABLE_FREETYPE2
  225. #endif // MOZ_ENABLE_XFT
  226. diff -Naur mozilla_orig/gfx/src/x11shared/nsFontFreeType.cpp mozilla/gfx/src/x11shared/nsFontFreeType.cpp
  227. --- mozilla_orig/gfx/src/x11shared/nsFontFreeType.cpp 2003-12-25 09:24:52.000000000 +0100
  228. +++ mozilla/gfx/src/x11shared/nsFontFreeType.cpp 2005-09-10 11:45:04.749956000 +0200
  229. @@ -177,7 +177,7 @@
  230. FTC_Manager mgr;
  231. nsresult rv;
  232. mFt2->GetFTCacheManager(&mgr);
  233. - rv = mFt2->ManagerLookupSize(mgr, &mImageDesc.font, &face, nsnull);
  234. + rv = mFt2->ManagerLookupFace(mgr, mImageDesc->face_id, &face);
  235. NS_ASSERTION(NS_SUCCEEDED(rv), "failed to get face/size");
  236. if (NS_FAILED(rv))
  237. return nsnull;
  238. @@ -191,22 +191,15 @@
  239. PRBool embedded_bimap = PR_FALSE;
  240. mFaceID = aFaceID;
  241. mPixelSize = aPixelSize;
  242. - mImageDesc.font.face_id = (void*)mFaceID;
  243. - mImageDesc.font.pix_width = aPixelSize;
  244. - mImageDesc.font.pix_height = aPixelSize;
  245. - mImageDesc.image_type = 0;
  246. + mImageDesc->face_id = (FTC_FaceID)&mFaceID;
  247. + mImageDesc->width = aPixelSize;
  248. + mImageDesc->height = aPixelSize;
  249. + mImageDesc->flags = 0;
  250. if (aPixelSize < nsFreeType2::gAntiAliasMinimum) {
  251. - mImageDesc.image_type |= ftc_image_mono;
  252. anti_alias = PR_FALSE;
  253. }
  254. - if (nsFreeType2::gFreeType2Autohinted)
  255. - mImageDesc.image_type |= ftc_image_flag_autohinted;
  256. -
  257. - if (nsFreeType2::gFreeType2Unhinted)
  258. - mImageDesc.image_type |= ftc_image_flag_unhinted;
  259. -
  260. PRUint32 num_embedded_bitmaps, i;
  261. PRInt32* embedded_bitmapheights;
  262. mFaceID->GetEmbeddedBitmapHeights(&num_embedded_bitmaps,
  263. @@ -218,7 +211,6 @@
  264. if (embedded_bitmapheights[i] == aPixelSize) {
  265. embedded_bimap = PR_TRUE;
  266. // unhinted must be set for embedded bitmaps to be used
  267. - mImageDesc.image_type |= ftc_image_flag_unhinted;
  268. break;
  269. }
  270. }
  271. @@ -312,7 +304,7 @@
  272. if (!face)
  273. return NS_ERROR_FAILURE;
  274. - FTC_Image_Cache icache;
  275. + FTC_ImageCache icache;
  276. mFt2->GetImageCache(&icache);
  277. if (!icache)
  278. return NS_ERROR_FAILURE;
  279. @@ -401,7 +393,7 @@
  280. if (!face)
  281. return 0;
  282. - FTC_Image_Cache icache;
  283. + FTC_ImageCache icache;
  284. mFt2->GetImageCache(&icache);
  285. if (!icache)
  286. return 0;
  287. @@ -723,7 +715,7 @@
  288. if (y%4==0) (*blendPixelFunc)(sub_image, y, ascent-1, black, 255/2);
  289. #endif
  290. - FTC_Image_Cache icache;
  291. + FTC_ImageCache icache;
  292. mFt2->GetImageCache(&icache);
  293. if (!icache)
  294. return 0;
  295. diff -Naur mozilla_orig/gfx/src/x11shared/nsFontFreeType.h mozilla/gfx/src/x11shared/nsFontFreeType.h
  296. --- mozilla_orig/gfx/src/x11shared/nsFontFreeType.h 2003-04-22 18:25:13.000000000 +0200
  297. +++ mozilla/gfx/src/x11shared/nsFontFreeType.h 2005-09-10 11:45:04.750955848 +0200
  298. @@ -110,7 +110,7 @@
  299. XImage *GetXImage(PRUint32 width, PRUint32 height);
  300. nsITrueTypeFontCatalogEntry *mFaceID;
  301. PRUint16 mPixelSize;
  302. - FTC_Image_Desc mImageDesc;
  303. + FTC_ImageType mImageDesc;
  304. nsCOMPtr<nsIFreeType2> mFt2;
  305. };