* include/freetype/freetype.h (FT_Open_Flags): Replaced with #defines for the constants. (FT_Open_Args): Change type of `flags' to FT_UInt. (FT_GlyphSlot): Move `flags' to FT_Slot_Internal. * include/freetype/ftimage.h (FT_Outline_Flags, FT_Raster_Flag): Replaced with #defines for the constants. * include/freetype/internal/ftobjs.h (FT_Slot_Internal): New field `flags' (from FT_GlyphSlot). Updated all affected source files. (FT_GLYPH_OWN_BITMAP): New macro (from ftgloadr.h). * include/freetype/internal/ftgloadr.h (FT_GLYPH_OWN_BITMAP): Moved to ftobjs.h. * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Use dummy FT_GlyphSlot_Internal object.
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 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499
diff --git a/ChangeLog b/ChangeLog
index 0da6e75..eb9ca94 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2003-06-16 Werner Lemberg <wl@gnu.org>
+
+ * include/freetype/freetype.h (FT_Open_Flags): Replaced with
+ #defines for the constants.
+ (FT_Open_Args): Change type of `flags' to FT_UInt.
+ (FT_GlyphSlot): Move `flags' to FT_Slot_Internal.
+
+ * include/freetype/ftimage.h (FT_Outline_Flags, FT_Raster_Flag):
+ Replaced with #defines for the constants.
+
+ * include/freetype/internal/ftobjs.h (FT_Slot_Internal): New
+ field `flags' (from FT_GlyphSlot).
+ Updated all affected source files.
+ (FT_GLYPH_OWN_BITMAP): New macro (from ftgloadr.h).
+
+ * include/freetype/internal/ftgloadr.h (FT_GLYPH_OWN_BITMAP): Moved
+ to ftobjs.h.
+
+ * src/base/ftglyph.c (FT_Glyph_To_Bitmap): Use dummy
+ FT_GlyphSlot_Internal object.
+
2003-06-15 Werner Lemberg <wl@gnu.org>
* builds/compiler/gcc.mk, builds/compiler/gcc-dev.mk (CFLAGS):
@@ -2339,7 +2360,7 @@
interface is hidden in an internal part of the face record, and all
the definitions are in ftincrem.h.
- * include/freetype/freeetype.h [FT_CONFIG_OPTION_INCREMENTAL]:
+ * include/freetype/freetype.h [FT_CONFIG_OPTION_INCREMENTAL]:
Removed.
* include/freetype/internal/ftobjs.h [FT_CONFIG_OPTION_INCREMENTAL]:
Include FT_INCREMENTAL_H.
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index b13adb7..52faf17 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -113,7 +113,6 @@ FT_BEGIN_HEADER
/* FT_New_Memory_Face */
/* FT_Open_Face */
/* FT_Open_Args */
- /* FT_Open_Flags */
/* FT_Parameter */
/* FT_Attach_File */
/* FT_Attach_Stream */
@@ -126,6 +125,12 @@ FT_BEGIN_HEADER
/* FT_Get_Name_Index */
/* FT_Load_Char */
/* */
+ /* FT_OPEN_MEMORY */
+ /* FT_OPEN_STREAM */
+ /* FT_OPEN_PATHNAME */
+ /* FT_OPEN_DRIVER */
+ /* FT_OPEN_PARAMS */
+ /* */
/* FT_LOAD_DEFAULT */
/* FT_LOAD_RENDER */
/* FT_LOAD_MONOCHROME */
@@ -1360,7 +1365,6 @@ FT_BEGIN_HEADER
FT_Library library;
FT_Face face;
FT_GlyphSlot next;
- FT_UInt flags;
FT_Generic generic;
FT_Glyph_Metrics metrics;
@@ -1475,13 +1479,13 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Enum> */
- /* FT_Open_Flags */
+ /* FT_OPEN_XXX */
/* */
/* <Description> */
- /* An enumeration used to list the bit flags used within the */
- /* `flags' field of the @FT_Open_Args structure. */
+ /* A list of bit-field constants used within the `flags' field of the */
+ /* @FT_Open_Args structure. */
/* */
- /* <Fields> */
+ /* <Values> */
/* FT_OPEN_MEMORY :: This is a memory-based stream. */
/* */
/* FT_OPEN_STREAM :: Copy the stream from the `stream' field. */
@@ -1507,15 +1511,11 @@ FT_BEGIN_HEADER
/* The `FT_OPEN_MEMORY', `FT_OPEN_STREAM', and `FT_OPEN_PATHNAME' */
/* flags are mutually exclusive. */
/* */
- typedef enum
- {
- FT_OPEN_MEMORY = 1,
- FT_OPEN_STREAM = 2,
- FT_OPEN_PATHNAME = 4,
- FT_OPEN_DRIVER = 8,
- FT_OPEN_PARAMS = 16
-
- } FT_Open_Flags;
+#define FT_OPEN_MEMORY 0x1
+#define FT_OPEN_STREAM 0x2
+#define FT_OPEN_PATHNAME 0x4
+#define FT_OPEN_DRIVER 0x8
+#define FT_OPEN_PARAMS 0x10
#define ft_open_memory FT_OPEN_MEMORY /* deprecated */
#define ft_open_stream FT_OPEN_STREAM /* deprecated */
@@ -1603,14 +1603,14 @@ FT_BEGIN_HEADER
/* */
typedef struct FT_Open_Args_
{
- FT_Open_Flags flags;
- const FT_Byte* memory_base;
- FT_Long memory_size;
- FT_String* pathname;
- FT_Stream stream;
- FT_Module driver;
- FT_Int num_params;
- FT_Parameter* params;
+ FT_UInt flags;
+ const FT_Byte* memory_base;
+ FT_Long memory_size;
+ FT_String* pathname;
+ FT_Stream stream;
+ FT_Module driver;
+ FT_Int num_params;
+ FT_Parameter* params;
} FT_Open_Args;
diff --git a/include/freetype/ftbdf.h b/include/freetype/ftbdf.h
index b3bfcb5..f16c075 100644
--- a/include/freetype/ftbdf.h
+++ b/include/freetype/ftbdf.h
@@ -64,7 +64,7 @@ FT_BEGIN_HEADER
* BDF_PROPERTY_TYPE_CARDINAL ::
* Property is a 32-bit unsigned integer.
*/
- typedef enum
+ typedef enum BDF_PropertyType_
{
BDF_PROPERTY_TYPE_NONE = 0,
BDF_PROPERTY_TYPE_ATOM = 1,
diff --git a/include/freetype/ftimage.h b/include/freetype/ftimage.h
index fe46bf5..7115a06 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 by */
+/* Copyright 1996-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -357,10 +357,10 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Enum> */
- /* FT_Outline_Flags */
+ /* FT_OUTLINE_XXX */
/* */
/* <Description> */
- /* A simple type used to enumerates the flags in an outline's */
+ /* A list of bit-field constants use for the flags in an outline's */
/* `outline_flags' field. */
/* */
/* <Values> */
@@ -414,17 +414,14 @@ FT_BEGIN_HEADER
/* completely ignored by a given */
/* scan-converter. */
/* */
- typedef enum FT_Outline_Flags_
- {
- FT_OUTLINE_NONE = 0,
- FT_OUTLINE_OWNER = 1,
- FT_OUTLINE_EVEN_ODD_FILL = 2,
- FT_OUTLINE_REVERSE_FILL = 4,
- FT_OUTLINE_IGNORE_DROPOUTS = 8,
- FT_OUTLINE_HIGH_PRECISION = 256,
- FT_OUTLINE_SINGLE_PASS = 512
+#define FT_OUTLINE_NONE 0x0
+#define FT_OUTLINE_OWNER 0x1
+#define FT_OUTLINE_EVEN_ODD_FILL 0x2
+#define FT_OUTLINE_REVERSE_FILL 0x4
+#define FT_OUTLINE_IGNORE_DROPOUTS 0x8
- } FT_Outline_Flags;
+#define FT_OUTLINE_HIGH_PRECISION 0x100
+#define FT_OUTLINE_SINGLE_PASS 0x200
/*************************************************************************
@@ -937,11 +934,11 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Enum> */
- /* FT_Raster_Flag */
+ /* FT_RASTER_FLAG_XXX */
/* */
/* <Description> */
- /* An enumeration to list the bit flags as used in the `flags' field */
- /* of a FT_Raster_Params structure. */
+ /* A list of bit flag constants as used in the `flags' field of a */
+ /* @FT_Raster_Params structure. */
/* */
/* <Values> */
/* FT_RASTER_FLAG_DEFAULT :: This value is 0. */
@@ -949,7 +946,7 @@ FT_BEGIN_HEADER
/* FT_RASTER_FLAG_AA :: This flag is set to indicate that an */
/* anti-aliased glyph image should be */
/* generated. Otherwise, it will be */
- /* monochrome (1-bit) */
+ /* monochrome (1-bit). */
/* */
/* FT_RASTER_FLAG_DIRECT :: This flag is set to indicate direct */
/* rendering. In this mode, client */
@@ -974,15 +971,12 @@ FT_BEGIN_HEADER
/* in direct rendering mode where all spans */
/* are generated if no clipping box is set. */
/* */
- typedef enum
- {
- FT_RASTER_FLAG_DEFAULT = 0,
- FT_RASTER_FLAG_AA = 1,
- FT_RASTER_FLAG_DIRECT = 2,
- FT_RASTER_FLAG_CLIP = 4
-
- } FT_Raster_Flag;
+#define FT_RASTER_FLAG_DEFAULT 0x0
+#define FT_RASTER_FLAG_AA 0x1
+#define FT_RASTER_FLAG_DIRECT 0x2
+#define FT_RASTER_FLAG_CLIP 0x4
+ /* deprecated */
#define ft_raster_flag_default FT_RASTER_FLAG_DEFAULT
#define ft_raster_flag_aa FT_RASTER_FLAG_AA
#define ft_raster_flag_direct FT_RASTER_FLAG_DIRECT
diff --git a/include/freetype/ftincrem.h b/include/freetype/ftincrem.h
index 5390987..782846a 100644
--- a/include/freetype/ftincrem.h
+++ b/include/freetype/ftincrem.h
@@ -246,8 +246,7 @@ FT_BEGIN_HEADER
* parameter.data = &inc_int;
*
* // set up FT_Open_Args structure
- * open_args.flags = (FT_Open_Flags)( FT_OPEN_PATHNAME |
- * FT_OPEN_PARAMS );
+ * open_args.flags = FT_OPEN_PATHNAME | FT_OPEN_PARAMS;
* open_args.pathname = my_font_pathname;
* open_args.num_params = 1;
* open_args.params = ¶meter; // we use one optional argument
diff --git a/include/freetype/internal/ftgloadr.h b/include/freetype/internal/ftgloadr.h
index d66d10b..284f4e3 100644
--- a/include/freetype/internal/ftgloadr.h
+++ b/include/freetype/internal/ftgloadr.h
@@ -4,7 +4,7 @@
/* */
/* The FreeType glyph loader (specification). */
/* */
-/* Copyright 2002 by */
+/* Copyright 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -52,12 +52,6 @@ FT_BEGIN_HEADER
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
- enum
- {
- FT_GLYPH_OWN_BITMAP = 1
- };
-
-
typedef struct FT_SubGlyphRec_
{
FT_Int index;
diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h
index 3a22ac3..ac3edfa 100644
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -338,6 +338,11 @@ FT_BEGIN_HEADER
/* loader :: The glyph loader object used to load outlines */
/* into the glyph slot. */
/* */
+ /* flags :: Possible values are zero or */
+ /* FT_GLYPH_OWN_BITMAP. The latter indicates */
+ /* that the FT_GlyphSlot structure owns the */
+ /* bitmap buffer. */
+ /* */
/* glyph_transformed :: Boolean. Set to TRUE when the loaded glyph */
/* must be transformed through a specific */
/* font transformation. This is _not_ the same */
@@ -352,9 +357,13 @@ FT_BEGIN_HEADER
/* */
/* glyph_hints :: Format-specific glyph hints management. */
/* */
+
+#define FT_GLYPH_OWN_BITMAP 0x1
+
typedef struct FT_Slot_InternalRec_
{
FT_GlyphLoader loader;
+ FT_UInt flags;
FT_Bool glyph_transformed;
FT_Matrix glyph_matrix;
FT_Vector glyph_delta;
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index 8d7e831..fad5a62 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -158,8 +158,8 @@
glyph->left = slot->bitmap_left;
glyph->top = slot->bitmap_top;
- if ( slot->flags & FT_GLYPH_OWN_BITMAP )
- slot->flags &= ~FT_GLYPH_OWN_BITMAP;
+ if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
+ slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
else
{
/* copy the bitmap into a new buffer */
@@ -573,12 +573,13 @@
FT_Vector* origin,
FT_Bool destroy )
{
- FT_GlyphSlotRec dummy;
- FT_Error error = FT_Err_Ok;
- FT_Glyph glyph;
- FT_BitmapGlyph bitmap = NULL;
+ FT_GlyphSlotRec dummy;
+ FT_GlyphSlot_InternalRec dummy_internal;
+ FT_Error error = FT_Err_Ok;
+ FT_Glyph glyph;
+ FT_BitmapGlyph bitmap = NULL;
- const FT_Glyph_Class* clazz;
+ const FT_Glyph_Class* clazz;
/* check argument */
@@ -602,8 +603,10 @@
goto Bad;
FT_MEM_ZERO( &dummy, sizeof ( dummy ) );
- dummy.library = glyph->library;
- dummy.format = clazz->glyph_format;
+ FT_MEM_ZERO( &dummy_internal, sizeof ( dummy_internal ) );
+ dummy.internal = &dummy_internal;
+ dummy.library = glyph->library;
+ dummy.format = clazz->glyph_format;
/* create result bitmap glyph */
error = ft_new_glyph( glyph->library, &ft_bitmap_glyph_class,
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index fe07883..feac5ee 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -202,13 +202,13 @@
FT_BASE_DEF( void )
ft_glyphslot_free_bitmap( FT_GlyphSlot slot )
{
- if ( slot->flags & FT_GLYPH_OWN_BITMAP )
+ if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
{
FT_Memory memory = FT_FACE_MEMORY( slot->face );
FT_FREE( slot->bitmap.buffer );
- slot->flags &= ~FT_GLYPH_OWN_BITMAP;
+ slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
else
{
@@ -227,7 +227,7 @@
slot->bitmap.buffer = buffer;
- FT_ASSERT( (slot->flags & FT_GLYPH_OWN_BITMAP) == 0 );
+ FT_ASSERT( (slot->internal->flags & FT_GLYPH_OWN_BITMAP) == 0 );
}
@@ -238,10 +238,10 @@
FT_Memory memory = FT_FACE_MEMORY( slot->face );
- if ( slot->flags & FT_GLYPH_OWN_BITMAP )
+ if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
FT_FREE( slot->bitmap.buffer );
else
- slot->flags |= FT_GLYPH_OWN_BITMAP;
+ slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
return FT_MEM_ALLOC( slot->bitmap.buffer, size );
}
@@ -1074,7 +1074,7 @@
args.stream = stream;
if ( driver_name )
{
- args.flags = (FT_Open_Flags)( args.flags | FT_OPEN_DRIVER );
+ args.flags = args.flags | FT_OPEN_DRIVER;
args.driver = FT_Get_Module( library, driver_name );
}
diff --git a/src/cache/ftcsbits.c b/src/cache/ftcsbits.c
index 594c92a..5e37f2c 100644
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -192,10 +192,10 @@
#if 0 /* this doesn't work well with embedded bitmaps */
/* grab the bitmap when possible - this is a hack! */
- if ( slot->flags & FT_GLYPH_OWN_BITMAP )
+ if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
{
- slot->flags &= ~FT_GLYPH_OWN_BITMAP;
- sbit->buffer = bitmap->buffer;
+ slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
+ sbit->buffer = bitmap->buffer;
}
else
#endif
diff --git a/src/raster/ftrend1.c b/src/raster/ftrend1.c
index bfb274b..b6c0f02 100644
--- a/src/raster/ftrend1.c
+++ b/src/raster/ftrend1.c
@@ -151,10 +151,10 @@
memory = render->root.memory;
/* release old bitmap buffer */
- if ( slot->flags & FT_GLYPH_OWN_BITMAP )
+ if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
{
FT_FREE( bitmap->buffer );
- slot->flags &= ~FT_GLYPH_OWN_BITMAP;
+ slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
/* allocate new one, depends on pixel format */
@@ -178,7 +178,7 @@
if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) )
goto Exit;
- slot->flags |= FT_GLYPH_OWN_BITMAP;
+ slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
/* translate outline to render it into the bitmap */
FT_Outline_Translate( outline, -cbox.xMin, -cbox.yMin );
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
index c06a4e6..cc84acd 100644
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -143,10 +143,10 @@
memory = render->root.memory;
/* release old bitmap buffer */
- if ( slot->flags & FT_GLYPH_OWN_BITMAP )
+ if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP )
{
FT_FREE( bitmap->buffer );
- slot->flags &= ~FT_GLYPH_OWN_BITMAP;
+ slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
}
/* allocate new one, depends on pixel format */
@@ -169,7 +169,7 @@
if ( FT_ALLOC( bitmap->buffer, (FT_ULong)pitch * height ) )
goto Exit;
- slot->flags |= FT_GLYPH_OWN_BITMAP;
+ slot->internal->flags |= FT_GLYPH_OWN_BITMAP;
/* translate outline to render it into the bitmap */
FT_Outline_Translate( outline, -cbox.xMin, -cbox.yMin );
diff --git a/src/winfonts/winfnt.c b/src/winfonts/winfnt.c
index 4bf5619..320d5c2 100644
--- a/src/winfonts/winfnt.c
+++ b/src/winfonts/winfnt.c
@@ -645,10 +645,10 @@
}
}
- slot->flags = FT_GLYPH_OWN_BITMAP;
- slot->bitmap_left = 0;
- slot->bitmap_top = font->header.ascent;
- slot->format = FT_GLYPH_FORMAT_BITMAP;
+ slot->internal->flags = FT_GLYPH_OWN_BITMAP;
+ slot->bitmap_left = 0;
+ slot->bitmap_top = font->header.ascent;
+ slot->format = FT_GLYPH_FORMAT_BITMAP;
/* now set up metrics */
slot->metrics.horiAdvance = bitmap->width << 6;