From 3c403e4c17fa68a8a7992fa347fda312e1bae2a0 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Tue, 6 Aug 2002 21:47:40 +0000 Subject: [PATCH] Some formatting. * src/cff/cffcmap.c: Remove compiler warnings. * src/cache/ftccache.c, src/cache/ftccache.i, src/pfr/pfrload.c, src/pfr/pfrgload.c: s/index/idx/. * src/cff/cffload.c: s/select/fdselect/. * src/raster/ftraster.c: s/wait/waiting/. --- ChangeLog | 81 ++++++---- include/freetype/ftincrem.h | 231 ++++++++++++++++++----------- include/freetype/internal/ftobjs.h | 6 +- src/base/ftobjs.c | 23 ++- src/cache/ftccache.c | 30 ++-- src/cache/ftccache.i | 10 +- src/cff/cffcmap.c | 6 +- src/cff/cffload.c | 45 +++--- src/pfr/pfrgload.c | 14 +- src/pfr/pfrload.c | 6 +- src/raster/ftraster.c | 14 +- src/sfnt/sfobjs.c | 4 +- src/truetype/ttgload.c | 24 +-- src/type1/t1gload.c | 27 ++-- src/type1/t1load.c | 2 +- 15 files changed, 313 insertions(+), 210 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26ff004c7..ea1001e1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,36 +1,63 @@ -2002-08-01 Graham Asher - * src/type1/t1load.c: - T1_Open_Face now tolerates a face with no charstrings if there - is an incremental loading interface. Type 1 faces supplied by - PostScript interpreters like GhostScript will typically not - provide any charstrings at load time, so this is essential - if they are to work. +2002-08-06 Werner Lemberg + + * src/cff/cffcmap.c: Remove compiler warnings. + * src/cache/ftccache.c, src/cache/ftccache.i, + src/pfr/pfrload.c, src/pfr/pfrgload.c: s/index/idx/. + * src/cff/cffload.c: s/select/fdselect/. + * src/raster/ftraster.c: s/wait/waiting/. 2002-08-01 Graham Asher - * include/freetype/config/ftheader.h, - include/freetype/freetype.h, - include/freetype/ftincrem.h, - include/freetype/internal/ftobjs.h, - src/base/ftobjs.c, - src/cid/cidgload.c, - src/sfnt/sfobjs.c, - src/truetype/ttgload.c, - src/truetype/ttobjs.c, - src/type1/t1gload.c: - Modified incremental loading interface to be closer to David's - preferences. The header freetype.h is not now affected, - the interface is specified via an FT_Parameter, the pointer to - the interface is hidden in an internal part of the face record, - and all the definitions are in ftincrem.h. + + * src/type1/t1load.c (T1_Open_Face): Tolerate a face with no + charstrings if there is an incremental loading interface. Type 1 + faces supplied by PostScript interpreters like GhostScript will + typically not provide any charstrings at load time, so this is + essential if they are to work. + +2002-08-01 Graham Asher + + Modified incremental loading interface to be closer to David's + preferences. The header freetype.h is not now affected, the + interface is specified via an FT_Parameter, the pointer to the + 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]: + Removed. + * include/freetype/internal/ftobjs.h [FT_CONFIG_OPTION_INCREMENTAL]: + Include FT_INCREMENTAL_H. + (FT_Face_InternalRec) [FT_CONFIG_OPTION_INCREMENTAL]: Add + `incremental_interface'. + + * src/base/ftobjs.c (open_face, FT_Open_Face) + [FT_CONFIG_OPTION_INCREMENTAL]: Updated. + * src/sfnt/sfobjs.c (SFNT_Load_Face) [FT_CONFIG_OPTION_INCREMENTAL]: + Updated. + + * src/truetype/ttgload.c (load_truetype_glyph) + [FT_CONFIG_OPTION_INCREMENTAL]: Updated. + Free loaded glyph data properly. + (compute_glyph_metrics, TT_Load_Glyph) + [FT_CONFIG_OPTION_INCREMENTAL]: Updated. + * src/truetype/ttobjs.c (TT_Face_Init) + [FT_CONFIG_OPTION_INCREMENTAL]: Updated. + + * src/type1/t1gload.c (T1_Parse_Glyph_And_Get_Char_String) + [FT_CONFIG_OPTION_INCREMENTAL]: Updated. + (T1_Parse_Glyph) [FT_CONFIG_OPTION_INCREMENTAL]: Updated. + Free loaded glyph data properly. + (T1_Load_Glyph): Updated. + [FT_CONFIG_OPTION_INCREMENTAL]: Free loaded glyph data properly. 2002-07-30 David Turner - * include/freetype/ftincrem.h: adding new experimental header file - to demonstrate a "cleaner" API to support incremental font loading. - comments appreciated... + * include/freetype/ftincrem.h: Adding new experimental header file + to demonstrate a "cleaner" API to support incremental font loading. - * src/tools/docmaker/*: adding new (more advanced) version of - the DocMaker tool. Python with regular expressions rocks.. + * include/freetype/config/ftheader.h (FT_INCREMENTAL_H): New macro. + + * src/tools/docmaker/*: Adding new (more advanced) version of + the DocMaker tool, using Python's sophisticated regexps. 2002-07-28 Werner Lemberg diff --git a/include/freetype/ftincrem.h b/include/freetype/ftincrem.h index a9416710f..19d90e2ce 100644 --- a/include/freetype/ftincrem.h +++ b/include/freetype/ftincrem.h @@ -1,18 +1,39 @@ -#ifndef __FT_INCREMENTAL_H__ -#define __FT_INCREMENTAL_H__ +/***************************************************************************/ +/* */ +/* ftincrem.h */ +/* */ +/* FreeType incremental loading (specification). */ +/* */ +/* 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. */ +/* */ +/***************************************************************************/ + + +#ifndef __FTINCREM_H__ +#define __FTINCREM_H__ #include #include FT_FREETYPE_H + FT_BEGIN_HEADER - /************************************************************************* + + /*************************************************************************** * - * @type: FT_Incremental + * @type: + * FT_Incremental * * @description: * An opaque type describing a user-provided object used to implement - * "incremental" glyph loading within FreeType. This is used to support + * "incremental" glyph loading within FreeType. This is used to support * embedded fonts in certain environments (e.g. Postscript interpreters), * where the glyph data isn't in the font file, or must be overridden by * different values. @@ -21,33 +42,39 @@ FT_BEGIN_HEADER * It is up to client applications to create and implement @FT_Incremental * objects, as long as they provide implementations for the methods * @FT_Incremental_GetGlyphDataFunc, @FT_Incremental_FreeGlyphDataFunc - * and @FT_Incremental_GetGlyphMetricsFunc + * and @FT_Incremental_GetGlyphMetricsFunc. * - * see the description of @FT_Incremental_InterfaceRec to understand how + * See the description of @FT_Incremental_InterfaceRec to understand how * to use incremental objects with FreeType. */ - typedef struct FT_IncrementalRec_* FT_Incremental; + typedef struct FT_IncrementalRec_* FT_Incremental; - /************************************************************************* + /*************************************************************************** * - * @struct: FT_Incremental_Metrics + * @struct: + * FT_Incremental_Metrics * * @description: * A small structure used to contain the basic glyph metrics returned - * by the @FT_Incremental_GetGlyphMetricsFunc method + * by the @FT_Incremental_GetGlyphMetricsFunc method. * * @fields: - * bearing_x :: left bearing, in font units. - * bearing_y :: top bearing, in font units. - * advance :: glyph advance, in font units + * bearing_x :: + * Left bearing, in font units. + * + * bearing_y :: + * Top bearing, in font units. + * + * advance :: + * Glyph advance, in font units. * * @note: * These correspond to horizontal or vertical metrics depending on the * value of the 'vertical' argument to the function - * @FT_Incremental_GetGlyphMetricsFunc + * @FT_Incremental_GetGlyphMetricsFunc. */ - typedef struct FT_Incremental_MetricsRec_ + typedef struct FT_Incremental_MetricsRec_ { FT_Long bearing_x; FT_Long bearing_y; @@ -56,9 +83,10 @@ FT_BEGIN_HEADER } FT_Incremental_MetricsRec, *FT_Incremental_Metrics; - /************************************************************************** + /*************************************************************************** * - * @type: FT_Incremental_GetGlyphDataFunc + * @type: + * FT_Incremental_GetGlyphDataFunc * * @description: * A function called by FreeType to access a given glyph's data bytes @@ -66,23 +94,26 @@ FT_BEGIN_HEADER * enabled. * * Note that the format of the glyph's data bytes depends on the font - * file format. For TrueType, it must correspond to the raw bytes within - * the 'glyf' table. For Postscript formats, it must correspond to the - * *unencrypted* charstring bytes, without any 'lenIV' header. It is + * file format. For TrueType, it must correspond to the raw bytes within + * the 'glyf' table. For Postscript formats, it must correspond to the + * *unencrypted* charstring bytes, without any 'lenIV' header. It is * undefined for any other format. * * @input: - * incremental :: handle to an opaque @FT_Incremental handle provided - * by the client application + * incremental :: + * Handle to an opaque @FT_Incremental handle provided by the client + * application. * - * glyph_index :: index of relevant glyph + * glyph_index :: + * Index of relevant glyph. * * @output: - * adata :: a structure describing the returned glyph data bytes - * (which will be accessed as a read-only byte block) + * adata :: + * A structure describing the returned glyph data bytes (which will be + * accessed as a read-only byte block). * * @return: - * FreeType error code. 0 means success + * FreeType error code. 0 means success. * * @note: * If this function returns succesfully the method @@ -92,46 +123,67 @@ FT_BEGIN_HEADER * Nested calls to @FT_Incremental_GetGlyphDataFunc can happen for * compound glyphs. */ - typedef FT_Error (*FT_Incremental_GetGlyphDataFunc) - ( FT_Incremental incremental, - FT_UInt glyph_index, - FT_Data* adata ); + typedef FT_Error + (*FT_Incremental_GetGlyphDataFunc)( FT_Incremental incremental, + FT_UInt glyph_index, + FT_Data* adata ); - /************************************************************************** + + /*************************************************************************** * - * @type: FT_Incremental_FreeGlyphDataFunc + * @type: + * FT_Incremental_FreeGlyphDataFunc * * @description: * A function used to release the glyph data bytes returned by a * successful call to @FT_Incremental_GetGlyphDataFunc. * * @input: - * incremental :: handle to an opaque @FT_Incremental handle provided - * by the client application + * incremental :: + * A handle to an opaque @FT_Incremental handle provided by the client + * application. * - * data :: glyph_index :: index of relevant glyph + * data :: + * A structure describing the glyph data bytes (which will be accessed + * as a read-only byte block). */ - typedef void (*FT_Incremental_FreeGlyphDataFunc) - ( FT_Incremental incremental, - FT_Data* data ); + typedef void + (*FT_Incremental_FreeGlyphDataFunc)( FT_Incremental incremental, + FT_Data* data ); - /************************************************************************** + /*************************************************************************** * - * @type: FT_Incremental_GetGlyphMetricsFunc + * @type: + * FT_Incremental_GetGlyphMetricsFunc * * @description: * A function used to retrieve the basic metrics of a given glyph index - * before accessing its data. This is necessary because, in certain formats - * like TrueType, the metrics are stored in a different place from the - * glyph images proper. + * before accessing its data. This is necessary because, in certain + * formats like TrueType, the metrics are stored in a different place from + * the glyph images proper. * * @input: - * incremental :: handle to an opaque @FT_Incremental handle provided - * by the client application + * incremental :: + * A handle to an opaque @FT_Incremental handle provided by the client + * application. + * + * glyph_index :: + * Index of relevant glyph. + * + * vertical :: + * If true, return vertical metrics. + * + * @output: + * ametrics :: + * The glyph metrics in font units. + * + * afound :: + * True if there are metrics at all. * */ - typedef FT_Error (*FT_Incremental_GetGlyphMetricsFunc) + typedef FT_Error + (*FT_Incremental_GetGlyphMetricsFunc) ( FT_Incremental incremental, FT_UInt glyph_index, FT_Bool vertical, @@ -139,24 +191,25 @@ FT_BEGIN_HEADER FT_Bool *afound ); - /************************************************************************* + /************************************************************************** * - * @struct: FT_Incremental_FuncsRec + * @struct: + * FT_Incremental_FuncsRec * * @description: - * A table of functions for accessing fonts that load data - * incrementally. Used in @FT_Incremental_Interface. + * A table of functions for accessing fonts that load data + * incrementally. Used in @FT_Incremental_Interface. * * @fields: - * get_glyph_data :: The function to get glyph data. Must not be - * null. + * get_glyph_data :: + * The function to get glyph data. Must not be null. * - * free_glyph_data :: The function to release glyph data. Must not - * be null. + * free_glyph_data :: + * The function to release glyph data. Must not be null. * - * get_glyph_metrics :: The function to get glyph metrics. May be - * null if the font does not provide - * overriding glyph metrics. + * get_glyph_metrics :: + * The function to get glyph metrics. May be null if the font does + * not provide overriding glyph metrics. */ typedef struct FT_Incremental_FuncsRec_ { @@ -167,59 +220,67 @@ FT_BEGIN_HEADER } FT_Incremental_FuncsRec; - /************************************************************************** + /*************************************************************************** * - * @struct: FT_Incremental_InterfaceRec + * @struct: + * FT_Incremental_InterfaceRec * * @description: * A structure to be used with @FT_Open_Face to indicate that the user - * wants to support incremental glyph loading. You should use it with + * wants to support incremental glyph loading. You should use it with * @FT_PARAM_TAG_INCREMENTAL as in the following example: * - * { - * FT_Incremental_InterfaceRec inc_int; - * FT_Parameter parameter; - * FT_Open_Args open_args; + * { + * FT_Incremental_InterfaceRec inc_int; + * FT_Parameter parameter; + * FT_Open_Args open_args; * - * // set up incremental descriptor - * inc_int.funcs = my_funcs; - * inc_int.object = my_object; * - * // set up optional parameter - * parameter.tag = FT_PARAM_TAG_INCREMENTAL; - * parameter.data = &inc_int; + * // set up incremental descriptor + * inc_int.funcs = my_funcs; + * inc_int.object = my_object; * - * // set up FT_Open_Args structure - * open_args.flags = (FT_Open_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 + * // set up optional parameter + * parameter.tag = FT_PARAM_TAG_INCREMENTAL; + * parameter.data = &inc_int; * - * // open the - * error = FT_Open_Face( library, &open_args, index, &face ); - * .... - * } + * // set up FT_Open_Args structure + * open_args.flags = (FT_Open_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 + * + * // open the font + * error = FT_Open_Face( library, &open_args, index, &face ); + * ... + * } */ - typedef struct FT_Incremental_InterfaceRec_ + typedef struct FT_Incremental_InterfaceRec_ { const FT_Incremental_FuncsRec* funcs; FT_Incremental object; } FT_Incremental_InterfaceRec; - /************************************************************************** + + /*************************************************************************** * - * @constant: FT_PARAM_TAG_INCREMENTAL + * @constant: + * FT_PARAM_TAG_INCREMENTAL * * @description: * A constant used as the tag of @FT_Parameter structures to indicate * an incremental loading object to be used by FreeType. * */ -#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG('i','n','c','r') +#define FT_PARAM_TAG_INCREMENTAL FT_MAKE_TAG( 'i', 'n', 'c', 'r' ) /* */ FT_END_HEADER -#endif /* __FT_INCREMENTAL_H__ */ +#endif /* __FTINCREM_H__ */ + + +/* END */ diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h index ede438d3d..f6ec411eb 100644 --- a/include/freetype/internal/ftobjs.h +++ b/include/freetype/internal/ftobjs.h @@ -40,6 +40,7 @@ #include FT_INCREMENTAL_H #endif + FT_BEGIN_HEADER @@ -300,11 +301,12 @@ FT_BEGIN_HEADER /* */ /* postscript_name :: Postscript font name for this face. */ /* */ - /* incremental_interface :: If non-null, the interface through */ + /* incremental_interface :: */ + /* If non-null, the interface through */ /* which glyph data and metrics are loaded */ /* incrementally for faces that do not provide */ /* all of this data when first opened. */ - /* This field exists only if */ + /* This field exists only if */ /* @FT_CONFIG_OPTION_INCREMENTAL is defined. */ /* */ typedef struct FT_Face_InternalRec_ diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 1d4340e21..c6530886c 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -25,6 +25,7 @@ #include FT_TRUETYPE_TABLES_H #include FT_OUTLINE_H + FT_BASE_DEF( void ) ft_validator_init( FT_Validator valid, const FT_Byte* base, @@ -707,6 +708,7 @@ FT_Error error; FT_Face_Internal internal; + clazz = driver->clazz; memory = driver->root.memory; @@ -724,12 +726,15 @@ face->stream = stream; #ifdef FT_CONFIG_OPTION_INCREMENTAL - { - int i; - face->internal->incremental_interface = 0; - for (i = 0; i < num_params && !face->internal->incremental_interface; i++) - if (params[i].tag == FT_PARAM_TAG_INCREMENTAL) - face->internal->incremental_interface = params[i].data; + { + int i; + + + face->internal->incremental_interface = 0; + for ( i = 0; i < num_params && !face->internal->incremental_interface; + i++ ) + if ( params[i].tag == FT_PARAM_TAG_INCREMENTAL ) + face->internal->incremental_interface = params[i].data; } #endif @@ -874,8 +879,9 @@ /* not all modules are drivers, so check... */ if ( FT_MODULE_IS_DRIVER( driver ) ) { - FT_Int num_params = 0; - FT_Parameter* params = 0; + FT_Int num_params = 0; + FT_Parameter* params = 0; + if ( args->flags & ft_open_params ) { @@ -909,6 +915,7 @@ FT_Int num_params = 0; FT_Parameter* params = 0; + driver = FT_DRIVER( cur[0] ); if ( args->flags & ft_open_params ) diff --git a/src/cache/ftccache.c b/src/cache/ftccache.c index b54065b3f..14cb725b2 100644 --- a/src/cache/ftccache.c +++ b/src/cache/ftccache.c @@ -159,14 +159,14 @@ { FT_Error error = 0; FTC_Node *pnode; - FT_UInt index, num_buckets; + FT_UInt idx, num_buckets; - index = (FT_UInt)( node->hash & cache->mask ); - if ( index < cache->p ) - index = (FT_UInt)( node->hash & ( 2 * cache->mask + 1 ) ); + idx = (FT_UInt)( node->hash & cache->mask ); + if ( idx < cache->p ) + idx = (FT_UInt)( node->hash & ( 2 * cache->mask + 1 ) ); - pnode = cache->buckets + index; + pnode = cache->buckets + idx; for (;;) { @@ -239,15 +239,15 @@ FTC_Cache cache ) { FTC_Node *pnode; - FT_UInt index; + FT_UInt idx; FT_Error error = 0; - index = (FT_UInt)( node->hash & cache->mask ); - if ( index < cache->p ) - index = (FT_UInt)( node->hash & (2 * cache->mask + 1 ) ); + idx = (FT_UInt)( node->hash & cache->mask ); + if ( idx < cache->p ) + idx = (FT_UInt)( node->hash & (2 * cache->mask + 1 ) ); - pnode = cache->buckets + index; + pnode = cache->buckets + idx; node->link = *pnode; *pnode = node; @@ -603,14 +603,14 @@ FTC_Family family = (FTC_Family) lru; FT_UFast hash = query->hash; FTC_Node* bucket; - FT_UInt index; + FT_UInt idx; - index = hash & cache->mask; - if ( index < cache->p ) - index = hash & ( cache->mask * 2 + 1 ); + idx = hash & cache->mask; + if ( idx < cache->p ) + idx = hash & ( cache->mask * 2 + 1 ); - bucket = cache->buckets + index; + bucket = cache->buckets + idx; if ( query->family != family || diff --git a/src/cache/ftccache.i b/src/cache/ftccache.i index 49faa93d9..8ecf395df 100644 --- a/src/cache/ftccache.i +++ b/src/cache/ftccache.i @@ -79,14 +79,14 @@ hash = query->hash; { - FT_UInt index; + FT_UInt idx; - index = hash & cache->mask; - if ( index < cache->p ) - index = hash & ( cache->mask * 2 + 1 ); + idx = hash & cache->mask; + if ( idx < cache->p ) + idx = hash & ( cache->mask * 2 + 1 ); - bucket = cache->buckets + index; + bucket = cache->buckets + idx; } #ifdef FT_DEBUG_LEVEL_ERROR diff --git a/src/cff/cffcmap.c b/src/cff/cffcmap.c index d84db1072..453dbc33e 100644 --- a/src/cff/cffcmap.c +++ b/src/cff/cffcmap.c @@ -32,7 +32,7 @@ cff_cmap_encoding_init( CFF_CMapStd cmap ) { TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); - CFF_Font cff = face->extra.data; + CFF_Font cff = (CFF_Font)face->extra.data; CFF_Encoding encoding = &cff->encoding; @@ -144,9 +144,9 @@ FT_UInt count; TT_Face face = (TT_Face)FT_CMAP_FACE( cmap ); FT_Memory memory = FT_FACE_MEMORY( face ); - CFF_Font cff = face->extra.data; + CFF_Font cff = (CFF_Font)face->extra.data; CFF_Charset charset = &cff->charset; - PSNames_Service psnames = cff->psnames; + PSNames_Service psnames = (PSNames_Service)cff->psnames; cmap->num_pairs = 0; diff --git a/src/cff/cffload.c b/src/cff/cffload.c index e50fcaa4d..2829ffcb4 100644 --- a/src/cff/cffload.c +++ b/src/cff/cffload.c @@ -1358,20 +1358,20 @@ static void - CFF_Done_FD_Select( CFF_FDSelect select, + CFF_Done_FD_Select( CFF_FDSelect fdselect, FT_Stream stream ) { - if ( select->data ) - FT_FRAME_RELEASE( select->data ); + if ( fdselect->data ) + FT_FRAME_RELEASE( fdselect->data ); - select->data_size = 0; - select->format = 0; - select->range_count = 0; + fdselect->data_size = 0; + fdselect->format = 0; + fdselect->range_count = 0; } static FT_Error - CFF_Load_FD_Select( CFF_FDSelect select, + CFF_Load_FD_Select( CFF_FDSelect fdselect, FT_UInt num_glyphs, FT_Stream stream, FT_ULong offset ) @@ -1385,23 +1385,23 @@ if ( FT_STREAM_SEEK( offset ) || FT_READ_BYTE( format ) ) goto Exit; - select->format = format; - select->cache_count = 0; /* clear cache */ + fdselect->format = format; + fdselect->cache_count = 0; /* clear cache */ switch ( format ) { case 0: /* format 0, that's simple */ - select->data_size = num_glyphs; + fdselect->data_size = num_glyphs; goto Load_Data; case 3: /* format 3, a tad more complex */ if ( FT_READ_USHORT( num_ranges ) ) goto Exit; - select->data_size = num_ranges * 3 + 2; + fdselect->data_size = num_ranges * 3 + 2; Load_Data: - if ( FT_FRAME_EXTRACT( select->data_size, select->data ) ) + if ( FT_FRAME_EXTRACT( fdselect->data_size, fdselect->data ) ) goto Exit; break; @@ -1415,30 +1415,31 @@ FT_LOCAL_DEF( FT_Byte ) - cff_fd_select_get( CFF_FDSelect select, + cff_fd_select_get( CFF_FDSelect fdselect, FT_UInt glyph_index ) { FT_Byte fd = 0; - switch ( select->format ) + switch ( fdselect->format ) { case 0: - fd = select->data[glyph_index]; + fd = fdselect->data[glyph_index]; break; case 3: /* first, compare to cache */ - if ( (FT_UInt)(glyph_index-select->cache_first) < select->cache_count ) + if ( (FT_UInt)( glyph_index - fdselect->cache_first ) < + fdselect->cache_count ) { - fd = select->cache_fd; + fd = fdselect->cache_fd; break; } /* then, lookup the ranges array */ { - FT_Byte* p = select->data; - FT_Byte* p_limit = p + select->data_size; + FT_Byte* p = fdselect->data; + FT_Byte* p_limit = p + fdselect->data_size; FT_Byte fd2; FT_UInt first, limit; @@ -1457,9 +1458,9 @@ fd = fd2; /* update cache */ - select->cache_first = first; - select->cache_count = limit-first; - select->cache_fd = fd2; + fdselect->cache_first = first; + fdselect->cache_count = limit-first; + fdselect->cache_fd = fd2; break; } first = limit; diff --git a/src/pfr/pfrgload.c b/src/pfr/pfrgload.c index a914707a2..192f0e045 100644 --- a/src/pfr/pfrgload.c +++ b/src/pfr/pfrgload.c @@ -409,7 +409,7 @@ cur = pos; for ( n = 0; n < args_count; n++ ) { - FT_Int index, delta; + FT_Int idx, delta; /* read the X argument */ @@ -417,9 +417,9 @@ { case 0: /* 8-bit index */ PFR_CHECK( 1 ); - index = PFR_NEXT_BYTE( p ); - cur->x = glyph->x_control[index]; - FT_TRACE7(( " cx#%d", index )); + idx = PFR_NEXT_BYTE( p ); + cur->x = glyph->x_control[idx]; + FT_TRACE7(( " cx#%d", idx )); break; case 1: /* 16-bit value */ @@ -445,9 +445,9 @@ { case 0: /* 8-bit index */ PFR_CHECK( 1 ); - index = PFR_NEXT_BYTE( p ); - cur->y = glyph->y_control[index]; - FT_TRACE7(( " cy#%d", index )); + idx = PFR_NEXT_BYTE( p ); + cur->y = glyph->y_control[idx]; + FT_TRACE7(( " cy#%d", idx )); break; case 1: /* 16-bit absolute value */ diff --git a/src/pfr/pfrload.c b/src/pfr/pfrload.c index 32c2f8279..e6154bb0d 100644 --- a/src/pfr/pfrload.c +++ b/src/pfr/pfrload.c @@ -220,7 +220,7 @@ FT_LOCAL_DEF( FT_Error ) pfr_log_font_load( PFR_LogFont log_font, FT_Stream stream, - FT_UInt index, + FT_UInt idx, FT_UInt32 section_offset, FT_Bool size_increment ) { @@ -235,10 +235,10 @@ FT_READ_USHORT( num_log_fonts ) ) goto Exit; - if ( index >= num_log_fonts ) + if ( idx >= num_log_fonts ) return PFR_Err_Invalid_Argument; - if ( FT_STREAM_SKIP( index * 5 ) || + if ( FT_STREAM_SKIP( idx * 5 ) || FT_READ_USHORT( size ) || FT_READ_UOFF3 ( offset ) ) goto Exit; diff --git a/src/raster/ftraster.c b/src/raster/ftraster.c index b14994766..a897b287d 100644 --- a/src/raster/ftraster.c +++ b/src/raster/ftraster.c @@ -2652,13 +2652,13 @@ Long x1, x2, xs, e1, e2; - TProfileList wait; + TProfileList waiting; TProfileList draw_left, draw_right; /* Init empty linked lists */ - Init_Linked( &wait ); + Init_Linked( &waiting ); Init_Linked( &draw_left ); Init_Linked( &draw_right ); @@ -2680,7 +2680,7 @@ if ( max_Y < top ) max_Y = top; P->X = 0; - InsNew( &wait, P ); + InsNew( &waiting, P ); P = Q; } @@ -2698,7 +2698,7 @@ /* Then compute the distance of each profile from min_Y */ - P = wait; + P = waiting; while ( P ) { @@ -2717,9 +2717,9 @@ while ( ras.numTurns > 0 ) { - /* look in the wait list for new activations */ + /* look in the waiting list for new activations */ - P = wait; + P = waiting; while ( P ) { @@ -2727,7 +2727,7 @@ P->countL -= y_height; if ( P->countL == 0 ) { - DelOld( &wait, P ); + DelOld( &waiting, P ); switch ( P->flow ) { diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index 3da48bbd4..a6c731f7c 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -434,8 +434,8 @@ /* do we have outlines in there? */ #ifdef FT_CONFIG_OPTION_INCREMENTAL has_outline = FT_BOOL( face->root.internal->incremental_interface != 0 || - TT_LookUp_Table( face, TTAG_glyf ) != 0 || - TT_LookUp_Table( face, TTAG_CFF ) != 0 ); + TT_LookUp_Table( face, TTAG_glyf ) != 0 || + TT_LookUp_Table( face, TTAG_CFF ) != 0 ); #else has_outline = FT_BOOL( TT_LookUp_Table( face, TTAG_glyf ) != 0 || TT_LookUp_Table( face, TTAG_CFF ) != 0 ); diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 5757f8cee..efbe88ec4 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -756,9 +756,9 @@ FT_Bool opened_frame = 0; #ifdef FT_CONFIG_OPTION_INCREMENTAL - struct FT_StreamRec_ inc_stream; - FT_Data glyph_data; - FT_Bool glyph_data_loaded = 0; + struct FT_StreamRec_ inc_stream; + FT_Data glyph_data; + FT_Bool glyph_data_loaded = 0; #endif @@ -852,13 +852,15 @@ goto Exit; glyph_data_loaded = 1; - offset = 0; - count = glyph_data.length; + offset = 0; + count = glyph_data.length; + FT_MEM_ZERO( &inc_stream, sizeof ( inc_stream ) ); - FT_Stream_OpenMemory( &inc_stream, glyph_data.pointer, glyph_data.length ); + FT_Stream_OpenMemory( &inc_stream, + glyph_data.pointer, glyph_data.length ); + loader->stream = &inc_stream; } - else #endif /* FT_CONFIG_OPTION_INCREMENTAL */ @@ -1266,10 +1268,10 @@ Exit: #ifdef FT_CONFIG_OPTION_INCREMENTAL - if (glyph_data_loaded) - face->root.internal->incremental_interface->funcs->free_glyph_data( - face->root.internal->incremental_interface->object, - &glyph_data ); + if ( glyph_data_loaded ) + face->root.internal->incremental_interface->funcs->free_glyph_data( + face->root.internal->incremental_interface->object, + &glyph_data ); #endif return error; diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c index 8eaabf5f5..0625caf75 100644 --- a/src/type1/t1gload.c +++ b/src/type1/t1gload.c @@ -121,19 +121,21 @@ T1_Parse_Glyph( T1_Decoder decoder, FT_UInt glyph_index ) { - FT_Data glyph_data; - FT_Error error = T1_Parse_Glyph_And_Get_Char_String( decoder, glyph_index, &glyph_data ); + FT_Data glyph_data; + FT_Error error = T1_Parse_Glyph_And_Get_Char_String( + decoder, glyph_index, &glyph_data ); + #ifdef FT_CONFIG_OPTION_INCREMENTAL - if ( !error) + if ( !error ) { - T1_Face face = (T1_Face)decoder->builder.face; + T1_Face face = (T1_Face)decoder->builder.face; if ( face->root.internal->incremental_interface ) - face->root.internal->incremental_interface->funcs->free_glyph_data( - face->root.internal->incremental_interface->object, - &glyph_data ); + face->root.internal->incremental_interface->funcs->free_glyph_data( + face->root.internal->incremental_interface->object, + &glyph_data ); } #endif @@ -225,7 +227,8 @@ FT_Matrix font_matrix; FT_Vector font_offset; FT_Data glyph_data; - FT_Bool glyph_data_loaded = 0; + FT_Bool glyph_data_loaded = 0; + if ( load_flags & FT_LOAD_NO_RECURSE ) load_flags |= FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING; @@ -264,7 +267,7 @@ &glyph_data ); if ( error ) goto Exit; - glyph_data_loaded = 1; + glyph_data_loaded = 1; font_matrix = decoder.font_matrix; font_offset = decoder.font_offset; @@ -394,11 +397,11 @@ if ( glyph_data_loaded && face->root.internal->incremental_interface ) { face->root.internal->incremental_interface->funcs->free_glyph_data( - face->root.internal->incremental_interface->object, - &glyph_data ); + face->root.internal->incremental_interface->object, + &glyph_data ); /* Set the control data to null - it is no longer available if */ - /* loaded incrementally. */ + /* loaded incrementally. */ glyph->root.control_data = 0; glyph->root.control_len = 0; } diff --git a/src/type1/t1load.c b/src/type1/t1load.c index 3b7c9d769..b9f8edb90 100644 --- a/src/type1/t1load.c +++ b/src/type1/t1load.c @@ -1712,7 +1712,7 @@ } #ifdef FT_CONFIG_OPTION_INCREMENTAL - if (!face->root.internal->incremental_interface) + if ( !face->root.internal->incremental_interface ) #endif if ( !loader.charstrings.init ) {