2002-03-30 00:23:28 +01:00
|
|
|
/***************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* ftgloadr.h */
|
|
|
|
/* */
|
|
|
|
/* The FreeType glyph loader (specification). */
|
|
|
|
/* */
|
2006-03-24 12:54:53 +01:00
|
|
|
/* Copyright 2002, 2003, 2005, 2006 by */
|
2002-03-30 00:23:28 +01:00
|
|
|
/* 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 __FTGLOADR_H__
|
|
|
|
#define __FTGLOADR_H__
|
|
|
|
|
2002-02-22 18:57:35 +01:00
|
|
|
|
|
|
|
#include <ft2build.h>
|
|
|
|
#include FT_FREETYPE_H
|
|
|
|
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_BEGIN_HEADER
|
2002-02-22 18:57:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************/
|
|
|
|
/* */
|
|
|
|
/* <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. */
|
|
|
|
/* */
|
2002-02-24 03:59:24 +01:00
|
|
|
typedef struct FT_GlyphLoaderRec_* FT_GlyphLoader ;
|
2002-02-22 18:57:35 +01:00
|
|
|
|
|
|
|
|
2006-03-24 12:54:53 +01:00
|
|
|
#if 0 /* moved to freetype.h in version 2.2 */
|
2002-02-22 18:57:35 +01:00
|
|
|
#define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
|
|
|
|
#define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
|
|
|
|
#define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
|
|
|
|
#define FT_SUBGLYPH_FLAG_SCALE 8
|
|
|
|
#define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
|
|
|
|
#define FT_SUBGLYPH_FLAG_2X2 0x80
|
|
|
|
#define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
|
2006-03-23 21:58:20 +01:00
|
|
|
#endif
|
2002-02-22 18:57:35 +01:00
|
|
|
|
2006-03-24 12:54:53 +01:00
|
|
|
|
2002-03-14 13:56:35 +01:00
|
|
|
typedef struct FT_SubGlyphRec_
|
2002-02-22 18:57:35 +01:00
|
|
|
{
|
|
|
|
FT_Int index;
|
|
|
|
FT_UShort flags;
|
|
|
|
FT_Int arg1;
|
|
|
|
FT_Int arg2;
|
|
|
|
FT_Matrix transform;
|
2005-10-28 18:14:14 +02:00
|
|
|
|
2002-03-14 13:56:35 +01:00
|
|
|
} FT_SubGlyphRec;
|
2002-02-22 18:57:35 +01:00
|
|
|
|
|
|
|
|
|
|
|
typedef struct FT_GlyphLoadRec_
|
|
|
|
{
|
2008-06-22 15:40:08 +02:00
|
|
|
FT_Outline outline; /* outline */
|
|
|
|
FT_Vector* extra_points; /* extra points table */
|
2006-08-16 18:50:55 +02:00
|
|
|
FT_Vector* extra_points2; /* second extra points table */
|
2008-06-22 15:40:08 +02:00
|
|
|
FT_UInt num_subglyphs; /* number of subglyphs */
|
|
|
|
FT_SubGlyph subglyphs; /* subglyphs */
|
2002-02-22 18:57:35 +01:00
|
|
|
|
|
|
|
} FT_GlyphLoadRec, *FT_GlyphLoad;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct FT_GlyphLoaderRec_
|
|
|
|
{
|
|
|
|
FT_Memory memory;
|
|
|
|
FT_UInt max_points;
|
|
|
|
FT_UInt max_contours;
|
|
|
|
FT_UInt max_subglyphs;
|
|
|
|
FT_Bool use_extra;
|
|
|
|
|
|
|
|
FT_GlyphLoadRec base;
|
|
|
|
FT_GlyphLoadRec current;
|
|
|
|
|
|
|
|
void* other; /* for possible future extension? */
|
|
|
|
|
|
|
|
} FT_GlyphLoaderRec;
|
|
|
|
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* create new empty glyph loader */
|
2002-02-22 18:57:35 +01:00
|
|
|
FT_BASE( FT_Error )
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_GlyphLoader_New( FT_Memory memory,
|
|
|
|
FT_GlyphLoader *aloader );
|
2002-02-22 18:57:35 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* add an extra points table to a glyph loader */
|
2002-02-22 18:57:35 +01:00
|
|
|
FT_BASE( FT_Error )
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_GlyphLoader_CreateExtra( FT_GlyphLoader loader );
|
2002-02-22 18:57:35 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* destroy a glyph loader */
|
2002-02-22 18:57:35 +01:00
|
|
|
FT_BASE( void )
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_GlyphLoader_Done( FT_GlyphLoader loader );
|
2002-02-22 18:57:35 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* reset a glyph loader (frees everything int it) */
|
2002-02-22 18:57:35 +01:00
|
|
|
FT_BASE( void )
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_GlyphLoader_Reset( FT_GlyphLoader loader );
|
2002-02-22 18:57:35 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* rewind a glyph loader */
|
2002-02-22 18:57:35 +01:00
|
|
|
FT_BASE( void )
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_GlyphLoader_Rewind( FT_GlyphLoader loader );
|
2002-02-22 18:57:35 +01:00
|
|
|
|
2003-12-12 16:38:39 +01:00
|
|
|
/* check that there is enough space to add `n_points' and `n_contours' */
|
|
|
|
/* to the glyph loader */
|
2002-02-22 18:57:35 +01:00
|
|
|
FT_BASE( FT_Error )
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_GlyphLoader_CheckPoints( FT_GlyphLoader loader,
|
|
|
|
FT_UInt n_points,
|
|
|
|
FT_UInt n_contours );
|
2002-02-22 18:57:35 +01:00
|
|
|
|
2005-11-12 08:34:40 +01:00
|
|
|
|
2009-07-08 07:26:51 +02:00
|
|
|
#define FT_GLYPHLOADER_CHECK_P( _loader, _count ) \
|
|
|
|
( (_count) == 0 || ((_loader)->base.outline.n_points + \
|
|
|
|
(_loader)->current.outline.n_points + \
|
|
|
|
(unsigned long)(_count)) <= (_loader)->max_points )
|
|
|
|
|
|
|
|
#define FT_GLYPHLOADER_CHECK_C( _loader, _count ) \
|
|
|
|
( (_count) == 0 || ((_loader)->base.outline.n_contours + \
|
|
|
|
(_loader)->current.outline.n_contours + \
|
|
|
|
(unsigned long)(_count)) <= (_loader)->max_contours )
|
2005-10-28 18:14:14 +02:00
|
|
|
|
2005-11-12 08:34:40 +01:00
|
|
|
#define FT_GLYPHLOADER_CHECK_POINTS( _loader, _points,_contours ) \
|
|
|
|
( ( FT_GLYPHLOADER_CHECK_P( _loader, _points ) && \
|
|
|
|
FT_GLYPHLOADER_CHECK_C( _loader, _contours ) ) \
|
|
|
|
? 0 \
|
2005-10-28 18:14:14 +02:00
|
|
|
: FT_GlyphLoader_CheckPoints( (_loader), (_points), (_contours) ) )
|
|
|
|
|
2005-11-12 08:34:40 +01:00
|
|
|
|
2003-12-12 16:38:39 +01:00
|
|
|
/* check that there is enough space to add `n_subs' sub-glyphs to */
|
|
|
|
/* a glyph loader */
|
2002-02-22 18:57:35 +01:00
|
|
|
FT_BASE( FT_Error )
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_GlyphLoader_CheckSubGlyphs( FT_GlyphLoader loader,
|
|
|
|
FT_UInt n_subs );
|
2002-02-22 18:57:35 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* prepare a glyph loader, i.e. empty the current glyph */
|
2002-02-22 18:57:35 +01:00
|
|
|
FT_BASE( void )
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_GlyphLoader_Prepare( FT_GlyphLoader loader );
|
2002-02-22 18:57:35 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* add the current glyph to the base glyph */
|
2002-02-22 18:57:35 +01:00
|
|
|
FT_BASE( void )
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_GlyphLoader_Add( FT_GlyphLoader loader );
|
2002-02-22 18:57:35 +01:00
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
/* copy points from one glyph loader to another */
|
2002-02-22 18:57:35 +01:00
|
|
|
FT_BASE( FT_Error )
|
2002-03-30 00:23:28 +01:00
|
|
|
FT_GlyphLoader_CopyPoints( FT_GlyphLoader target,
|
|
|
|
FT_GlyphLoader source );
|
2002-02-22 18:57:35 +01:00
|
|
|
|
|
|
|
/* */
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
|
2002-02-22 18:57:35 +01:00
|
|
|
FT_END_HEADER
|
|
|
|
|
2002-03-30 00:23:28 +01:00
|
|
|
#endif /* __FTGLOADR_H__ */
|
|
|
|
|
|
|
|
|
|
|
|
/* END */
|