shithub: freetype+ttf2subf

Download patch

ref: 2d62446da91575ad3315b9b4f304f0429ca0b63d
parent: b4e18f1d6a57bd2d1de35c3b6a045063919b8b93
author: Werner Lemberg <[email protected]>
date: Fri Oct 25 08:22:31 EDT 2002

* include/freetype/ftcache.h (FT_POINTER_TO_ULONG): New macro.
(FTC_FACE_ID_HASH): Rewritten, using FT_POINTER_TO_ULONG.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-10-25  David Turner  <[email protected]>
+
+	* include/freetype/ftcache.h (FT_POINTER_TO_ULONG): New macro.
+	(FTC_FACE_ID_HASH): Rewritten, using FT_POINTER_TO_ULONG.
+
 2002-10-22  Giuseppe Ghib� <[email protected]>
 
 	* include/freetype/freetype.h (FT_Encoding): Fix entry for latin-2.
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -548,7 +548,7 @@
   /* <Values>                                                              */
   /*   ft_encoding_none    :: see @FT_ENCODING_NONE                        */
   /*   ft_encoding_unicode :: see @FT_ENCODING_UNICODE                     */
-  /*   ft_encoding_latin_2 :: see @FT_ENCODING_LATIN_2                     */
+  /*   ft_encoding_latin_2 :: see @FT_ENCODING_OLD_LATIN_2                 */
   /*   ft_encoding_symbol  :: see @FT_ENCODING_MS_SYMBOL                   */
   /*   ft_encoding_sjis    :: see @FT_ENCODING_MS_SJIS                     */
   /*   ft_encoding_gb2312  :: see @FT_ENCODING_MS_GB2312                   */
--- a/include/freetype/ftcache.h
+++ b/include/freetype/ftcache.h
@@ -183,7 +183,11 @@
             (f1)->pix_width  == (f2)->pix_width  && \
             (f1)->pix_height == (f2)->pix_height )
 
-#define FTC_FACE_ID_HASH( i )  ((FT_UInt32)(FT_Pointer)( i ))
+#define FT_POINTER_TO_ULONG( p )  ((FT_ULong)(FT_Pointer)(p))
+
+#define FTC_FACE_ID_HASH( i )                              \
+          ((FT_UInt32)(( FT_POINTER_TO_ULONG( i ) >> 3 ) ^ \
+                       ( FT_POINTER_TO_ULONG( i ) << 7 ) ) )
 
 #define FTC_FONT_HASH( f )                              \
           (FT_UInt32)( FTC_FACE_ID_HASH((f)->face_id) ^ \