* include/freetype/config/ftconfig.h: Use CHAR_BIT to define size of FT_SIZEOF_xxx. * include/freetype/internal/sfnt.h (TT_Find_SBit_Image_Func, TT_Load_SBit_Metrics_Func): New typedefs. (SFNT_Interface): Add find_sbit_image and load_sbit_metrics. * src/sfnt/sfdriver.c (sfnt_interface): Updated. * src/sfnt/ttsbit.h (tt_find_sbit_image, tt_load_sbit_metrics): New declarations. * src/sfnt/ttsbit.c (find_sbit_image): Renamed to... (tt_find_sbit_image): This. Updated all callers. (load_sbit_metrics): Renamed to... (tt_load_sbit_metrics): This. Updated all callers.
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 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364
diff --git a/ChangeLog b/ChangeLog
index 12654d6..b4f5ab7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2004-04-13 Werner Lemberg <wl@gnu.org>
+
+ * include/freetype/config/ftconfig.h: Use CHAR_BIT to define
+ size of FT_SIZEOF_xxx.
+
+2004-04-12 Chisato Yamauchi <cyamauch@a.phys.nagoya-u.ac.jp>
+
+ * include/freetype/internal/sfnt.h (TT_Find_SBit_Image_Func,
+ TT_Load_SBit_Metrics_Func): New typedefs.
+ (SFNT_Interface): Add find_sbit_image and load_sbit_metrics.
+
+ * src/sfnt/sfdriver.c (sfnt_interface): Updated.
+ * src/sfnt/ttsbit.h (tt_find_sbit_image, tt_load_sbit_metrics): New
+ declarations.
+ * src/sfnt/ttsbit.c (find_sbit_image): Renamed to...
+ (tt_find_sbit_image): This.
+ Updated all callers.
+ (load_sbit_metrics): Renamed to...
+ (tt_load_sbit_metrics): This.
+ Updated all callers.
+
2004-04-12 Werner Lemberg <wl@gnu.org>
* configure: Accept makepp also.
diff --git a/include/freetype/config/ftconfig.h b/include/freetype/config/ftconfig.h
index d23b73e..e7a4a22 100644
--- a/include/freetype/config/ftconfig.h
+++ b/include/freetype/config/ftconfig.h
@@ -4,7 +4,7 @@
/* */
/* ANSI-specific configuration file (specification only). */
/* */
-/* Copyright 1996-2001, 2002, 2003 by */
+/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -58,24 +58,32 @@ FT_BEGIN_HEADER
/*************************************************************************/
- /* The number of bytes in an `int' type. */
+ /* There are systems (like the Texas Instruments 'C54x) where a `char' */
+ /* has 16 bits. ANSI C says that sizeof(char) is always 1. Since an */
+ /* `int' has 16 bits also for this system, sizeof(int) gives 1 which */
+ /* is probably unexpected. */
+ /* */
+ /* `CHAR_BIT' (defined in limits.h) gives the number of bits in a */
+ /* `char' type. */
+
+ /* The size of an `int' type. */
#if FT_UINT_MAX == 0xFFFFFFFFUL
-#define FT_SIZEOF_INT 4
+#define FT_SIZEOF_INT (32 / CHAR_BIT)
#elif FT_UINT_MAX == 0xFFFFU
-#define FT_SIZEOF_INT 2
+#define FT_SIZEOF_INT (16 / CHAR_BIT)
#elif FT_UINT_MAX > 0xFFFFFFFFU && FT_UINT_MAX == 0xFFFFFFFFFFFFFFFFU
-#define FT_SIZEOF_INT 8
+#define FT_SIZEOF_INT (64 / CHAR_BIT)
#else
-#error "Unsupported number of bytes in `int' type!"
+#error "Unsupported size of `int' type!"
#endif
- /* The number of bytes in a `long' type. */
+ /* The size of a `long' type. */
#if FT_ULONG_MAX == 0xFFFFFFFFUL
-#define FT_SIZEOF_LONG 4
+#define FT_SIZEOF_LONG (32 / CHAR_BIT)
#elif FT_ULONG_MAX > 0xFFFFFFFFU && FT_ULONG_MAX == 0xFFFFFFFFFFFFFFFFU
-#define FT_SIZEOF_LONG 8
+#define FT_SIZEOF_LONG (64 / CHAR_BIT)
#else
-#error "Unsupported number of bytes in `long' type!"
+#error "Unsupported size of `long' type!"
#endif
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 4837637..6acf166 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -469,7 +469,7 @@ FT_BEGIN_HEADER
/* should redefine this macro in case of problems to something like */
/* this: */
/* */
- /* #define FT_ENC_TAG( value, a, b, c, d ) (value) */
+ /* #define FT_ENC_TAG( value, a, b, c, d ) value */
/* */
/* to get a simple enumeration without assigning special numbers. */
/* */
diff --git a/include/freetype/ftimage.h b/include/freetype/ftimage.h
index 2875965..4682a4c 100644
--- a/include/freetype/ftimage.h
+++ b/include/freetype/ftimage.h
@@ -5,7 +5,7 @@
/* FreeType glyph image formats and default raster interface */
/* (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2003 by */
+/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -657,7 +657,7 @@ FT_BEGIN_HEADER
/* should redefine this macro in case of problems to something like */
/* this: */
/* */
- /* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) (value) */
+ /* #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value */
/* */
/* to get a simple enumeration without assigning special numbers. */
/* */
diff --git a/include/freetype/internal/sfnt.h b/include/freetype/internal/sfnt.h
index 2a9a645..9a23b1f 100644
--- a/include/freetype/internal/sfnt.h
+++ b/include/freetype/internal/sfnt.h
@@ -4,7 +4,7 @@
/* */
/* High-level `sfnt' driver interface (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2003 by */
+/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -243,6 +243,76 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <FuncType> */
+ /* TT_Find_SBit_Image_Func */
+ /* */
+ /* <Description> */
+ /* Checks whether an embedded bitmap (an `sbit') exists for a given */
+ /* glyph, at a given strike. */
+ /* */
+ /* <Input> */
+ /* face :: The target face object. */
+ /* */
+ /* glyph_index :: The glyph index. */
+ /* */
+ /* strike_index :: The current strike index. */
+ /* */
+ /* <Output> */
+ /* arange :: The SBit range containing the glyph index. */
+ /* */
+ /* astrike :: The SBit strike containing the glyph index. */
+ /* */
+ /* aglyph_offset :: The offset of the glyph data in `EBDT' table. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. Returns */
+ /* SFNT_Err_Invalid_Argument if no sbit exists for the requested */
+ /* glyph. */
+ /* */
+ typedef FT_Error
+ (*TT_Find_SBit_Image_Func)( TT_Face face,
+ FT_UInt glyph_index,
+ FT_ULong strike_index,
+ TT_SBit_Range *arange,
+ TT_SBit_Strike *astrike,
+ FT_ULong *aglyph_offset );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
+ /* TT_Load_SBit_Metrics_Func */
+ /* */
+ /* <Description> */
+ /* Gets the big metrics for a given embedded bitmap. */
+ /* */
+ /* <Input> */
+ /* stream :: The input stream. */
+ /* */
+ /* range :: The SBit range containing the glyph. */
+ /* */
+ /* <Output> */
+ /* big_metrics :: A big SBit metrics structure for the glyph. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* The stream cursor must be positioned at the glyph's offset within */
+ /* the `EBDT' table before the call. */
+ /* */
+ /* If the image format uses variable metrics, the stream cursor is */
+ /* positioned just after the metrics header in the `EBDT' table on */
+ /* function exit. */
+ /* */
+ typedef FT_Error
+ (*TT_Load_SBit_Metrics_Func)( FT_Stream stream,
+ TT_SBit_Range range,
+ TT_SBit_Metrics metrics );
+
+
+ /*************************************************************************/
+ /* */
+ /* <FuncType> */
/* TT_Load_SBit_Image_Func */
/* */
/* <Description> */
@@ -459,6 +529,8 @@ FT_BEGIN_HEADER
/* see `ttsbit.h' */
TT_Set_SBit_Strike_Func set_sbit_strike;
TT_Load_Table_Func load_sbits;
+ TT_Find_SBit_Image_Func find_sbit_image;
+ TT_Load_SBit_Metrics_Func load_sbit_metrics;
TT_Load_SBit_Image_Func load_sbit_image;
TT_Free_Table_Func free_sbits;
diff --git a/src/sfnt/sfdriver.c b/src/sfnt/sfdriver.c
index c2bf948..7da53d2 100644
--- a/src/sfnt/sfdriver.c
+++ b/src/sfnt/sfdriver.c
@@ -4,7 +4,7 @@
/* */
/* High-level SFNT driver interface (body). */
/* */
-/* Copyright 1996-2001, 2002, 2003 by */
+/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -343,9 +343,11 @@
/* see `ttload.h' */
tt_face_load_bitmap_header,
- /* see `ttsbit.h' */
+ /* see `ttsbit.h' and `sfnt.h' */
tt_face_set_sbit_strike,
tt_face_load_sbit_strikes,
+ tt_find_sbit_image,
+ tt_load_sbit_metrics,
tt_face_load_sbit_image,
tt_face_free_sbit_strikes,
@@ -354,6 +356,8 @@
0,
0,
0,
+ 0,
+ 0,
0,
0,
diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c
index bb6f227..444c27a 100644
--- a/src/sfnt/ttsbit.c
+++ b/src/sfnt/ttsbit.c
@@ -754,7 +754,7 @@
/*************************************************************************/
/* */
/* <Function> */
- /* find_sbit_image */
+ /* tt_find_sbit_image */
/* */
/* <Description> */
/* Checks whether an embedded bitmap (an `sbit') exists for a given */
@@ -779,13 +779,13 @@
/* SFNT_Err_Invalid_Argument if no sbit exists for the requested */
/* glyph. */
/* */
- static FT_Error
- find_sbit_image( TT_Face face,
- FT_UInt glyph_index,
- FT_ULong strike_index,
- TT_SBit_Range *arange,
- TT_SBit_Strike *astrike,
- FT_ULong *aglyph_offset )
+ FT_LOCAL( FT_Error )
+ tt_find_sbit_image( TT_Face face,
+ FT_UInt glyph_index,
+ FT_ULong strike_index,
+ TT_SBit_Range *arange,
+ TT_SBit_Strike *astrike,
+ FT_ULong *aglyph_offset )
{
FT_Error error;
TT_SBit_Strike strike;
@@ -819,7 +819,7 @@
/*************************************************************************/
/* */
/* <Function> */
- /* load_sbit_metrics */
+ /* tt_load_sbit_metrics */
/* */
/* <Description> */
/* Gets the big metrics for a given SBit. */
@@ -843,10 +843,10 @@
/* positioned just after the metrics header in the `EBDT' table on */
/* function exit. */
/* */
- static FT_Error
- load_sbit_metrics( FT_Stream stream,
- TT_SBit_Range range,
- TT_SBit_Metrics metrics )
+ FT_LOCAL( FT_Error )
+ tt_load_sbit_metrics( FT_Stream stream,
+ TT_SBit_Range range,
+ TT_SBit_Metrics metrics )
{
FT_Error error = SFNT_Err_Ok;
@@ -1228,7 +1228,7 @@
if ( FT_STREAM_SEEK( ebdt_pos + glyph_offset ) )
goto Exit;
- error = load_sbit_metrics( stream, range, metrics );
+ error = tt_load_sbit_metrics( stream, range, metrics );
if ( error )
goto Exit;
@@ -1419,8 +1419,8 @@
/* Check whether there is a glyph sbit for the current index */
- error = find_sbit_image( face, glyph_index, strike_index,
- &range, &strike, &glyph_offset );
+ error = tt_find_sbit_image( face, glyph_index, strike_index,
+ &range, &strike, &glyph_offset );
if ( error )
goto Exit;
diff --git a/src/sfnt/ttsbit.h b/src/sfnt/ttsbit.h
index 89499bb..f1b63b7 100644
--- a/src/sfnt/ttsbit.h
+++ b/src/sfnt/ttsbit.h
@@ -4,7 +4,7 @@
/* */
/* TrueType and OpenType embedded bitmap support (specification). */
/* */
-/* Copyright 1996-2001, 2002, 2003 by */
+/* Copyright 1996-2001, 2002, 2003, 2004 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -42,6 +42,19 @@ FT_BEGIN_HEADER
FT_ULong *astrike_index );
FT_LOCAL( FT_Error )
+ tt_find_sbit_image( TT_Face face,
+ FT_UInt glyph_index,
+ FT_ULong strike_index,
+ TT_SBit_Range *arange,
+ TT_SBit_Strike *astrike,
+ FT_ULong *aglyph_offset );
+
+ FT_LOCAL( FT_Error )
+ tt_load_sbit_metrics( FT_Stream stream,
+ TT_SBit_Range range,
+ TT_SBit_Metrics metrics );
+
+ FT_LOCAL( FT_Error )
tt_face_load_sbit_image( TT_Face face,
FT_ULong strike_index,
FT_UInt glyph_index,