ref: 73861976779a754cc9b808760cc8e6cf98d52549
parent: 3229b8800525993ae1f39cd303c81919e3e693c0
author: Werner Lemberg <[email protected]>
date: Thu Jun 5 00:31:05 EDT 2003
* include/freetype/internal/ftdriver.h, include/freetype/internal/ftobjs.h, include/freetype/internal/psaux.h, src/cid/cidgload.c, src/psaux/psobjs.c, src/psaux/t1decode.c, src/psaux/psobjs.h, src/pshinter/pshrec.c, src/pshinter/pshalgo.c, src/psnames/psmodule.c, src/raster/ftraster.c, src/sfnt/sfobjs.c, src/smooth/ftgrays.c, src/smooth/ftsmooth.c, src/truetype/ttobjs.c, src/truetype/ttdriver.c, src/truetype/ttgload.c, src/type1/t1afm.c, src/type1/t1gload.c, src/type1/t1gload.h, src/type1/t1load.c, src/type1/t1objs.c, src/type42/t42parse.c, src/type42/t42parse.h: Many casts and slight argument type changes to make it work with a 16bit compiler.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2003-06-04 Wolfgang Domr�se <[email protected]>
+
+ * include/freetype/internal/ftdriver.h,
+ include/freetype/internal/ftobjs.h,
+ include/freetype/internal/psaux.h, src/cid/cidgload.c,
+ src/psaux/psobjs.c, src/psaux/t1decode.c, src/psaux/psobjs.h,
+ src/pshinter/pshrec.c, src/pshinter/pshalgo.c,
+ src/psnames/psmodule.c, src/raster/ftraster.c, src/sfnt/sfobjs.c,
+ src/smooth/ftgrays.c, src/smooth/ftsmooth.c, src/truetype/ttobjs.c,
+ src/truetype/ttdriver.c, src/truetype/ttgload.c, src/type1/t1afm.c,
+ src/type1/t1gload.c, src/type1/t1gload.h, src/type1/t1load.c,
+ src/type1/t1objs.c, src/type42/t42parse.c, src/type42/t42parse.h:
+ Many casts and slight argument type changes to make it work with
+ a 16bit compiler.
+
+2003-06-04 Werner Lemberg <[email protected]>
+
+ * include/freetype/config/ftoption.h: Defining
+ TT_CONFIG_OPTION_FORCE_UNPATENTED_HINTING by default is a bad idea
+ since some fonts (e.g. Arial) produce worse results than without
+ hinting. Reverted.
+
2003-06-04 Werner Lemberg <[email protected]>
* src/truetype/ttgload.c (load_truetype_glyph)
--- a/include/freetype/cache/ftcimage.h
+++ b/include/freetype/cache/ftcimage.h
@@ -4,7 +4,7 @@
/* */
/* FreeType Image cache (specification). */
/* */
-/* Copyright 2000-2001, 2002 by */
+/* Copyright 2000-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -208,12 +208,12 @@
/* FTC_Image_Desc */
/* */
/* <Description> */
- /* THIS TYPE IS DEPRECATED. Use @FTC_ImageDesc instead. */
+ /* THIS TYPE IS DEPRECATED. Use @FTC_ImageDescRec instead. */
/* */
/* A simple structure used to describe a given glyph image category. */
/* */
/* <Fields> */
- /* size :: An @FTC_SizeRec used to describe the glyph's face */
+ /* font :: An @FTC_FontRec used to describe the glyph's face */
/* and size. */
/* */
/* image_type :: The glyph image's type. */
--- a/include/freetype/internal/ftdriver.h
+++ b/include/freetype/internal/ftdriver.h
@@ -4,7 +4,7 @@
/* */
/* FreeType font driver 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, */
@@ -169,9 +169,9 @@
{
FT_Module_Class root;
- FT_Int face_object_size;
- FT_Int size_object_size;
- FT_Int slot_object_size;
+ FT_Long face_object_size;
+ FT_Long size_object_size;
+ FT_Long slot_object_size;
FT_Face_InitFunc init_face;
FT_Face_DoneFunc done_face;
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -239,7 +239,7 @@
typedef struct FT_CMap_ClassRec_
{
- FT_UInt size;
+ FT_ULong size;
FT_CMap_InitFunc init;
FT_CMap_DoneFunc done;
FT_CMap_CharIndexFunc char_index;
--- a/include/freetype/internal/psaux.h
+++ b/include/freetype/internal/psaux.h
@@ -70,10 +70,10 @@
(*done)( PS_Table table );
FT_Error
- (*add)( PS_Table table,
- FT_Int index,
- void* object,
- FT_Int length );
+ (*add)( PS_Table table,
+ FT_Int index,
+ void* object,
+ FT_PtrDist length );
void
(*release)( PS_Table table );
--- a/src/cid/cidgload.c
+++ b/src/cid/cidgload.c
@@ -48,7 +48,7 @@
FT_Error error = 0;
FT_Byte* charstring = 0;
FT_Memory memory = face->root.memory;
- FT_UInt glyph_length = 0;
+ FT_ULong glyph_length = 0;
#ifdef FT_CONFIG_OPTION_INCREMENTAL
@@ -107,8 +107,7 @@
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_length = (FT_UInt) cid_get_offset(
- &p, (FT_Byte)cid->gd_bytes ) - off1;
+ glyph_length = cid_get_offset( &p, (FT_Byte)cid->gd_bytes ) - off1;
FT_FRAME_EXIT();
if ( glyph_length == 0 )
@@ -148,9 +147,9 @@
if ( decoder->lenIV >= 0 )
cid_decrypt( charstring, glyph_length, 4330 );
- error = decoder->funcs.parse_charstrings( decoder,
- charstring + cs_offset,
- glyph_length - cs_offset );
+ error = decoder->funcs.parse_charstrings(
+ decoder, charstring + cs_offset,
+ (FT_Int)glyph_length - cs_offset );
}
FT_FREE( charstring );
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -153,10 +153,10 @@
/* reallocation fails. */
/* */
FT_LOCAL_DEF( FT_Error )
- ps_table_add( PS_Table table,
- FT_Int idx,
- void* object,
- FT_Int length )
+ ps_table_add( PS_Table table,
+ FT_Int idx,
+ void* object,
+ FT_PtrDist length )
{
if ( idx < 0 || idx > table->max_elems )
{
--- a/src/psaux/psobjs.h
+++ b/src/psaux/psobjs.h
@@ -4,7 +4,7 @@
/* */
/* Auxiliary functions for PostScript fonts (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, */
@@ -52,10 +52,10 @@
FT_Memory memory );
FT_LOCAL( FT_Error )
- ps_table_add( PS_Table table,
- FT_Int idx,
- void* object,
- FT_Int length );
+ ps_table_add( PS_Table table,
+ FT_Int idx,
+ void* object,
+ FT_PtrDist length );
FT_LOCAL( void )
ps_table_done( PS_Table table );
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -241,8 +241,8 @@
/* subglyph 1 = accent character */
subg->index = achar_index;
subg->flags = FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES;
- subg->arg1 = adx - asb;
- subg->arg2 = ady;
+ subg->arg1 = (FT_Int)( adx - asb );
+ subg->arg2 = (FT_Int)ady;
/* set up remaining glyph fields */
glyph->num_subglyphs = 2;
@@ -565,7 +565,7 @@
goto Stack_Underflow;
top -= 2;
- switch ( top[1] )
+ switch ( (FT_Int)top[1] )
{
case 1: /* start flex feature */
if ( top[0] != 0 )
@@ -706,7 +706,7 @@
values = top;
for ( nn = 0; nn < num_points; nn++ )
{
- FT_Int tmp = values[0];
+ FT_Long tmp = values[0];
for ( mm = 1; mm < blend->num_designs; mm++ )
@@ -785,8 +785,8 @@
case op_seac:
/* return immediately after the processing */
- return t1operator_seac( decoder, top[0], top[1],
- top[2], top[3], top[4] );
+ return t1operator_seac( decoder, top[0], top[1], top[2],
+ (FT_Int)top[3], (FT_Int)top[4] );
case op_sbw:
FT_TRACE4(( " sbw" ));
@@ -945,7 +945,7 @@
FT_TRACE4(( " callsubr" ));
- idx = top[0];
+ idx = (FT_Int)top[0];
if ( idx < 0 || idx >= (FT_Int)decoder->num_subrs )
{
FT_ERROR(( "t1_decoder_parse_charstrings: "
--- a/src/pshinter/pshalgo.c
+++ b/src/pshinter/pshalgo.c
@@ -1168,8 +1168,8 @@
for ( n = 0; n < glyph->num_points; n++, point++ )
{
- FT_Int n_prev = point->prev - points;
- FT_Int n_next = point->next - points;
+ FT_Int n_prev = (FT_Int)( point->prev - points );
+ FT_Int n_next = (FT_Int)( point->next - points );
FT_Pos dxi, dyi, dxo, dyo;
@@ -1448,7 +1448,8 @@
for ( ; num_hints > 0; num_hints--, sort++ )
{
PSH_Hint hint = sort[0];
- FT_Pos d, flag;
+ FT_Pos d;
+ FT_Int flag;
if ( point->flags2 & min_flag )
--- a/src/pshinter/pshrec.c
+++ b/src/pshinter/pshrec.c
@@ -861,8 +861,9 @@
FT_Memory memory = hints->memory;
- error = ps_dimension_add_t1stem( dim, stems[0], stems[1],
- memory, NULL );
+ error = ps_dimension_add_t1stem(
+ dim, (FT_Int)stems[0], (FT_Int)stems[1],
+ memory, NULL );
if ( error )
{
FT_ERROR(( "ps_hints_stem: could not add stem"
@@ -917,8 +918,9 @@
/* add the three stems to our hints/masks table */
for ( count = 0; count < 3; count++, stems += 2 )
{
- error = ps_dimension_add_t1stem( dim, stems[0], stems[1],
- memory, &idx[count] );
+ error = ps_dimension_add_t1stem(
+ dim, (FT_Int)stems[0], (FT_Int)stems[1],
+ memory, &idx[count] );
if ( error )
goto Fail;
}
@@ -1164,7 +1166,8 @@
FT_Int count,
FT_Fixed* coords )
{
- FT_Pos stems[32], y, n, total = count;
+ FT_Pos stems[32], y, n;
+ FT_Int total = count;
y = 0;
--- a/src/psnames/psmodule.c
+++ b/src/psnames/psmodule.c
@@ -4,7 +4,7 @@
/* */
/* PSNames module implementation (body). */
/* */
-/* 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, */
@@ -172,7 +172,7 @@
if ( uni_char != 0 && uni_char != 0xFFFF )
{
- map->unicode = uni_char;
+ map->unicode = (FT_UInt)uni_char;
map->glyph_index = n;
map++;
}
--- a/src/raster/ftraster.c
+++ b/src/raster/ftraster.c
@@ -917,7 +917,7 @@
/* Take care: miny-y1 can be a very large value; we use */
/* a slow MulDiv function to avoid clipping bugs */
x1 += SMulDiv( Dx, miny - y1, Dy );
- e1 = TRUNC( miny );
+ e1 = (Int)TRUNC( miny );
f1 = 0;
}
else
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -633,7 +633,7 @@
root->face_flags |= FT_FACE_FLAG_VERTICAL;
}
#endif
- root->num_fixed_sizes = face->num_sbit_strikes;
+ root->num_fixed_sizes = (FT_Int)face->num_sbit_strikes;
if ( FT_NEW_ARRAY( root->available_sizes, face->num_sbit_strikes ) )
goto Exit;
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -340,7 +340,7 @@
long byte_size )
{
ras.cells = (PCell)buffer;
- ras.max_cells = byte_size / sizeof ( TCell );
+ ras.max_cells = (int)( byte_size / sizeof ( TCell ) );
ras.num_cells = 0;
ras.area = 0;
ras.cover = 0;
@@ -567,9 +567,9 @@
if ( ex1 != ex2 )
{
- p = ONE_PIXEL * ( y2 - y1 + delta );
- lift = (TCoord)( p / dx );
- rem = (TCoord)( p % dx );
+ p = ONE_PIXEL * ( y2 - y1 + delta );
+ lift = (TCoord)( p / dx );
+ rem = (TCoord)( p % dx );
if ( rem < 0 )
{
lift--;
@@ -576,7 +576,7 @@
rem += (TCoord)dx;
}
- mod -= dx;
+ mod -= (int)dx;
while ( ex1 != ex2 )
{
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -4,7 +4,7 @@
/* */
/* Anti-aliasing renderer interface (body). */
/* */
-/* Copyright 2000-2001, 2002 by */
+/* Copyright 2000-2001, 2002, 2003 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -137,8 +137,8 @@
cbox.xMax = ( cbox.xMax + 63 ) & -64;
cbox.yMax = ( cbox.yMax + 63 ) & -64;
- width = ( cbox.xMax - cbox.xMin ) >> 6;
- height = ( cbox.yMax - cbox.yMin ) >> 6;
+ width = (FT_UInt)( ( cbox.xMax - cbox.xMin ) >> 6 );
+ height = (FT_UInt)( ( cbox.yMax - cbox.yMin ) >> 6 );
bitmap = &slot->bitmap;
memory = render->root.memory;
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -115,7 +115,7 @@
while ( left <= right )
{
- FT_Int middle = left + ( ( right - left ) >> 1 );
+ FT_Long middle = left + ( ( right - left ) >> 1 );
FT_ULong cur_pair;
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -886,7 +886,7 @@
count = 0;
if ( glyph_index < (FT_UInt)face->num_locations - 1 )
- count = face->glyph_locations[glyph_index + 1] - offset;
+ count = (FT_UInt)( face->glyph_locations[glyph_index + 1] - offset );
}
if ( count == 0 )
@@ -1184,16 +1184,16 @@
/* */
/* This algorithm is a guess and works much better than the above. */
/* */
- int mac_xscale = FT_SqrtFixed(
- FT_MulFix( subglyph->transform.xx,
- subglyph->transform.xx ) +
- FT_MulFix( subglyph->transform.xy,
- subglyph->transform.xy) );
- int mac_yscale = FT_SqrtFixed(
- FT_MulFix( subglyph->transform.yy,
- subglyph->transform.yy ) +
- FT_MulFix( subglyph->transform.yx,
- subglyph->transform.yx ) );
+ FT_Fixed mac_xscale = FT_SqrtFixed(
+ FT_MulFix( subglyph->transform.xx,
+ subglyph->transform.xx ) +
+ FT_MulFix( subglyph->transform.xy,
+ subglyph->transform.xy) );
+ FT_Fixed mac_yscale = FT_SqrtFixed(
+ FT_MulFix( subglyph->transform.yy,
+ subglyph->transform.yy ) +
+ FT_MulFix( subglyph->transform.yx,
+ subglyph->transform.yx ) );
x = FT_MulFix( x, mac_xscale );
@@ -1647,9 +1647,9 @@
error = sfnt->load_sbit_image( face,
- size->strike_index,
- glyph_index,
- load_flags,
+ (FT_ULong)size->strike_index,
+ (FT_UInt)glyph_index,
+ (FT_Int)load_flags,
stream,
&glyph->bitmap,
&metrics );
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -760,7 +760,7 @@
strike->hori.max_width +
strike->hori.min_advance_SB ) << 6;
- size->strike_index = strike_index;
+ size->strike_index = (FT_UInt)strike_index;
}
else
{
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -4,7 +4,7 @@
/* */
/* AFM support for Type 1 fonts (body). */
/* */
-/* 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, */
@@ -148,7 +148,7 @@
FT_ULong index2 = KERN_INDEX( pair2->glyph1, pair2->glyph2 );
- return ( index1 - index2 );
+ return (int)( index1 - index2 );
}
--- a/src/type1/t1gload.c
+++ b/src/type1/t1gload.c
@@ -143,7 +143,7 @@
FT_LOCAL_DEF( FT_Error )
T1_Compute_Max_Advance( T1_Face face,
- FT_Int* max_advance )
+ FT_Pos* max_advance )
{
FT_Error error;
T1_DecoderRec decoder;
@@ -185,7 +185,7 @@
if ( glyph_index == 0 || decoder.builder.advance.x > *max_advance )
*max_advance = decoder.builder.advance.x;
- /* ignore the error if one occured - skip to next glyph */
+ /* ignore the error if one occurred - skip to next glyph */
}
return T1_Err_Ok;
--- a/src/type1/t1gload.h
+++ b/src/type1/t1gload.h
@@ -4,7 +4,7 @@
/* */
/* Type 1 Glyph Loader (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, */
@@ -29,7 +29,7 @@
FT_LOCAL( FT_Error )
T1_Compute_Max_Advance( T1_Face face,
- FT_Int* max_advance );
+ FT_Pos* max_advance );
FT_LOCAL( FT_Error )
T1_Load_Glyph( T1_GlyphSlot glyph,
--- a/src/type1/t1load.c
+++ b/src/type1/t1load.c
@@ -1213,12 +1213,12 @@
FT_MEM_COPY( temp, base, size );
psaux->t1_decrypt( temp, size, 4330 );
size -= face->type1.private_dict.lenIV;
- error = T1_Add_Table( table, idx,
+ error = T1_Add_Table( table, (FT_Int)idx,
temp + face->type1.private_dict.lenIV, size );
FT_FREE( temp );
}
else
- error = T1_Add_Table( table, idx, base, size );
+ error = T1_Add_Table( table, (FT_Int)idx, base, size );
if ( error )
goto Fail;
}
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -424,7 +424,7 @@
root->max_advance_width =
(FT_Short)( root->bbox.xMax );
{
- FT_Int max_advance;
+ FT_Pos max_advance;
error = T1_Compute_Max_Advance( face, &max_advance );
--- a/src/type42/t42parse.c
+++ b/src/type42/t42parse.c
@@ -383,7 +383,7 @@
/* read the number of entries in the encoding, should be 256 */
- count = T1_ToInt( parser );
+ count = (FT_Int)T1_ToInt( parser );
if ( parser->root.error )
return;
@@ -451,7 +451,7 @@
parser->root.cursor = cur;
- charcode = T1_ToInt( parser );
+ charcode = (FT_Int)T1_ToInt( parser );
cur = parser->root.cursor;
/* skip whitespace */
@@ -715,7 +715,7 @@
FT_Int n;
- loader->num_glyphs = T1_ToInt( parser );
+ loader->num_glyphs = (FT_Int)T1_ToInt( parser );
if ( parser->root.error )
return;
@@ -864,11 +864,11 @@
FT_Byte* base,
FT_Long size )
{
- T42_Parser parser = &loader->parser;
- FT_Byte* cur = base;
- FT_Byte* limit = cur + size;
- FT_UInt n_keywords = sizeof ( t42_keywords ) /
- sizeof ( t42_keywords[0] );
+ T42_Parser parser = &loader->parser;
+ FT_Byte* cur = base;
+ FT_Byte* limit = cur + size;
+ FT_UInt n_keywords = (FT_UInt)( sizeof ( t42_keywords ) /
+ sizeof ( t42_keywords[0] ) );
parser->root.cursor = base;
--- a/src/type42/t42parse.h
+++ b/src/type42/t42parse.h
@@ -4,7 +4,7 @@
/* */
/* Type 42 font parser (specification). */
/* */
-/* Copyright 2002 by Roberto Alameda. */
+/* Copyright 2002, 2003 by Roberto Alameda. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
@@ -31,7 +31,7 @@
FT_Stream stream;
FT_Byte* base_dict;
- FT_Int base_len;
+ FT_Long base_len;
FT_Byte in_memory;