/**************************************************************************** * * ftgloadr.c * * The FreeType glyph loader (body). * * Copyright (C) 2002-2023 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 <freetype/internal/ftdebug.h> #include <freetype/internal/ftgloadr.h> #include <freetype/internal/ftmemory.h> #include <freetype/internal/ftobjs.h> #undef FT_COMPONENT #define FT_COMPONENT … /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /***** *****/ /***** *****/ /***** G L Y P H L O A D E R *****/ /***** *****/ /***** *****/ /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ /************************************************************************** * * The glyph loader is a simple object which is used to load a set of * glyphs easily. It is critical for the correct loading of composites. * * Ideally, one can see it as a stack of abstract `glyph' objects. * * loader.base Is really the bottom of the stack. It describes a * single glyph image made of the juxtaposition of * several glyphs (those `in the stack'). * * loader.current Describes the top of the stack, on which a new * glyph can be loaded. * * Rewind Clears the stack. * Prepare Set up `loader.current' for addition of a new glyph * image. * Add Add the `current' glyph image to the `base' one, * and prepare for another one. * * The glyph loader is now a base object. Each driver used to * re-implement it in one way or the other, which wasted code and * energy. * */ /* create a new glyph loader */ FT_BASE_DEF( FT_Error ) FT_GlyphLoader_New( FT_Memory memory, FT_GlyphLoader *aloader ) { … } /* rewind the glyph loader - reset counters to 0 */ FT_BASE_DEF( void ) FT_GlyphLoader_Rewind( FT_GlyphLoader loader ) { … } /* reset glyph loader, free all allocated tables, */ /* and start from zero */ FT_BASE_DEF( void ) FT_GlyphLoader_Reset( FT_GlyphLoader loader ) { … } /* delete a glyph loader */ FT_BASE_DEF( void ) FT_GlyphLoader_Done( FT_GlyphLoader loader ) { … } /* re-adjust the `current' outline fields */ static void FT_GlyphLoader_Adjust_Points( FT_GlyphLoader loader ) { … } FT_BASE_DEF( FT_Error ) FT_GlyphLoader_CreateExtra( FT_GlyphLoader loader ) { … } /* re-adjust the `current' subglyphs field */ static void FT_GlyphLoader_Adjust_Subglyphs( FT_GlyphLoader loader ) { … } /* Ensure that we can add `n_points' and `n_contours' to our glyph. */ /* This function reallocates its outline tables if necessary. Note that */ /* it 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 ) { … } /* Ensure that we can add `n_subglyphs' to our glyph. this function */ /* reallocates its subglyphs table if necessary. Note that it DOES */ /* NOT change the number of subglyphs within the loader! */ /* */ FT_BASE_DEF( FT_Error ) FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader, FT_UInt n_subs ) { … } /* 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 ) { … } /* add current glyph to the base image -- and prepare for another */ FT_BASE_DEF( void ) FT_GlyphLoader_Add( FT_GlyphLoader loader ) { … } /* END */