Formatting, copyright years, minor doc fixes.
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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346
diff --git a/ChangeLog b/ChangeLog
index 559fef5..a59b5b2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,14 +1,18 @@
2006-02-17 David Turner <david@freetype.org>
- * builds/unix/unix-cc.in: don't filter-out exported functions
- anymore, this is used to ensure that all FT_BASE internal
- functions are available for dynamic linking
-
- * include/freetype/ftcache.h, src/cache/ftcbasic.c,
- src/cache/ftccmap.c: try to revive old functions of the
- cache sub-system. We also try to support FTC_ImageCache_Lookup
- and FTC_ImageCache_SBit with legacy signatures through a gross
- hack (hope it works)
+ * builds/unix/unix-cc.in (LINK_LIBRARY): Don't filter out exported
+ functions anymore. This ensures that all FT_BASE internal functions
+ are available for dynamic linking.
+
+ * include/freetype/ftcache.h (FTC_IMAGE_TYPE_COMPARE,
+ FTC_IMAGE_TYPE_HASH), src/cache/ftcbasic.c (FTC_OldFontRec,
+ FTC_OldImageDescRec, FTC_ImageCache_Lookup, FTC_Image_Cache_New,
+ FTC_OldImage_Desc, FTC_OLD_IMAGE_FORMAT, ftc_old_image_xxx,
+ ftc_image_type_from_old_desc, FTC_Image_Cache_Lookup,
+ FTC_SBitCache_Lookup, FTC_SBit_Cache_New, FTC_SBit_Cache_Lookup)
+ [FT_CONFIG_OPTION_OLD_INTERNALS]: Try to revive old functions of the
+ cache sub-system. We try to recognize old legacy signatures with a
+ gross hack (hope it works).
2006-02-17 Werner Lemberg <wl@gnu.org>
diff --git a/builds/unix/unix-cc.in b/builds/unix/unix-cc.in
index 42c8afd..9d31ac2 100644
--- a/builds/unix/unix-cc.in
+++ b/builds/unix/unix-cc.in
@@ -98,6 +98,7 @@ CCexe := $(CCraw) # used to compile "apinames" only
#
LINK_LIBRARY = $(LIBTOOL) --mode=link $(CCraw) -o $@ $(OBJECTS_LIST) \
-rpath $(libdir) -version-info $(version_info) \
- $(LDFLAGS) #-export-symbols $(EXPORTS_LIST) -no-undefined
+ $(LDFLAGS) \
+ # -export-symbols $(EXPORTS_LIST) -no-undefined
# EOF
diff --git a/include/freetype/ftcache.h b/include/freetype/ftcache.h
index d549532..7b2c613 100644
--- a/include/freetype/ftcache.h
+++ b/include/freetype/ftcache.h
@@ -180,10 +180,10 @@ FT_BEGIN_HEADER
(f1)->pix_width == (f2)->pix_width && \
(f1)->pix_height == (f2)->pix_height )
-#define FT_POINTER_TO_ULONG( p ) ((FT_ULong)(FT_Pointer)(p))
+#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 ) ^ \
+#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 ) \
@@ -575,19 +575,21 @@ FT_BEGIN_HEADER
} FTC_ImageTypeRec;
- typedef struct FTC_ImageTypeRec_* FTC_ImageType;
+ typedef struct FTC_ImageTypeRec_* FTC_ImageType;
+
+
+ /* */
- /* */
-#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \
- ( (d1)->face_id == (d2)->face_id && \
- (d1)->width == (d2)->width && \
- (d1)->flags == (d2)->flags )
+#define FTC_IMAGE_TYPE_COMPARE( d1, d2 ) \
+ ( (d1)->face_id == (d2)->face_id && \
+ (d1)->width == (d2)->width && \
+ (d1)->flags == (d2)->flags )
-#define FTC_IMAGE_TYPE_HASH( d ) \
- (FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \
- ((d)->width << 8) ^ (d)->height ^ \
- ( (d)->flags << 4 ) )
+#define FTC_IMAGE_TYPE_HASH( d ) \
+ (FT_UFast)( FTC_FACE_ID_HASH( (d)->face_id ) ^ \
+ ( (d)->width << 8 ) ^ (d)->height ^ \
+ ( (d)->flags << 4 ) )
/*************************************************************************/
diff --git a/src/cache/ftcbasic.c b/src/cache/ftcbasic.c
index 6190a30..c3bb79f 100644
--- a/src/cache/ftcbasic.c
+++ b/src/cache/ftcbasic.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType basic cache interface (body). */
/* */
-/* Copyright 2003, 2004, 2005 by */
+/* Copyright 2003, 2004, 2005, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -26,38 +26,45 @@
#include "ftccback.h"
#include "ftcerror.h"
+
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- /* these correspond to the FTC_Font and FTC_ImageDesc types
- * that were defined in FT 2.1.7
- */
- typedef struct
+ /*
+ * These structures correspond to the FTC_Font and FTC_ImageDesc types
+ * that were defined in version 2.1.7.
+ */
+ typedef struct FTC_OldFontRec_
{
- FTC_FaceID face_id;
- FT_UShort pix_width;
- FT_UShort pix_height;
+ FTC_FaceID face_id;
+ FT_UShort pix_width;
+ FT_UShort pix_height;
} FTC_OldFontRec, *FTC_OldFont;
- typedef struct
+
+ typedef struct FTC_OldImageDescRec_
{
FTC_OldFontRec font;
FT_UInt32 flags;
} FTC_OldImageDescRec, *FTC_OldImageDesc;
- /* notice that FTC_OldImageDescRec and FTC_ImageTypeRec are nearly
- * identical, bit-wise. The only difference is that the 'width' and
- * 'height' fields are expressed as 16-bit integers in the old structure,
- * and as normal 'int' in the new one
- *
- * we're going to perform a weird hack to detect which structure is being
- * passed to the image and sbit caches. If the new structure's 'width'
- * is larger than 0x10000, we assume that we're really receiving a
- * FTC_OldImageDesc.
- */
+
+ /*
+ * Notice that FTC_OldImageDescRec and FTC_ImageTypeRec are nearly
+ * identical, bit-wise. The only difference is that the `width' and
+ * `height' fields are expressed as 16-bit integers in the old structure,
+ * and as normal `int' in the new one.
+ *
+ * We are going to perform a weird hack to detect which structure is
+ * being passed to the image and sbit caches. If the new structure's
+ * `width' is larger than 0x10000, we assume that we are really receiving
+ * an FTC_OldImageDesc.
+ */
+
#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
+
/*
* Basic Families
*
@@ -314,19 +321,24 @@
*anode = NULL;
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- /* this one is a major hack used to detect wether we're passed a
- * regular FTC_ImageType handle, or a legacy FTC_OldImageDesc one
- */
+
+ /*
+ * This one is a major hack used to detect whether we are passed a
+ * regular FTC_ImageType handle, or a legacy FTC_OldImageDesc one.
+ */
if ( type->width >= 0x10000 )
{
FTC_OldImageDesc desc = (FTC_OldImageDesc)type;
+
query.attrs.scaler.face_id = desc->font.face_id;
query.attrs.scaler.width = desc->font.pix_width;
query.attrs.scaler.height = desc->font.pix_height;
query.attrs.load_flags = desc->flags;
}
-#endif
+
+#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
+
{
query.attrs.scaler.face_id = type->face_id;
query.attrs.scaler.width = type->width;
@@ -334,9 +346,9 @@
query.attrs.load_flags = type->flags;
}
- query.attrs.scaler.pixel = 1;
- query.attrs.scaler.x_res = 0; /* make compilers happy */
- query.attrs.scaler.y_res = 0;
+ query.attrs.scaler.pixel = 1;
+ query.attrs.scaler.x_res = 0; /* make compilers happy */
+ query.attrs.scaler.y_res = 0;
hash = FTC_BASIC_ATTR_HASH( &query.attrs ) + gindex;
@@ -380,14 +392,15 @@
}
- /* yet another backwards-legacy structure... yukkk */
- typedef struct
+ /* yet another backwards-legacy structure */
+ typedef struct FTC_OldImage_Desc_
{
FTC_FontRec font;
FT_UInt image_type;
} FTC_OldImage_Desc;
+
#define FTC_OLD_IMAGE_FORMAT( x ) ( (x) & 7 )
@@ -403,7 +416,7 @@
#define ftc_old_image_flag_no_sbits 0x0100
/* monochrome bitmap */
-#define ftc_old_image_mono ftc_old_image_format_bitmap | \
+#define ftc_old_image_mono ftc_old_image_format_bitmap | \
ftc_old_image_flag_monochrome
/* anti-aliased bitmap */
@@ -461,6 +474,7 @@
}
}
+
FT_EXPORT_DEF( FT_Error )
FTC_Image_Cache_Lookup( FTC_ImageCache icache,
FTC_OldImage_Desc* desc,
@@ -561,19 +575,23 @@
*ansbit = NULL;
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- /* this one is a major hack used to detect wether we're passed a
- * regular FTC_ImageType handle, or a legacy FTC_OldImageDesc one
- */
+
+ /* This one is a major hack used to detect whether we are passed a
+ * regular FTC_ImageType handle, or a legacy FTC_OldImageDesc one.
+ */
if ( type->width >= 0x10000 )
{
FTC_OldImageDesc desc = (FTC_OldImageDesc)type;
+
query.attrs.scaler.face_id = desc->font.face_id;
query.attrs.scaler.width = desc->font.pix_width;
query.attrs.scaler.height = desc->font.pix_height;
query.attrs.load_flags = desc->flags;
}
-#endif
+
+#endif /* FT_CONFIG_OPTION_OLD_INTERNALS */
+
{
query.attrs.scaler.face_id = type->face_id;
query.attrs.scaler.width = type->width;
@@ -581,9 +599,9 @@
query.attrs.load_flags = type->flags;
}
- query.attrs.scaler.pixel = 1;
- query.attrs.scaler.x_res = 0; /* make compilers happy */
- query.attrs.scaler.y_res = 0;
+ query.attrs.scaler.pixel = 1;
+ query.attrs.scaler.x_res = 0; /* make compilers happy */
+ query.attrs.scaler.y_res = 0;
/* beware, the hash must be the same for all glyph ranges! */
hash = FTC_BASIC_ATTR_HASH( &query.attrs ) +
@@ -619,6 +637,7 @@
return error;
}
+
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
FT_EXPORT_DEF( FT_Error )
diff --git a/src/cache/ftccmap.c b/src/cache/ftccmap.c
index 2a8d21c..0f7306f 100644
--- a/src/cache/ftccmap.c
+++ b/src/cache/ftccmap.c
@@ -4,7 +4,7 @@
/* */
/* FreeType CharMap cache (body) */
/* */
-/* Copyright 2000-2001, 2002, 2003, 2004, 2005 by */
+/* Copyright 2000-2001, 2002, 2003, 2004, 2005, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -225,16 +225,20 @@
#ifdef FT_CONFIG_OPTION_OLD_INTERNALS
- /* unfortunately, it is not possible to support binary backwards
- * compatibility in the cmap cache. the FTC_CMapCache_Lookup signature
- * changes were too deep, and there is no clever hackish way to detect
- * what kind of structure we're being passed.
- *
- * fortunately, it seems that no production code is using this function
- * on Unix distributions.
- */
+
+ /*
+ * Unfortunately, it is not possible to support binary backwards
+ * compatibility in the cmap cache. The FTC_CMapCache_Lookup signature
+ * changes were too deep, and there is no clever hackish way to detect
+ * what kind of structure we are being passed.
+ *
+ * On the other hand it seems that no production code is using this
+ * function on Unix distributions.
+ */
+
#endif
+
/* documentation is in ftcache.h */
FT_EXPORT_DEF( FT_UInt )
@@ -311,5 +315,4 @@
}
-
/* END */