latest clean-ups..
The code compiles with NO WARNINGS with GCC and Visual C++ (also with LCC minus debugging options)
This commit is contained in:
parent
9d636b6d14
commit
81bb4ad937
4
BUILD
4
BUILD
|
@ -222,9 +222,9 @@ II. DETAILED COMPILATION PROCEDURE:
|
||||||
src/base/ftinit.c - initialisation layer
|
src/base/ftinit.c - initialisation layer
|
||||||
src/base/ftdebug.c - debugging component (empty in release build)
|
src/base/ftdebug.c - debugging component (empty in release build)
|
||||||
src/base/ftbase.c - the "base layer" component
|
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/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/sfnt/sfnt.c - the "sfnt" module
|
||||||
src/psnames/psnames.c - the "psnames" module
|
src/psnames/psnames.c - the "psnames" module
|
||||||
src/truetype/truetype.c - the TrueType font driver
|
src/truetype/truetype.c - the TrueType font driver
|
||||||
|
|
3
CHANGES
3
CHANGES
|
@ -10,6 +10,9 @@ LATEST CHANGES
|
||||||
|
|
||||||
"make multi" now works well :-)
|
"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
|
- CHANGES TO THE RENDERER MODULES
|
||||||
|
|
|
@ -119,8 +119,8 @@ ifdef BUILD_FREETYPE
|
||||||
# librarian library_file {list of object files}
|
# librarian library_file {list of object files}
|
||||||
#
|
#
|
||||||
$(FT_LIBRARY): $(OBJECTS_LIST)
|
$(FT_LIBRARY): $(OBJECTS_LIST)
|
||||||
lcclib /out:$(subst $(SEP),$(HOSTSEP),$@) \
|
lcclib /out:$(subst $(SEP),\\,$@) \
|
||||||
$(subst $(SEP),$(HOSTSEP),$(OBJECTS_LIST))
|
$(subst $(SEP),\\,$(OBJECTS_LIST))
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
@ -343,6 +343,8 @@
|
||||||
const unsigned char* p;
|
const unsigned char* p;
|
||||||
|
|
||||||
|
|
||||||
|
ptsize=ptsize;
|
||||||
|
|
||||||
start_x = 4;
|
start_x = 4;
|
||||||
start_y = 32 + size->metrics.y_ppem;
|
start_y = 32 + size->metrics.y_ppem;
|
||||||
|
|
||||||
|
@ -586,7 +588,7 @@
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
Do_Axis:
|
Do_Axis:
|
||||||
if ( axis < multimaster.num_axis )
|
if ( axis < (int)multimaster.num_axis )
|
||||||
{
|
{
|
||||||
FT_MM_Axis* a = multimaster.axis + axis;
|
FT_MM_Axis* a = multimaster.axis + axis;
|
||||||
FT_Long pos = design_pos[axis];
|
FT_Long pos = design_pos[axis];
|
||||||
|
@ -711,7 +713,7 @@
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
|
||||||
for ( n = 0; n < multimaster.num_axis; n++ )
|
for ( n = 0; n < (int)multimaster.num_axis; n++ )
|
||||||
design_pos[n] =
|
design_pos[n] =
|
||||||
( multimaster.axis[n].minimum + multimaster.axis[n].maximum ) / 2;
|
( multimaster.axis[n].minimum + multimaster.axis[n].maximum ) / 2;
|
||||||
}
|
}
|
||||||
|
@ -790,7 +792,7 @@
|
||||||
int n;
|
int n;
|
||||||
|
|
||||||
|
|
||||||
for ( n = 0; n < multimaster.num_axis; n++ )
|
for ( n = 0; n < (int)multimaster.num_axis; n++ )
|
||||||
{
|
{
|
||||||
char temp[32];
|
char temp[32];
|
||||||
|
|
||||||
|
|
|
@ -601,7 +601,7 @@
|
||||||
if ( debug )
|
if ( debug )
|
||||||
{
|
{
|
||||||
#ifdef FT_DEBUG_LEVEL_TRACE
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||||
FT_SetTraceLevel( trace_any, trace_level );
|
FT_SetTraceLevel( trace_any, (FT_Byte)trace_level );
|
||||||
#else
|
#else
|
||||||
trace_level = 0;
|
trace_level = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
int Fail;
|
int Fail;
|
||||||
int Num;
|
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 MyBlock my_blocks[ MAX_RECORDED_BLOCKS ];
|
||||||
static int num_my_blocks = 0;
|
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 */
|
/* record a new block in the table, check for duplicates too */
|
||||||
static
|
static
|
||||||
|
@ -125,12 +121,14 @@ void* my_alloc( FT_Memory memory,
|
||||||
if (p)
|
if (p)
|
||||||
record_my_block(p,size);
|
record_my_block(p,size);
|
||||||
|
|
||||||
|
memory=memory;
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
void my_free( FT_Memory memory, void* block )
|
void my_free( FT_Memory memory, void* block )
|
||||||
{
|
{
|
||||||
|
memory=memory;
|
||||||
forget_my_block(block);
|
forget_my_block(block);
|
||||||
/* free(block); WE DO NOT REALLY FREE THE BLOCK */
|
/* free(block); WE DO NOT REALLY FREE THE BLOCK */
|
||||||
}
|
}
|
||||||
|
|
|
@ -184,6 +184,7 @@
|
||||||
FT_FaceRec root;
|
FT_FaceRec root;
|
||||||
void* psnames;
|
void* psnames;
|
||||||
CID_Info cid;
|
CID_Info cid;
|
||||||
|
void* afm_data;
|
||||||
CID_Subrs* subrs;
|
CID_Subrs* subrs;
|
||||||
|
|
||||||
} CID_FaceRec;
|
} CID_FaceRec;
|
||||||
|
|
|
@ -2257,7 +2257,7 @@
|
||||||
|
|
||||||
|
|
||||||
if ( !result || result->glyph_format != slot->format )
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -2439,7 +2439,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
<<<<<<< ftobjs.c
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
*
|
*
|
||||||
* <Function>
|
* <Function>
|
||||||
|
|
|
@ -645,12 +645,27 @@
|
||||||
*(FT_UShort*)p = (FT_UShort)value;
|
*(FT_UShort*)p = (FT_UShort)value;
|
||||||
break;
|
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:
|
case 4:
|
||||||
*(FT_ULong*)p = (FT_ULong)value;
|
*(FT_UInt*)p = (FT_UInt)value;
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
default:
|
default:
|
||||||
; /* ignore! */
|
*(FT_ULong*)p = (FT_ULong)value;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* go to next field */
|
/* go to next field */
|
||||||
|
|
|
@ -363,6 +363,10 @@
|
||||||
if (cff->num_subfonts >= 1)
|
if (cff->num_subfonts >= 1)
|
||||||
{
|
{
|
||||||
FT_Byte fd_index = CFF_Get_FD( &cff->fd_select, glyph_index );
|
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];
|
sub = cff->subfonts[fd_index];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -516,17 +516,28 @@
|
||||||
case t2_kind_fixed:
|
case t2_kind_fixed:
|
||||||
val = t2_parse_fixed( parser->stack );
|
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:
|
Store_Number:
|
||||||
switch ( field->size )
|
switch ( field->size )
|
||||||
{
|
{
|
||||||
case 1:
|
case 1: *(FT_Byte*)q = (FT_Byte)val; break;
|
||||||
*(FT_Byte*)q = (FT_Byte)val;
|
case 2: *(FT_Short*)q = (FT_Short)val; break;
|
||||||
break;
|
#if SIZEOF_INT == 4
|
||||||
case 2:
|
case 4: *(FT_Int*)q = (FT_Int)val; break;
|
||||||
*(FT_Short*)q = (FT_Short)val;
|
#endif
|
||||||
break;
|
default: *(FT_Long*)q = val;
|
||||||
default:
|
|
||||||
*(FT_Long*)q = val;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -159,7 +159,7 @@
|
||||||
|
|
||||||
/* parse an AFM file - for now, only read the kerning pairs */
|
/* parse an AFM file - for now, only read the kerning pairs */
|
||||||
LOCAL_FUNC
|
LOCAL_FUNC
|
||||||
FT_Error CID_Read_AFM( FT_Face t1_face,
|
FT_Error CID_Read_AFM( FT_Face cid_face,
|
||||||
FT_Stream stream )
|
FT_Stream stream )
|
||||||
{
|
{
|
||||||
FT_Error error;
|
FT_Error error;
|
||||||
|
@ -168,9 +168,9 @@
|
||||||
FT_Byte* limit;
|
FT_Byte* limit;
|
||||||
FT_Byte* p;
|
FT_Byte* p;
|
||||||
FT_Int count = 0;
|
FT_Int count = 0;
|
||||||
CID_Kern_Pair* pair;
|
CID_Kern_Pair* pair;
|
||||||
T1_Font* type1 = &((T1_Face)t1_face)->type1;
|
T1_Font* type1 = &((T1_Face)t1_face)->type1;
|
||||||
CID_AFM* afm = 0;
|
CID_AFM* afm = 0;
|
||||||
|
|
||||||
|
|
||||||
if ( ACCESS_Frame( stream->size ) )
|
if ( ACCESS_Frame( stream->size ) )
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
typedef struct CID_AFM_
|
typedef struct CID_AFM_
|
||||||
{
|
{
|
||||||
FT_Int num_pairs;
|
FT_UInt num_pairs;
|
||||||
CID_Kern_Pair* kern_pairs;
|
CID_Kern_Pair* kern_pairs;
|
||||||
|
|
||||||
} CID_AFM;
|
} CID_AFM;
|
||||||
|
@ -41,15 +41,15 @@
|
||||||
#if 1
|
#if 1
|
||||||
|
|
||||||
LOCAL_DEF
|
LOCAL_DEF
|
||||||
FT_Error CID_Read_AFM( FT_Face t1_face,
|
FT_Error CID_Read_AFM( FT_Face cid_face,
|
||||||
FT_Stream stream );
|
FT_Stream stream );
|
||||||
|
|
||||||
LOCAL_DEF
|
LOCAL_DEF
|
||||||
void CID_Done_AFM( FT_Memory memory,
|
void CID_Done_AFM( FT_Memory memory,
|
||||||
CID_AFM* afm );
|
CID_AFM* afm );
|
||||||
|
|
||||||
LOCAL_DEF
|
LOCAL_DEF
|
||||||
void CID_Get_Kerning( CID_AFM* afm,
|
void CID_Get_Kerning( CID_AFM* afm,
|
||||||
FT_UInt glyph1,
|
FT_UInt glyph1,
|
||||||
FT_UInt glyph2,
|
FT_UInt glyph2,
|
||||||
FT_Vector* kerning );
|
FT_Vector* kerning );
|
||||||
|
|
|
@ -1324,10 +1324,10 @@
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
p = (FT_Byte*)stream->cursor;
|
p = (FT_Byte*)stream->cursor;
|
||||||
fd_select = (FT_UInt) cid_get_offset( &p, cid->fd_bytes );
|
fd_select = (FT_UInt) cid_get_offset( &p, (FT_Byte)cid->fd_bytes );
|
||||||
off1 = (FT_ULong)cid_get_offset( &p, cid->gd_bytes );
|
off1 = (FT_ULong)cid_get_offset( &p, (FT_Byte)cid->gd_bytes );
|
||||||
p += cid->fd_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();
|
FORGET_Frame();
|
||||||
|
|
||||||
|
|
|
@ -400,7 +400,7 @@
|
||||||
|
|
||||||
p = (FT_Byte*)stream->cursor;
|
p = (FT_Byte*)stream->cursor;
|
||||||
for ( count = 0; count <= num_subrs; count++ )
|
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();
|
FORGET_Frame();
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
#include <cidgload.h>
|
#include <cidgload.h>
|
||||||
#include <cidload.h>
|
#include <cidload.h>
|
||||||
#include <freetype/internal/psnames.h>
|
#include <freetype/internal/psnames.h>
|
||||||
#include <cidafm.h>
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
|
|
||||||
#include <cidriver.h>
|
#include <cidriver.h>
|
||||||
#include <cidgload.h>
|
#include <cidgload.h>
|
||||||
#include <cidafm.h>
|
|
||||||
|
|
||||||
#include <freetype/internal/ftdebug.h>
|
#include <freetype/internal/ftdebug.h>
|
||||||
#include <freetype/internal/ftstream.h>
|
#include <freetype/internal/ftstream.h>
|
||||||
|
@ -48,7 +47,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef T1_CONFIG_OPTION_NO_AFM
|
#if 0 /* unimplemented for now.. */
|
||||||
|
|
||||||
static
|
static
|
||||||
FT_Error cid_Get_Kerning( T1_Face face,
|
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_loadGlyph) CID_Load_Glyph,
|
||||||
(FTDriver_getCharIndex) CID_Get_Char_Index,
|
(FTDriver_getCharIndex) CID_Get_Char_Index,
|
||||||
|
|
||||||
#ifdef T1_CONFIG_OPTION_NO_AFM
|
|
||||||
(FTDriver_getKerning) 0,
|
(FTDriver_getKerning) 0,
|
||||||
(FTDriver_attachFile) 0,
|
(FTDriver_attachFile) 0,
|
||||||
#else
|
|
||||||
(FTDriver_getKerning) cid_Get_Kerning,
|
|
||||||
(FTDriver_attachFile) CID_Read_AFM,
|
|
||||||
#endif
|
|
||||||
|
|
||||||
(FTDriver_getAdvances) 0
|
(FTDriver_getAdvances) 0
|
||||||
};
|
};
|
||||||
|
|
|
@ -35,7 +35,6 @@ CID_DRV_SRC := $(CID_DIR_)cidparse.c \
|
||||||
$(CID_DIR_)cidload.c \
|
$(CID_DIR_)cidload.c \
|
||||||
$(CID_DIR_)cidriver.c \
|
$(CID_DIR_)cidriver.c \
|
||||||
$(CID_DIR_)cidgload.c \
|
$(CID_DIR_)cidgload.c \
|
||||||
$(CID_DIR_)cidafm.c \
|
|
||||||
$(CID_DIR_)cidobjs.c
|
$(CID_DIR_)cidobjs.c
|
||||||
|
|
||||||
# CID driver headers
|
# CID driver headers
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <cidriver.c>
|
#include <cidriver.c>
|
||||||
#include <cidgload.c>
|
#include <cidgload.c>
|
||||||
|
|
||||||
#if 1
|
#if 0
|
||||||
#include <cidafm.c>
|
#include <cidafm.c>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1417,7 +1417,7 @@
|
||||||
#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
|
#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
|
||||||
|
|
||||||
/* clear all outline flags, except the `owner' one */
|
/* 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 )
|
if ( size && size->root.metrics.y_ppem < 24 )
|
||||||
glyph->outline.flags |= ft_outline_high_precision;
|
glyph->outline.flags |= ft_outline_high_precision;
|
||||||
|
|
|
@ -308,12 +308,12 @@
|
||||||
|
|
||||||
#ifdef T1_CONFIG_OPTION_NO_AFM
|
#ifdef T1_CONFIG_OPTION_NO_AFM
|
||||||
(FTDriver_getKerning) 0,
|
(FTDriver_getKerning) 0,
|
||||||
(FTDriver_getAdvances) 0
|
(FTDriver_getAdvances) 0,
|
||||||
#else
|
#else
|
||||||
(FTDriver_getKerning) Get_Kerning,
|
(FTDriver_getKerning) Get_Kerning,
|
||||||
(FTDriver_attachFile) T1_Read_AFM
|
(FTDriver_attachFile) T1_Read_AFM,
|
||||||
#endif
|
#endif
|
||||||
(FTDriver_getAdvances) 0
|
(FTDriver_getAdvances) 0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue