latest clean-ups.. The code compiles with NO WARNINGS with GCC and Visual C++ (also with LCC minus debugging options)
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
diff --git a/BUILD b/BUILD
index 9a03572..6cfd39c 100644
--- a/BUILD
+++ b/BUILD
@@ -222,9 +222,9 @@ II. DETAILED COMPILATION PROCEDURE:
src/base/ftinit.c - initialisation layer
src/base/ftdebug.c - debugging component (empty in release build)
src/base/ftbase.c - the "base layer" component
- src/base/ftraster.c - the standard raster (scan-converter)
- src/base/ftgrays.c - the smooth raster (anti-aliased only)
src/base/ftglyph.c - optional convenience functions
+ src/raster1/raster1.c - the monochrome bitmap renderer
+ src/smooth/smooth.c - the anti-aliased bitmap renderer
src/sfnt/sfnt.c - the "sfnt" module
src/psnames/psnames.c - the "psnames" module
src/truetype/truetype.c - the TrueType font driver
diff --git a/CHANGES b/CHANGES
index 659f0b4..42e3a0a 100644
--- a/CHANGES
+++ b/CHANGES
@@ -10,6 +10,9 @@ LATEST CHANGES
"make multi" now works well :-)
+ Also removed the use of "cidafm" for now, even if the source files
+ are still there. This functionality will certainly go into a specific
+ module..
- CHANGES TO THE RENDERER MODULES
diff --git a/config/win32/w32-lcc.mk b/config/win32/w32-lcc.mk
index 1ac7b82..172ead1 100644
--- a/config/win32/w32-lcc.mk
+++ b/config/win32/w32-lcc.mk
@@ -119,8 +119,8 @@ ifdef BUILD_FREETYPE
# librarian library_file {list of object files}
#
$(FT_LIBRARY): $(OBJECTS_LIST)
- lcclib /out:$(subst $(SEP),$(HOSTSEP),$@) \
- $(subst $(SEP),$(HOSTSEP),$(OBJECTS_LIST))
+ lcclib /out:$(subst $(SEP),\\,$@) \
+ $(subst $(SEP),\\,$(OBJECTS_LIST))
endif
diff --git a/demos/src/ftmulti.c b/demos/src/ftmulti.c
index 34fce60..ebc19dc 100644
--- a/demos/src/ftmulti.c
+++ b/demos/src/ftmulti.c
@@ -343,6 +343,8 @@
const unsigned char* p;
+ ptsize=ptsize;
+
start_x = 4;
start_y = 32 + size->metrics.y_ppem;
@@ -586,7 +588,7 @@
return 1;
Do_Axis:
- if ( axis < multimaster.num_axis )
+ if ( axis < (int)multimaster.num_axis )
{
FT_MM_Axis* a = multimaster.axis + axis;
FT_Long pos = design_pos[axis];
@@ -711,7 +713,7 @@
int n;
- for ( n = 0; n < multimaster.num_axis; n++ )
+ for ( n = 0; n < (int)multimaster.num_axis; n++ )
design_pos[n] =
( multimaster.axis[n].minimum + multimaster.axis[n].maximum ) / 2;
}
@@ -790,7 +792,7 @@
int n;
- for ( n = 0; n < multimaster.num_axis; n++ )
+ for ( n = 0; n < (int)multimaster.num_axis; n++ )
{
char temp[32];
diff --git a/demos/src/ftview.c b/demos/src/ftview.c
index 8b1e8bf..e1e2690 100644
--- a/demos/src/ftview.c
+++ b/demos/src/ftview.c
@@ -601,7 +601,7 @@
if ( debug )
{
#ifdef FT_DEBUG_LEVEL_TRACE
- FT_SetTraceLevel( trace_any, trace_level );
+ FT_SetTraceLevel( trace_any, (FT_Byte)trace_level );
#else
trace_level = 0;
#endif
diff --git a/demos/src/memtest.c b/demos/src/memtest.c
index 3717b9d..b780101 100644
--- a/demos/src/memtest.c
+++ b/demos/src/memtest.c
@@ -18,6 +18,7 @@
int Fail;
int Num;
+ extern void FT_Add_Default_Modules( FT_Library library );
@@ -42,11 +43,6 @@ typedef struct MyBlock
static MyBlock my_blocks[ MAX_RECORDED_BLOCKS ];
static int num_my_blocks = 0;
-static
-void rewind_memory( void )
-{
- num_my_blocks = 0;
-}
/* record a new block in the table, check for duplicates too */
static
@@ -125,12 +121,14 @@ void* my_alloc( FT_Memory memory,
if (p)
record_my_block(p,size);
+ memory=memory;
return p;
}
static
void my_free( FT_Memory memory, void* block )
{
+ memory=memory;
forget_my_block(block);
/* free(block); WE DO NOT REALLY FREE THE BLOCK */
}
diff --git a/include/freetype/internal/t1types.h b/include/freetype/internal/t1types.h
index 067e2da..974d976 100644
--- a/include/freetype/internal/t1types.h
+++ b/include/freetype/internal/t1types.h
@@ -184,6 +184,7 @@
FT_FaceRec root;
void* psnames;
CID_Info cid;
+ void* afm_data;
CID_Subrs* subrs;
} CID_FaceRec;
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 7a56507..aa12993 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -2257,7 +2257,7 @@
if ( !result || result->glyph_format != slot->format )
- result = ft_lookup_renderer( library, slot->format, 0 );
+ result = FT_Lookup_Renderer( library, slot->format, 0 );
return result;
}
@@ -2439,7 +2439,6 @@
}
-<<<<<<< ftobjs.c
/*************************************************************************
*
* <Function>
diff --git a/src/base/ftstream.c b/src/base/ftstream.c
index 7395367..f2fc2ee 100644
--- a/src/base/ftstream.c
+++ b/src/base/ftstream.c
@@ -645,12 +645,27 @@
*(FT_UShort*)p = (FT_UShort)value;
break;
+ /* A slight note regarding the following: */
+ /* */
+ /* SIZEOF_INT is defined in <freetype/config/ftconfig.h> */
+ /* and gives the size in bytes of the "int" type on the */
+ /* current platform.. */
+ /* */
+ /* Only on 16-bit systems can the value of SIZEOF_INT be */
+ /* less than 4. In this case SIZEOF_LONG is always 4 */
+ /* */
+ /* On a 64-bit system, SIZEOF_LONG can be 8, which is */
+ /* handled by the default case.. */
+ /* */
+
+#if SIZEOF_INT == 4
case 4:
- *(FT_ULong*)p = (FT_ULong)value;
+ *(FT_UInt*)p = (FT_UInt)value;
break;
+#endif
default:
- ; /* ignore! */
+ *(FT_ULong*)p = (FT_ULong)value;
}
/* go to next field */
diff --git a/src/cff/t2gload.c b/src/cff/t2gload.c
index 8a71951..6eeec2d 100644
--- a/src/cff/t2gload.c
+++ b/src/cff/t2gload.c
@@ -363,6 +363,10 @@
if (cff->num_subfonts >= 1)
{
FT_Byte fd_index = CFF_Get_FD( &cff->fd_select, glyph_index );
+ if (fd_index >= cff->num_subfonts)
+ {
+ FT_ERROR(( "INVALID FD INDEX = %d >= %d\n", fd_index, cff->num_subfonts ));
+ }
sub = cff->subfonts[fd_index];
}
diff --git a/src/cff/t2parse.c b/src/cff/t2parse.c
index 1b9207f..7692e11 100644
--- a/src/cff/t2parse.c
+++ b/src/cff/t2parse.c
@@ -516,17 +516,28 @@
case t2_kind_fixed:
val = t2_parse_fixed( parser->stack );
+ /* A slight note regarding the following: */
+ /* */
+ /* SIZEOF_INT is defined in <freetype/config/ftconfig.h> */
+ /* and gives the size in bytes of the "int" type on the */
+ /* current platform.. */
+ /* */
+ /* Only on 16-bit systems can the value of SIZEOF_INT be */
+ /* less than 4. In this case SIZEOF_LONG is always 4 */
+ /* */
+ /* On a 64-bit system, SIZEOF_LONG can be 8, which is */
+ /* handled by the default case.. */
+ /* */
+
Store_Number:
switch ( field->size )
{
- case 1:
- *(FT_Byte*)q = (FT_Byte)val;
- break;
- case 2:
- *(FT_Short*)q = (FT_Short)val;
- break;
- default:
- *(FT_Long*)q = val;
+ case 1: *(FT_Byte*)q = (FT_Byte)val; break;
+ case 2: *(FT_Short*)q = (FT_Short)val; break;
+#if SIZEOF_INT == 4
+ case 4: *(FT_Int*)q = (FT_Int)val; break;
+#endif
+ default: *(FT_Long*)q = val;
}
break;
diff --git a/src/cid/cidafm.c b/src/cid/cidafm.c
index a98c3fc..86b2bce 100644
--- a/src/cid/cidafm.c
+++ b/src/cid/cidafm.c
@@ -159,7 +159,7 @@
/* parse an AFM file - for now, only read the kerning pairs */
LOCAL_FUNC
- FT_Error CID_Read_AFM( FT_Face t1_face,
+ FT_Error CID_Read_AFM( FT_Face cid_face,
FT_Stream stream )
{
FT_Error error;
@@ -168,9 +168,9 @@
FT_Byte* limit;
FT_Byte* p;
FT_Int count = 0;
- CID_Kern_Pair* pair;
+ CID_Kern_Pair* pair;
T1_Font* type1 = &((T1_Face)t1_face)->type1;
- CID_AFM* afm = 0;
+ CID_AFM* afm = 0;
if ( ACCESS_Frame( stream->size ) )
diff --git a/src/cid/cidafm.h b/src/cid/cidafm.h
index bb1741a..61c5ad7 100644
--- a/src/cid/cidafm.h
+++ b/src/cid/cidafm.h
@@ -32,7 +32,7 @@
typedef struct CID_AFM_
{
- FT_Int num_pairs;
+ FT_UInt num_pairs;
CID_Kern_Pair* kern_pairs;
} CID_AFM;
@@ -41,15 +41,15 @@
#if 1
LOCAL_DEF
- FT_Error CID_Read_AFM( FT_Face t1_face,
+ FT_Error CID_Read_AFM( FT_Face cid_face,
FT_Stream stream );
LOCAL_DEF
void CID_Done_AFM( FT_Memory memory,
- CID_AFM* afm );
+ CID_AFM* afm );
LOCAL_DEF
- void CID_Get_Kerning( CID_AFM* afm,
+ void CID_Get_Kerning( CID_AFM* afm,
FT_UInt glyph1,
FT_UInt glyph2,
FT_Vector* kerning );
diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c
index 96d0b53..9651930 100644
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -1324,10 +1324,10 @@
goto Exit;
p = (FT_Byte*)stream->cursor;
- fd_select = (FT_UInt) cid_get_offset( &p, cid->fd_bytes );
- off1 = (FT_ULong)cid_get_offset( &p, cid->gd_bytes );
+ fd_select = (FT_UInt) cid_get_offset( &p, (FT_Byte)cid->fd_bytes );
+ off1 = (FT_ULong)cid_get_offset( &p, (FT_Byte)cid->gd_bytes );
p += cid->fd_bytes;
- glyph_len = cid_get_offset( &p, cid->gd_bytes ) - off1;
+ glyph_len = cid_get_offset( &p, (FT_Byte)cid->gd_bytes ) - off1;
FORGET_Frame();
diff --git a/src/cid/cidload.c b/src/cid/cidload.c
index 61c5525..41b823d 100644
--- a/src/cid/cidload.c
+++ b/src/cid/cidload.c
@@ -400,7 +400,7 @@
p = (FT_Byte*)stream->cursor;
for ( count = 0; count <= num_subrs; count++ )
- offsets[count] = cid_get_offset( &p, dict->sd_bytes );
+ offsets[count] = cid_get_offset( &p, (FT_Byte)dict->sd_bytes );
FORGET_Frame();
diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c
index ffa9172..21490b4 100644
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -22,7 +22,6 @@
#include <cidgload.h>
#include <cidload.h>
#include <freetype/internal/psnames.h>
-#include <cidafm.h>
/*************************************************************************/
diff --git a/src/cid/cidriver.c b/src/cid/cidriver.c
index 8e3a759..11be5c7 100644
--- a/src/cid/cidriver.c
+++ b/src/cid/cidriver.c
@@ -18,7 +18,6 @@
#include <cidriver.h>
#include <cidgload.h>
-#include <cidafm.h>
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftstream.h>
@@ -48,7 +47,7 @@
}
-#ifndef T1_CONFIG_OPTION_NO_AFM
+#if 0 /* unimplemented for now.. */
static
FT_Error cid_Get_Kerning( T1_Face face,
@@ -70,7 +69,7 @@
}
-#endif /* !T1_CONFIG_OPTION_NO_AFM */
+#endif /* 0 */
/*************************************************************************/
@@ -209,13 +208,8 @@
(FTDriver_loadGlyph) CID_Load_Glyph,
(FTDriver_getCharIndex) CID_Get_Char_Index,
-#ifdef T1_CONFIG_OPTION_NO_AFM
(FTDriver_getKerning) 0,
(FTDriver_attachFile) 0,
-#else
- (FTDriver_getKerning) cid_Get_Kerning,
- (FTDriver_attachFile) CID_Read_AFM,
-#endif
(FTDriver_getAdvances) 0
};
diff --git a/src/cid/rules.mk b/src/cid/rules.mk
index 5999a73..8e97586 100644
--- a/src/cid/rules.mk
+++ b/src/cid/rules.mk
@@ -35,7 +35,6 @@ CID_DRV_SRC := $(CID_DIR_)cidparse.c \
$(CID_DIR_)cidload.c \
$(CID_DIR_)cidriver.c \
$(CID_DIR_)cidgload.c \
- $(CID_DIR_)cidafm.c \
$(CID_DIR_)cidobjs.c
# CID driver headers
diff --git a/src/cid/type1cid.c b/src/cid/type1cid.c
index dca723c..855f564 100644
--- a/src/cid/type1cid.c
+++ b/src/cid/type1cid.c
@@ -24,7 +24,7 @@
#include <cidriver.c>
#include <cidgload.c>
-#if 1
+#if 0
#include <cidafm.c>
#endif
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index 01686b4..e2cbbad 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -1417,7 +1417,7 @@
#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
/* clear all outline flags, except the `owner' one */
- glyph->outline.flags &= ft_outline_owner;
+ glyph->outline.flags = 0;
if ( size && size->root.metrics.y_ppem < 24 )
glyph->outline.flags |= ft_outline_high_precision;
diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c
index d5da36a..64b606d 100644
--- a/src/type1/t1driver.c
+++ b/src/type1/t1driver.c
@@ -308,12 +308,12 @@
#ifdef T1_CONFIG_OPTION_NO_AFM
(FTDriver_getKerning) 0,
- (FTDriver_getAdvances) 0
+ (FTDriver_getAdvances) 0,
#else
(FTDriver_getKerning) Get_Kerning,
- (FTDriver_attachFile) T1_Read_AFM
+ (FTDriver_attachFile) T1_Read_AFM,
#endif
- (FTDriver_getAdvances) 0
+ (FTDriver_getAdvances) 0
};