summaryrefslogtreecommitdiff
path: root/src/base
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2002-03-30 13:16:35 +0000
committerWerner Lemberg <wl@gnu.org>2002-03-30 13:16:35 +0000
commitf8ba2005ab6f35ad5cda250dfc6105101a10acb4 (patch)
tree6f6e5522a122b26bab0c02cf809b8c7c893d58d2 /src/base
parent78e004e84388998ff8ff23e4e8b7d5976d039c77 (diff)
downloadfreetype2-f8ba2005ab6f35ad5cda250dfc6105101a10acb4.tar.gz
* include/freetype/t1tables.h (t1_blend_max): Fix typo.
* src/base/ftstream.c: Simplify FT_ERROR calls. formatting, copyright update
Diffstat (limited to 'src/base')
-rw-r--r--src/base/Jamfile2
-rw-r--r--src/base/ftapi.c7
-rw-r--r--src/base/ftbase.c3
-rw-r--r--src/base/ftcalc.c2
-rw-r--r--src/base/ftdbgmem.c16
-rw-r--r--src/base/ftgloadr.c85
-rw-r--r--src/base/ftglyph.c2
-rw-r--r--src/base/ftinit.c2
-rw-r--r--src/base/ftlist.c2
-rw-r--r--src/base/ftmac.c2
-rw-r--r--src/base/ftnames.c2
-rw-r--r--src/base/ftobjs.c91
-rw-r--r--src/base/ftoutln.c8
-rw-r--r--src/base/ftstream.c40
-rw-r--r--src/base/ftutil.c19
-rw-r--r--src/base/rules.mk2
16 files changed, 169 insertions, 116 deletions
diff --git a/src/base/Jamfile b/src/base/Jamfile
index 6b9de2103..b883f0ef7 100644
--- a/src/base/Jamfile
+++ b/src/base/Jamfile
@@ -1,4 +1,4 @@
-# FreeType 2 src/base Jamfile (c) 2001 David Turner
+# FreeType 2 src/base Jamfile (c) 2001, 2002 David Turner
#
SubDir FT2_TOP src base ;
diff --git a/src/base/ftapi.c b/src/base/ftapi.c
index e97bc54db..1ef3005e2 100644
--- a/src/base/ftapi.c
+++ b/src/base/ftapi.c
@@ -1,10 +1,10 @@
/***************************************************************************/
/* */
-/* ftobjs.c */
+/* ftapi.c */
/* */
-/* The FreeType private base classes (body). */
+/* The FreeType compatibility functions (body). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -25,6 +25,7 @@
#include FT_TRUETYPE_TABLES_H
#include FT_OUTLINE_H
+
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
diff --git a/src/base/ftbase.c b/src/base/ftbase.c
index 9852d26c3..4ea846dc8 100644
--- a/src/base/ftbase.c
+++ b/src/base/ftbase.c
@@ -4,7 +4,7 @@
/* */
/* Single object library component (body only). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -30,4 +30,5 @@
#include "ftobjs.c"
#include "ftnames.c"
+
/* END */
diff --git a/src/base/ftcalc.c b/src/base/ftcalc.c
index f02b2f116..7e1282a1e 100644
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -4,7 +4,7 @@
/* */
/* Arithmetic computations (body). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/base/ftdbgmem.c b/src/base/ftdbgmem.c
index 6aaa3680b..3768234e6 100644
--- a/src/base/ftdbgmem.c
+++ b/src/base/ftdbgmem.c
@@ -4,7 +4,7 @@
/* */
/* Memory debugger (body). */
/* */
-/* Copyright 2001 by */
+/* Copyright 2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -43,15 +43,15 @@
FT_Byte* address;
FT_Long size; /* < 0 if the block was freed */
- const char* alloc_file_name;
+ const char* alloc_file_name;
FT_Long alloc_line_no;
- const char* free_file_name;
+ const char* free_file_name;
FT_Long free_line_no;
FT_MemNode link;
- } FT_MemNodeRec;
+ } FT_MemNodeRec;
typedef struct FT_MemTableRec_
@@ -64,16 +64,16 @@
FT_ULong alloc_current;
FT_ULong alloc_max;
- const char* file_name;
+ const char* file_name;
FT_Long line_no;
FT_Memory memory;
- FT_Pointer memory_user;
+ FT_Pointer memory_user;
FT_Alloc_Func alloc;
FT_Free_Func free;
FT_Realloc_Func realloc;
- } FT_MemTableRec;
+ } FT_MemTableRec;
#define FT_MEM_SIZE_MIN 7
@@ -270,7 +270,7 @@
table = NULL;
}
- Exit:
+ Exit:
return table;
}
diff --git a/src/base/ftgloadr.c b/src/base/ftgloadr.c
index 71acda6e3..5a2eb5160 100644
--- a/src/base/ftgloadr.c
+++ b/src/base/ftgloadr.c
@@ -1,3 +1,21 @@
+/***************************************************************************/
+/* */
+/* ftgloadr.c */
+/* */
+/* The FreeType glyph loader (body). */
+/* */
+/* Copyright 2002 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
#include <ft2build.h>
#include FT_INTERNAL_GLYPH_LOADER_H
#include FT_INTERNAL_MEMORY_H
@@ -5,6 +23,7 @@
#undef FT_COMPONENT
#define FT_COMPONENT trace_gloader
+
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
@@ -46,11 +65,11 @@
/* create a new glyph loader */
FT_BASE_DEF( FT_Error )
- FT_GlyphLoader_New( FT_Memory memory,
- FT_GlyphLoader *aloader )
+ FT_GlyphLoader_New( FT_Memory memory,
+ FT_GlyphLoader *aloader )
{
- FT_GlyphLoader loader;
- FT_Error error;
+ FT_GlyphLoader loader;
+ FT_Error error;
if ( !FT_NEW( loader ) )
@@ -64,7 +83,7 @@
/* rewind the glyph loader - reset counters to 0 */
FT_BASE_DEF( void )
- FT_GlyphLoader_Rewind( FT_GlyphLoader loader )
+ FT_GlyphLoader_Rewind( FT_GlyphLoader loader )
{
FT_GlyphLoad base = &loader->base;
FT_GlyphLoad current = &loader->current;
@@ -81,7 +100,7 @@
/* reset the glyph loader, frees all allocated tables */
/* and starts from zero */
FT_BASE_DEF( void )
- FT_GlyphLoader_Reset( FT_GlyphLoader loader )
+ FT_GlyphLoader_Reset( FT_GlyphLoader loader )
{
FT_Memory memory = loader->memory;
@@ -102,7 +121,7 @@
/* delete a glyph loader */
FT_BASE_DEF( void )
- FT_GlyphLoader_Done( FT_GlyphLoader loader )
+ FT_GlyphLoader_Done( FT_GlyphLoader loader )
{
if ( loader )
{
@@ -117,7 +136,7 @@
/* re-adjust the `current' outline fields */
static void
- FT_GlyphLoader_Adjust_Points( FT_GlyphLoader loader )
+ FT_GlyphLoader_Adjust_Points( FT_GlyphLoader loader )
{
FT_Outline* base = &loader->base.outline;
FT_Outline* current = &loader->current.outline;
@@ -135,7 +154,7 @@
FT_BASE_DEF( FT_Error )
- FT_GlyphLoader_CreateExtra( FT_GlyphLoader loader )
+ FT_GlyphLoader_CreateExtra( FT_GlyphLoader loader )
{
FT_Error error;
FT_Memory memory = loader->memory;
@@ -152,7 +171,7 @@
/* re-adjust the `current' subglyphs field */
static void
- FT_GlyphLoader_Adjust_Subglyphs( FT_GlyphLoader loader )
+ FT_GlyphLoader_Adjust_Subglyphs( FT_GlyphLoader loader )
{
FT_GlyphLoad base = &loader->base;
FT_GlyphLoad current = &loader->current;
@@ -167,9 +186,9 @@
/* DOESN'T change the number of points within the loader! */
/* */
FT_BASE_DEF( FT_Error )
- FT_GlyphLoader_CheckPoints( FT_GlyphLoader loader,
- FT_UInt n_points,
- FT_UInt n_contours )
+ FT_GlyphLoader_CheckPoints( FT_GlyphLoader loader,
+ FT_UInt n_points,
+ FT_UInt n_contours )
{
FT_Memory memory = loader->memory;
FT_Error error = FT_Err_Ok;
@@ -190,11 +209,11 @@
if ( FT_RENEW_ARRAY( base->points, old_max, new_max ) ||
FT_RENEW_ARRAY( base->tags, old_max, new_max ) )
- goto Exit;
+ goto Exit;
if ( loader->use_extra &&
FT_RENEW_ARRAY( loader->base.extra_points, old_max, new_max ) )
- goto Exit;
+ goto Exit;
adjust = 1;
loader->max_points = new_max;
@@ -227,12 +246,12 @@
/* NOT change the number of subglyphs within the loader! */
/* */
FT_BASE_DEF( FT_Error )
- FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader,
- FT_UInt n_subs )
+ FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader,
+ FT_UInt n_subs )
{
- FT_Memory memory = loader->memory;
- FT_Error error = FT_Err_Ok;
- FT_UInt new_max, old_max;
+ FT_Memory memory = loader->memory;
+ FT_Error error = FT_Err_Ok;
+ FT_UInt new_max, old_max;
FT_GlyphLoad base = &loader->base;
FT_GlyphLoad current = &loader->current;
@@ -258,7 +277,7 @@
/* prepare loader for the addition of a new glyph on top of the base one */
FT_BASE_DEF( void )
- FT_GlyphLoader_Prepare( FT_GlyphLoader loader )
+ FT_GlyphLoader_Prepare( FT_GlyphLoader loader )
{
FT_GlyphLoad current = &loader->current;
@@ -274,14 +293,14 @@
/* add current glyph to the base image - and prepare for another */
FT_BASE_DEF( void )
- FT_GlyphLoader_Add( FT_GlyphLoader loader )
+ FT_GlyphLoader_Add( FT_GlyphLoader loader )
{
- FT_GlyphLoad base = &loader->base;
- FT_GlyphLoad current = &loader->current;
+ FT_GlyphLoad base = &loader->base;
+ FT_GlyphLoad current = &loader->current;
- FT_UInt n_curr_contours = current->outline.n_contours;
- FT_UInt n_base_points = base->outline.n_points;
- FT_UInt n;
+ FT_UInt n_curr_contours = current->outline.n_contours;
+ FT_UInt n_base_points = base->outline.n_points;
+ FT_UInt n;
base->outline.n_points =
@@ -302,8 +321,8 @@
FT_BASE_DEF( FT_Error )
- FT_GlyphLoader_CopyPoints( FT_GlyphLoader target,
- FT_GlyphLoader source )
+ FT_GlyphLoader_CopyPoints( FT_GlyphLoader target,
+ FT_GlyphLoader source )
{
FT_Error error;
FT_UInt num_points = source->base.outline.n_points;
@@ -318,16 +337,16 @@
FT_MEM_COPY( out->points, in->points,
- num_points * sizeof ( FT_Vector ) );
+ num_points * sizeof ( FT_Vector ) );
FT_MEM_COPY( out->tags, in->tags,
- num_points * sizeof ( char ) );
+ num_points * sizeof ( char ) );
FT_MEM_COPY( out->contours, in->contours,
- num_contours * sizeof ( short ) );
+ num_contours * sizeof ( short ) );
/* do we need to copy the extra points? */
if ( target->use_extra && source->use_extra )
FT_MEM_COPY( target->base.extra_points, source->base.extra_points,
- num_points * sizeof ( FT_Vector ) );
+ num_points * sizeof ( FT_Vector ) );
out->n_points = (short)num_points;
out->n_contours = (short)num_contours;
diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c
index f2e6f7a2c..1f0989fe5 100644
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -4,7 +4,7 @@
/* */
/* FreeType convenience functions to handle glyphs (body). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/base/ftinit.c b/src/base/ftinit.c
index 8cc0e3bc5..7b92dc49f 100644
--- a/src/base/ftinit.c
+++ b/src/base/ftinit.c
@@ -4,7 +4,7 @@
/* */
/* FreeType initialization layer (body). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/base/ftlist.c b/src/base/ftlist.c
index 6dbfb09f9..52687b361 100644
--- a/src/base/ftlist.c
+++ b/src/base/ftlist.c
@@ -4,7 +4,7 @@
/* */
/* Generic list support for FreeType (body). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/base/ftmac.c b/src/base/ftmac.c
index e9ddc26a8..9d76b3880 100644
--- a/src/base/ftmac.c
+++ b/src/base/ftmac.c
@@ -4,7 +4,7 @@
/* */
/* Mac FOND support. Written by just@letterror.com. */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/base/ftnames.c b/src/base/ftnames.c
index 0b77cca4b..7e9f1ee04 100644
--- a/src/base/ftnames.c
+++ b/src/base/ftnames.c
@@ -7,7 +7,7 @@
/* */
/* This is _not_ used to retrieve glyph names! */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 2b341b07c..a12c13dba 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -4,7 +4,7 @@
/* */
/* The FreeType private base classes (body). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -28,6 +28,7 @@
#include <string.h> /* for strcmp() */
#include <setjmp.h> /* for setjmp() and longjmp() */
+
FT_BASE_DEF( void )
ft_validator_init( FT_Validator valid,
const FT_Byte* base,
@@ -46,10 +47,12 @@
{
int result;
+
result = setjmp( valid->jump_buffer );
return result;
}
+
FT_BASE_DEF( void )
ft_validator_error( FT_Validator valid,
FT_Error error )
@@ -72,8 +75,8 @@
/*************************************************************************/
- /* create a new input stream from a FT_Open_Args structure */
- /* */
+ /* create a new input stream from a FT_Open_Args structure */
+ /* */
static FT_Error
ft_input_stream_new( FT_Library library,
FT_Open_Args* args,
@@ -92,6 +95,7 @@
*astream = 0;
memory = library->memory;
+
if ( FT_NEW( stream ) )
goto Exit;
@@ -101,8 +105,8 @@
{
/* create a memory-based stream */
FT_Stream_OpenMemory( stream,
- (const FT_Byte*)args->memory_base,
- args->memory_size );
+ (const FT_Byte*)args->memory_base,
+ args->memory_size );
}
else if ( args->flags & ft_open_pathname )
{
@@ -134,7 +138,6 @@
}
-
static void
ft_input_stream_free( FT_Stream stream,
FT_Int external )
@@ -143,6 +146,7 @@
{
FT_Memory memory = stream->memory;
+
FT_Stream_Close( stream );
if ( !external )
@@ -172,7 +176,7 @@
ft_glyphslot_init( FT_GlyphSlot slot )
{
FT_Driver driver = slot->face->driver;
- FT_Driver_Class clazz = driver->clazz;
+ FT_Driver_Class clazz = driver->clazz;
FT_Memory memory = driver->root.memory;
FT_Error error = FT_Err_Ok;
FT_Slot_Internal internal;
@@ -232,7 +236,7 @@
ft_glyphslot_done( FT_GlyphSlot slot )
{
FT_Driver driver = slot->face->driver;
- FT_Driver_Class clazz = driver->clazz;
+ FT_Driver_Class clazz = driver->clazz;
FT_Memory memory = driver->root.memory;
@@ -262,7 +266,7 @@
{
FT_Error error;
FT_Driver driver;
- FT_Driver_Class clazz;
+ FT_Driver_Class clazz;
FT_Memory memory;
FT_GlyphSlot slot;
@@ -305,10 +309,10 @@
{
if ( slot )
{
- FT_Driver driver = slot->face->driver;
- FT_Memory memory = driver->root.memory;
- FT_GlyphSlot* parent;
- FT_GlyphSlot cur;
+ FT_Driver driver = slot->face->driver;
+ FT_Memory memory = driver->root.memory;
+ FT_GlyphSlot* parent;
+ FT_GlyphSlot cur;
/* Remove slot from its parent face's list */
@@ -497,6 +501,7 @@
FT_UInt EM = face->units_per_EM;
FT_Size_Metrics* metrics = &face->size->metrics;
+
slot->linearHoriAdvance = FT_MulDiv( slot->linearHoriAdvance,
(FT_Long)metrics->x_ppem << 16, EM );
@@ -596,19 +601,19 @@
if ( face->autohint.finalizer )
face->autohint.finalizer( face->autohint.data );
- /* Discard glyph slots for this face */
+ /* Discard glyph slots for this face. */
/* Beware! FT_Done_GlyphSlot() changes the field `face->glyph' */
while ( face->glyph )
FT_Done_GlyphSlot( face->glyph );
- /* Discard all sizes for this face */
+ /* discard all sizes for this face */
FT_List_Finalize( &face->sizes_list,
(FT_List_Destructor)destroy_size,
memory,
driver );
face->size = 0;
- /* Now discard client data */
+ /* now discard client data */
if ( face->generic.finalizer )
face->generic.finalizer( face );
@@ -618,10 +623,12 @@
{
FT_Int n;
+
for ( n = 0; n < face->num_charmaps; n++ )
{
FT_CMap cmap = FT_CMAP( face->charmaps[n] );
+
FT_CMap_Done( cmap );
face->charmaps[n] = NULL;
@@ -639,7 +646,8 @@
clazz->done_face( face );
/* close the stream for this face if needed */
- ft_input_stream_free( face->stream,
+ ft_input_stream_free(
+ face->stream,
( face->face_flags & FT_FACE_FLAG_EXTERNAL_STREAM ) != 0 );
face->stream = 0;
@@ -1066,13 +1074,13 @@
FT_New_Size( FT_Face face,
FT_Size *asize )
{
- FT_Error error;
- FT_Memory memory;
- FT_Driver driver;
+ FT_Error error;
+ FT_Memory memory;
+ FT_Driver driver;
FT_Driver_Class clazz;
- FT_Size size = 0;
- FT_ListNode node = 0;
+ FT_Size size = 0;
+ FT_ListNode node = 0;
if ( !face )
@@ -1200,7 +1208,7 @@
{
FT_Error error = FT_Err_Ok;
FT_Driver driver;
- FT_Driver_Class clazz;
+ FT_Driver_Class clazz;
FT_Size_Metrics* metrics;
FT_Long dim_x, dim_y;
@@ -1269,7 +1277,7 @@
{
FT_Error error = FT_Err_Ok;
FT_Driver driver;
- FT_Driver_Class clazz;
+ FT_Driver_Class clazz;
FT_Size_Metrics* metrics = &face->size->metrics;
@@ -1435,6 +1443,7 @@
FT_Face face = cmap->charmap.face;
FT_Memory memory = FT_FACE_MEMORY(face);
+
if ( clazz->done )
clazz->done( cmap );
@@ -1454,6 +1463,7 @@
FT_Memory memory;
FT_CMap cmap;
+
if ( clazz == NULL || charmap == NULL || charmap->face == NULL )
return FT_Err_Invalid_Argument;
@@ -1468,7 +1478,7 @@
if ( clazz->init )
{
error = clazz->init( cmap, init_data );
- if (error)
+ if ( error )
goto Fail;
}
@@ -1478,7 +1488,7 @@
face->num_charmaps+1 ) )
goto Fail;
- face->charmaps[ face->num_charmaps++ ] = (FT_CharMap) cmap;
+ face->charmaps[face->num_charmaps++] = (FT_CharMap)cmap;
}
Exit:
@@ -1509,6 +1519,7 @@
{
FT_CMap cmap = FT_CMAP( face->charmap );
+
result = cmap->clazz->char_index( cmap, charcode );
}
return result;
@@ -1516,8 +1527,6 @@
#else /* !FT_CONFIG_OPTION_USE_CMAPS */
-
-
FT_EXPORT_DEF( FT_UInt )
FT_Get_Char_Index( FT_Face face,
FT_ULong charcode )
@@ -1543,8 +1552,9 @@
FT_Get_First_Char( FT_Face face,
FT_UInt *agindex )
{
- FT_ULong result = 0;
- FT_UInt gindex = 0;
+ FT_ULong result = 0;
+ FT_UInt gindex = 0;
+
if ( face && face->charmap )
{
@@ -1569,8 +1579,8 @@
FT_ULong charcode,
FT_UInt *agindex )
{
- FT_ULong result = 0;
- FT_UInt gindex = 0;
+ FT_ULong result = 0;
+ FT_UInt gindex = 0;
if ( face && face->charmap )
@@ -1578,6 +1588,7 @@
FT_UInt32 code = (FT_UInt32)charcode;
FT_CMap cmap = FT_CMAP( face->charmap );
+
gindex = cmap->clazz->char_next( cmap, &code );
result = ( gindex == 0 ) ? 0 : code;
}
@@ -1673,8 +1684,8 @@
FT_HAS_GLYPH_NAMES( face ) )
{
/* now, lookup for glyph name */
- FT_Driver driver = face->driver;
- FT_Module_Class* clazz = FT_MODULE_CLASS( driver );
+ FT_Driver driver = face->driver;
+ FT_Module_Class* clazz = FT_MODULE_CLASS( driver );
if ( clazz->get_interface )
@@ -1707,7 +1718,7 @@
result = face->internal->postscript_name;
if ( !result )
{
- /* now, lookup for glyph name */
+ /* now, look up glyph name */
FT_Driver driver = face->driver;
FT_Module_Class* clazz = FT_MODULE_CLASS( driver );
@@ -1792,8 +1803,8 @@
FT_Glyph_Format format,
FT_ListNode* node )
{
- FT_ListNode cur;
- FT_Renderer result = 0;
+ FT_ListNode cur;
+ FT_Renderer result = 0;
if ( !library )
@@ -1938,7 +1949,7 @@
{
/* test for valid `library' delayed to FT_Lookup_Renderer() */
- return FT_Lookup_Renderer( library, format, 0 );
+ return FT_Lookup_Renderer( library, format, 0 );
}
@@ -2055,7 +2066,7 @@
FT_Render_Glyph( FT_GlyphSlot slot,
FT_UInt render_mode )
{
- FT_Library library;
+ FT_Library library;
if ( !slot )
@@ -2205,7 +2216,7 @@
if ( FT_MODULE_IS_DRIVER( module ) )
{
/* allocate glyph loader if needed */
- FT_Driver driver = FT_DRIVER( module );
+ FT_Driver driver = FT_DRIVER( module );
driver->clazz = (FT_Driver_Class)module->clazz;
diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c
index d30f695a7..e2046b73a 100644
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -4,7 +4,7 @@
/* */
/* FreeType outline management (body). */
/* */
-/* Copyright 1996-2001 by */
+/* Copyright 1996-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -358,13 +358,13 @@
return FT_Err_Invalid_Argument;
FT_MEM_COPY( target->points, source->points,
- source->n_points * sizeof ( FT_Vector ) );
+ source->n_points * sizeof ( FT_Vector ) );
FT_MEM_COPY( target->tags, source->tags,
- source->n_points * sizeof ( FT_Byte ) );
+ source->n_points * sizeof ( FT_Byte ) );
FT_MEM_COPY( target->contours, source->contours,
- source->n_contours * sizeof ( FT_Short ) );
+ source->n_contours * sizeof ( FT_Short ) );
/* copy all flags, except the `ft_outline_owner' one */
is_owner = target->flags & ft_outline_owner;
diff --git a/src/base/ftstream.c b/src/base/ftstream.c
index 9266d5099..60e785681 100644
--- a/src/base/ftstream.c
+++ b/src/base/ftstream.c
@@ -4,7 +4,7 @@
/* */
/* I/O stream support (body). */
/* */
-/* Copyright 2000-2001 by */
+/* Copyright 2000-2001, 2002 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
@@ -69,8 +69,8 @@
{
if ( stream->read( stream, pos, 0, 0 ) )
{
- FT_ERROR(( "%s: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
- "FT_Stream_Seek", pos, stream->size ));
+ FT_ERROR(( "FT_Stream_Seek: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
+ pos, stream->size ));
error = FT_Err_Invalid_Stream_Operation;
}
@@ -78,8 +78,8 @@
/* note that seeking to the first position after the file is valid */
else if ( pos > stream->size )
{
- FT_ERROR(( "%s: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
- "FT_Stream_Seek", pos, stream->size ));
+ FT_ERROR(( "FT_Stream_Seek: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
+ pos, stream->size ));
error = FT_Err_Invalid_Stream_Operation;
}
@@ -124,8 +124,8 @@
if ( pos >= stream->size )
{
- FT_ERROR(( "%s: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
- "FT_Stream_ReadAt", pos, stream->size ));
+ FT_ERROR(( "FT_Stream_ReadAt: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
+ pos, stream->size ));
return FT_Err_Invalid_Stream_Operation;
}
@@ -145,8 +145,9 @@
if ( read_bytes < count )
{
- FT_ERROR(( "%s: invalid read; expected %lu bytes, got %lu\n",
- "FT_Stream_ReadAt", count, read_bytes ));
+ FT_ERROR(( "FT_Stream_ReadAt:" ));
+ FT_ERROR(( " invalid read; expected %lu bytes, got %lu\n",
+ count, read_bytes ));
error = FT_Err_Invalid_Stream_Operation;
}
@@ -263,7 +264,7 @@
/* */
/* In this case, the loader code handles the 0-length table */
/* gracefully; however, stream.cursor is really set to 0 by the */
- /* FT_Stream_EnterFrame() call, and this is not an error. */
+ /* FT_Stream_EnterFrame() call, and this is not an error. */
/* */
FT_ASSERT( stream );
@@ -416,8 +417,8 @@
Fail:
*error = FT_Err_Invalid_Stream_Operation;
- FT_ERROR(( "%s: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
- "FT_Stream_ReadChar", stream->pos, stream->size ));
+ FT_ERROR(( "FT_Stream_ReadChar: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
+ stream->pos, stream->size ));
return 0;
}
@@ -509,7 +510,7 @@
Fail:
*error = FT_Err_Invalid_Stream_Operation;
- FT_ERROR(( "FT_Stream_ReadShort:" ));
+ FT_ERROR(( "FT_Stream_ReadShortLE:" ));
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
stream->pos, stream->size ));
@@ -556,8 +557,9 @@
Fail:
*error = FT_Err_Invalid_Stream_Operation;
- FT_ERROR(( "%s: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
- "FT_Stream_ReadOffset", stream->pos, stream->size ));
+ FT_ERROR(( "FT_Stream_ReadOffset:" ));
+ FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
+ stream->pos, stream->size ));
return 0;
}
@@ -567,7 +569,7 @@
FT_Stream_ReadLong( FT_Stream stream,
FT_Error* error )
{
- FT_Byte reads[4];
+ FT_Byte reads[4];
FT_Byte* p = 0;
FT_Long result = 0;
@@ -601,8 +603,8 @@
return result;
Fail:
- FT_ERROR(( "%s: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
- "FT_Stream_ReadLong", stream->pos, stream->size ));
+ FT_ERROR(( "FT_Stream_ReadLong: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
+ stream->pos, stream->size ));
*error = FT_Err_Invalid_Stream_Operation;
return 0;
@@ -647,7 +649,7 @@
return result;
Fail:
- FT_ERROR(( "FT_Stream_ReadLong:" ));
+ FT_ERROR(( "FT_Stream_ReadLongLE:" ));
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
stream->pos, stream->size ));
*error = FT_Err_Invalid_Stream_Operation;
diff --git a/src/base/ftutil.c b/src/base/ftutil.c
index 5c3507e4c..27dfbf049 100644
--- a/src/base/ftutil.c
+++ b/src/base/ftutil.c
@@ -1,3 +1,21 @@
+/***************************************************************************/
+/* */
+/* ftutil.c */
+/* */
+/* FreeType utility file for memory and list management (body). */
+/* */
+/* Copyright 2002 by */
+/* David Turner, Robert Wilhelm, and Werner Lemberg. */
+/* */
+/* This file is part of the FreeType project, and may only be used, */
+/* modified, and distributed under the terms of the FreeType project */
+/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
+/* this file you indicate that you have read the license and */
+/* understand and accept it fully. */
+/* */
+/***************************************************************************/
+
+
#include <ft2build.h>
#include FT_INTERNAL_DEBUG_H
#include FT_INTERNAL_MEMORY_H
@@ -309,3 +327,4 @@
}
+/* END */
diff --git a/src/base/rules.mk b/src/base/rules.mk
index 6b74753d2..b89bc80ee 100644
--- a/src/base/rules.mk
+++ b/src/base/rules.mk
@@ -3,7 +3,7 @@
#
-# Copyright 1996-2000 by
+# Copyright 1996-2000, 2002 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,