Commit 76c7bd0d authored by David Turner's avatar David Turner
Browse files

* moving all code related to glyph loaders to "internal/ftgloadr.h"

        and "src/base/ftgloadr.c".

        Note also that the type "FT_GlyphLoader" is now a pointer to the
        structure "FT_GlyphLoaderRec"..
parent 6c0fedce
2002-02-24 David Turner <david@freetype.org>
* moving all code related to glyph loaders to "internal/ftgloadr.h"
and "src/base/ftgloadr.c".
Note also that the type "FT_GlyphLoader" is now a pointer to the
structure "FT_GlyphLoaderRec"..
* renaming "ft_glyph_own_bitmap" into "FT_GLYPH_OWN_BITMAP"
2002-02-22 Werner Lemberg <wl@gnu.org>
......
......@@ -32,7 +32,7 @@ FT_BEGIN_HEADER
/* The glyph loader implementation is not part of the high-level API, */
/* hence the forward structure declaration. */
/* */
typedef struct FT_GlyphLoader_ FT_GlyphLoader ;
typedef struct FT_GlyphLoaderRec_* FT_GlyphLoader ;
#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
......@@ -89,7 +89,7 @@ FT_BEGIN_HEADER
/* create new empty glyph loader */
FT_BASE( FT_Error )
FT_GlyphLoader_New( FT_Memory memory,
FT_GlyphLoader *aloader );
FT_GlyphLoader *aloader );
/* add an extra points table to a glyph loader */
FT_BASE( FT_Error )
......
......@@ -31,6 +31,7 @@
#include FT_RENDER_H
#include FT_SIZES_H
#include FT_INTERNAL_MEMORY_H
#include FT_INTERNAL_GLYPH_LOADER_H
#include FT_INTERNAL_DRIVER_H
#include FT_INTERNAL_AUTOHINT_H
......@@ -73,22 +74,6 @@ FT_BEGIN_HEADER
#endif
/*************************************************************************/
/* */
/* <Struct> */
/* FT_GlyphLoader */
/* */
/* <Description> */
/* The glyph loader is an internal object used to load several glyphs */
/* together (for example, in the case of composites). */
/* */
/* <Note> */
/* The glyph loader implementation is not part of the high-level API, */
/* hence the forward structure declaration. */
/* */
typedef struct FT_GlyphLoader_ FT_GlyphLoader;
/*************************************************************************/
/* */
/* <Struct> */
......@@ -171,12 +156,12 @@ FT_BEGIN_HEADER
/* */
typedef struct FT_Slot_InternalRec_
{
FT_GlyphLoader* loader;
FT_GlyphLoader loader;
FT_Bool glyph_transformed;
FT_Matrix glyph_matrix;
FT_Vector glyph_delta;
void* glyph_hints;
} FT_GlyphSlot_InternalRec;
......@@ -345,6 +330,8 @@ FT_BEGIN_HEADER
FT_Done_GlyphSlot( FT_GlyphSlot slot );
#if 0
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
......@@ -444,6 +431,7 @@ FT_BEGIN_HEADER
FT_GlyphLoader_Copy_Points( FT_GlyphLoader* target,
FT_GlyphLoader* source );
#endif
/*************************************************************************/
/*************************************************************************/
......@@ -533,7 +521,7 @@ FT_BEGIN_HEADER
FT_ListRec faces_list;
void* extensions;
FT_GlyphLoader* glyph_loader;
FT_GlyphLoader glyph_loader;
} FT_DriverRec;
......
......@@ -33,7 +33,7 @@
#define FT_INTERNAL_DRIVER_H <freetype/internal/ftdriver.h>
#define FT_INTERNAL_EXTEND_H <freetype/internal/ftextend.h>
#define FT_INTERNAL_TRACE_H <freetype/internal/fttrace.h>
#define FT_INTERNAL_GLYPH_LOADER_H <freetype/internal/ftgloadr.h>
#define FT_INTERNAL_SFNT_H <freetype/internal/sfnt.h>
#define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h>
......
......@@ -508,7 +508,7 @@ FT_BEGIN_HEADER
FT_Memory memory;
FT_Face face;
FT_GlyphSlot glyph;
FT_GlyphLoader* loader;
FT_GlyphLoader loader;
FT_Outline* base;
FT_Outline* current;
......@@ -535,7 +535,7 @@ FT_BEGIN_HEADER
void* hints_funcs; /* hinter-specific */
void* hints_globals; /* hinter-specific */
T1_Builder_Funcs funcs;
T1_Builder_Funcs funcs;
};
......
......@@ -1615,7 +1615,7 @@ FT_BEGIN_HEADER
FT_Face face;
FT_Size size;
FT_GlyphSlot glyph;
FT_GlyphLoader* gloader;
FT_GlyphLoader gloader;
FT_ULong load_flags;
FT_UInt glyph_index;
......
......@@ -351,7 +351,7 @@
/* */
FT_LOCAL_DEF void
ah_outline_save( AH_Outline* outline,
AH_Loader* gloader )
AH_Loader gloader )
{
AH_Point* point = outline->points;
AH_Point* point_limit = point + outline->num_points;
......
......@@ -79,7 +79,7 @@ FT_BEGIN_HEADER
FT_LOCAL void
ah_outline_save( AH_Outline* outline,
AH_Loader* loader );
AH_Loader loader );
FT_LOCAL void
ah_outline_done( AH_Outline* outline );
......
......@@ -388,7 +388,7 @@
ah_debug_disable_vert = no_vert_edges;
#else
FT_UNUSED( no_horz_edges );
FT_UNUSED( no_vert_edges );
FT_UNUSED( no_vert_edges );
#endif
/* AH_Interpolate_Blue_Edges( hinter ); -- doesn't seem to help */
/* reduce the problem of the disappearing eye in the `e' of Times... */
......@@ -1011,7 +1011,7 @@
FT_Fixed y_scale = face->size->metrics.y_scale;
FT_Error error;
AH_Outline* outline = hinter->glyph;
AH_Loader* gloader = hinter->loader;
AH_Loader gloader = hinter->loader;
FT_Bool no_horz_hints = FT_BOOL(
( load_flags & AH_HINT_NO_HORZ_EDGES ) != 0 );
FT_Bool no_vert_hints = FT_BOOL(
......
......@@ -41,72 +41,7 @@
FT_BEGIN_HEADER
#ifdef _STANDALONE_
typedef struct AH_GlyphLoad_
{
FT_Outline outline; /* outline */
FT_UInt num_subglyphs; /* number of subglyphs */
FT_SubGlyph* subglyphs; /* subglyphs */
FT_Vector* extra_points; /* extra points table */
} AH_GlyphLoad;
struct AH_GlyphLoader_
{
FT_Memory memory;
FT_UInt max_points;
FT_UInt max_contours;
FT_UInt max_subglyphs;
FT_Bool use_extra;
AH_GlyphLoad base;
AH_GlyphLoad current;
void* other; /* for possible future extensions */
};
FT_LOCAL FT_Error
AH_GlyphLoader_New( FT_Memory memory,
AH_GlyphLoader** aloader );
FT_LOCAL FT_Error
AH_GlyphLoader_Create_Extra( AH_GlyphLoader* loader );
FT_LOCAL void
AH_GlyphLoader_Done( AH_GlyphLoader* loader );
FT_LOCAL void
AH_GlyphLoader_Reset( AH_GlyphLoader* loader );
FT_LOCAL void
AH_GlyphLoader_Rewind( AH_GlyphLoader* loader );
FT_LOCAL FT_Error
AH_GlyphLoader_Check_Points( AH_GlyphLoader* loader,
FT_UInt n_points,
FT_UInt n_contours );
FT_LOCAL FT_Error
AH_GlyphLoader_Check_Subglyphs( AH_GlyphLoader* loader,
FT_UInt n_subs );
FT_LOCAL void
AH_GlyphLoader_Prepare( AH_GlyphLoader* loader );
FT_LOCAL void
AH_GlyphLoader_Add( AH_GlyphLoader* loader );
FT_LOCAL FT_Error
AH_GlyphLoader_Copy_Points( AH_GlyphLoader* target,
FT_GlyphLoader* source );
#else /* _STANDALONE */
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_GLYPH_LOADER_H
#define AH_Load FT_GlyphLoad
#define AH_Loader FT_GlyphLoader
......@@ -122,8 +57,6 @@ FT_BEGIN_HEADER
#define ah_loader_add FT_GlyphLoader_Add
#define ah_loader_copy_points FT_GlyphLoader_Copy_Points
#endif /* _STANDALONE_ */
FT_END_HEADER
......
......@@ -477,7 +477,7 @@ FT_BEGIN_HEADER
AH_Outline* glyph;
AH_Loader* loader;
AH_Loader loader;
FT_Vector pp1;
FT_Vector pp2;
......
......@@ -10,7 +10,7 @@ SubDirHdrs [ FT2_SubDir src base ] ;
if $(FT2_MULTI)
{
_sources = ftcalc ftlist ftobjs ftstream ftoutln ftnames fttrigon
_sources = ftcalc ftgloadr ftlist ftobjs ftstream ftoutln ftnames fttrigon
ftdbgmem ;
}
else
......
......@@ -22,6 +22,7 @@
#include "ftcalc.c"
#include "fttrigon.c"
#include "ftgloadr.c"
#include "ftobjs.c"
#include "ftstream.c"
#include "ftlist.c"
......@@ -29,8 +30,4 @@
#include "ftnames.c"
#include "ftdbgmem.c"
#if 0
#include "ftextend.c"
#endif
/* END */
#include <ft2build.h>
#include FT_INTERNAL_GLYPH_LOADER_H
#include FT_INTERNAL_MEMORY_H
#undef FT_COMPONENT
#define FT_COMPONENT trace_gloader
......@@ -65,8 +66,8 @@
FT_BASE_DEF( void )
FT_GlyphLoader_Rewind( FT_GlyphLoader loader )
{
FT_GlyphLoad* base = &loader->base;
FT_GlyphLoad* current = &loader->current;
FT_GlyphLoad base = &loader->base;
FT_GlyphLoad current = &loader->current;
base->outline.n_points = 0;
......@@ -154,8 +155,8 @@
static void
FT_GlyphLoader_Adjust_Subglyphs( FT_GlyphLoader loader )
{
FT_GlyphLoad* base = &loader->base;
FT_GlyphLoad* current = &loader->current;
FT_GlyphLoad base = &loader->base;
FT_GlyphLoad current = &loader->current;
current->subglyphs = base->subglyphs + base->num_subglyphs;
......@@ -235,8 +236,8 @@
FT_Error error = FT_Err_Ok;
FT_UInt new_max, old_max;
FT_GlyphLoad* base = &loader->base;
FT_GlyphLoad* current = &loader->current;
FT_GlyphLoad base = &loader->base;
FT_GlyphLoad current = &loader->current;
new_max = base->num_subglyphs + current->num_subglyphs + n_subs;
......@@ -261,7 +262,7 @@
FT_BASE_DEF( void )
FT_GlyphLoader_Prepare( FT_GlyphLoader loader )
{
FT_GlyphLoad* current = &loader->current;
FT_GlyphLoad current = &loader->current;
current->outline.n_points = 0;
......@@ -277,8 +278,8 @@
FT_BASE_DEF( void )
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;
......
......@@ -262,6 +262,8 @@
#define FT_COMPONENT trace_objs
#if 0
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/
......@@ -598,6 +600,7 @@
return error;
}
#endif
/*************************************************************************/
/*************************************************************************/
......
......@@ -34,6 +34,7 @@ BASE_COMPILE := $(FT_COMPILE) $I$(SRC_)base
#
BASE_SRC := $(BASE_)ftcalc.c \
$(BASE_)fttrigon.c \
$(BASE_)ftgloadr.c \
$(BASE_)ftlist.c \
$(BASE_)ftobjs.c \
$(BASE_)ftstream.c \
......
......@@ -238,7 +238,7 @@
if ( glyph )
{
FT_GlyphLoader* loader = glyph->root.internal->loader;
FT_GlyphLoader loader = glyph->root.internal->loader;
builder->loader = loader;
......@@ -248,7 +248,7 @@
builder->hints_globals = 0;
builder->hints_funcs = 0;
if ( hinting && size )
{
builder->hints_globals = size->internal;
......@@ -588,7 +588,7 @@
if ( decoder->builder.no_recurse )
{
FT_GlyphSlot glyph = (FT_GlyphSlot)decoder->builder.glyph;
FT_GlyphLoader* loader = glyph->internal->loader;
FT_GlyphLoader loader = glyph->internal->loader;
FT_SubGlyph* subg;
......@@ -1091,7 +1091,7 @@
case cff_op_hintmask:
case cff_op_cntrmask:
FT_TRACE4(( op == cff_op_hintmask ? " hintmask" : " cntrmask" ));
/* implement vstem when needed -- */
/* the specification doesn't say it, but this also works */
/* with the 'cntrmask' operator */
......@@ -1103,7 +1103,7 @@
0,
num_args / 2,
args );
decoder->num_hints += num_args / 2;
}
......
......@@ -89,7 +89,7 @@ FT_BEGIN_HEADER
FT_Memory memory;
TT_Face face;
CFF_GlyphSlot glyph;
FT_GlyphLoader* loader;
FT_GlyphLoader loader;
FT_Outline* base;
FT_Outline* current;
......
......@@ -166,7 +166,7 @@
FT_Error error;
FT_Offset new_size = table->capacity;
FT_Long in_offset;
in_offset = (FT_Long)((FT_Byte*)object - table->block);
if ( (FT_ULong)in_offset >= table->capacity )
......@@ -178,7 +178,7 @@
error = reallocate_t1_table( table, new_size );
if ( error )
return error;
if ( in_offset >= 0 )
object = table->block + in_offset;
}
......@@ -1085,7 +1085,7 @@
if ( glyph )
{
FT_GlyphLoader* loader = glyph->internal->loader;
FT_GlyphLoader loader = glyph->internal->loader;
builder->loader = loader;
......@@ -1095,7 +1095,7 @@
builder->hints_globals = size->internal;
builder->hints_funcs = 0;
if ( hinting )
builder->hints_funcs = glyph->internal->glyph_hints;
}
......
......@@ -218,7 +218,7 @@
if ( decoder->builder.no_recurse )
{
FT_GlyphSlot glyph = (FT_GlyphSlot)decoder->builder.glyph;
FT_GlyphLoader* loader = glyph->internal->loader;
FT_GlyphLoader loader = glyph->internal->loader;
FT_SubGlyph* subg;
......@@ -290,7 +290,7 @@
decoder->builder.advance = advance;
/* XXX: old code doesn't work with postscript hinter */
#if 0
#if 0
/* Finally, move the accent */
if ( decoder->builder.load_points )
{
......@@ -302,7 +302,7 @@
FT_Outline_Translate( &dummy, adx - asb, ady );
}
#else
#else
decoder->builder.pos_x = 0;
decoder->builder.pos_y = 0;
#endif
......@@ -638,10 +638,10 @@
goto Syntax_Error;
}
ip += 2;
if ( hinter )
hinter->reset( hinter->hints, builder->current->n_points );
break;
case 12:
......@@ -736,19 +736,19 @@
FT_TRACE4(( " endchar" ));
close_contour( builder );
/* close hints recording session */
if ( hinter )
{
if (hinter->close( hinter->hints, builder->current->n_points ))
goto Syntax_Error;
/* apply hints to the loaded glyph outline now */
hinter->apply( hinter->hints,
builder->current,
(PSH_Globals)builder->hints_globals );
}
/* add current outline to the glyph slot */
FT_GlyphLoader_Add( builder->loader );
......@@ -1016,7 +1016,7 @@
case op_hstem:
FT_TRACE4(( " hstem" ));
/* record horizontal hint */
if ( hinter )
{
......@@ -1032,7 +1032,7 @@
/* record horizontal counter-controlled hints */
if ( hinter )
hinter->stem3( hinter->hints, 1, top );
break;
case op_vstem:
......@@ -1054,7 +1054,7 @@
if ( hinter )
{
FT_Pos dx = orig_x;
top[0] += dx;
top[2] += dx;
top[4] += dx;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment