3 /* originally file `ftgloadr.h' (2011-Mar-28) from FreeType */
5 /* heavily modified 2011 by Werner Lemberg <wl@gnu.org> */
11 #include FT_FREETYPE_H
14 typedef struct TA_SubGlyphRec_
23 } TA_SubGlyphRec
, *TA_SubGlyph
;
26 typedef struct TA_GlyphLoadRec_
28 FT_Outline outline
; /* outline */
30 FT_Vector
* extra_points
; /* extra points table */
31 FT_Vector
* extra_points2
; /* second extra points table */
33 FT_UInt num_subglyphs
; /* number of subglyphs */
34 TA_SubGlyph subglyphs
; /* subglyphs */
35 } TA_GlyphLoadRec
, *TA_GlyphLoad
;
38 typedef struct TA_GlyphLoaderRec_
42 FT_UInt max_subglyphs
;
46 TA_GlyphLoadRec current
;
47 } TA_GlyphLoaderRec
, *TA_GlyphLoader
;
50 /* create new empty glyph loader */
52 TA_GlyphLoader_New(TA_GlyphLoader
*aloader
);
54 /* add an extra points table to a glyph loader */
56 TA_GlyphLoader_CreateExtra(TA_GlyphLoader loader
);
58 /* destroy a glyph loader */
60 TA_GlyphLoader_Done(TA_GlyphLoader loader
);
62 /* reset a glyph loader (frees everything int it) */
64 TA_GlyphLoader_Reset(TA_GlyphLoader loader
);
66 /* rewind a glyph loader */
68 TA_GlyphLoader_Rewind(TA_GlyphLoader loader
);
70 /* check that there is enough space to add */
71 /* `n_points' and `n_contours' to the glyph loader */
73 TA_GlyphLoader_CheckPoints(TA_GlyphLoader loader
,
78 #define TA_GLYPHLOADER_CHECK_P(_loader, _count) \
79 ((_count) == 0 || ((_loader)->base.outline.n_points \
80 + (_loader)->current.outline.n_points \
81 + (unsigned long)(_count)) <= (_loader)->max_points)
83 #define TA_GLYPHLOADER_CHECK_C(_loader, _count) \
84 ((_count) == 0 || ((_loader)->base.outline.n_contours \
85 + (_loader)->current.outline.n_contours \
86 + (unsigned long)(_count)) <= (_loader)->max_contours)
88 #define TA_GLYPHLOADER_CHECK_POINTS(_loader, _points, _contours) \
89 ((TA_GLYPHLOADER_CHECK_P(_loader, _points) \
90 && TA_GLYPHLOADER_CHECK_C(_loader, _contours)) \
92 : TA_GlyphLoader_CheckPoints((_loader), (_points), (_contours)))
95 /* check that there is enough space to add */
96 /* `n_subs' sub-glyphs to a glyph loader */
98 TA_GlyphLoader_CheckSubGlyphs(TA_GlyphLoader loader
,
101 /* prepare a glyph loader, i.e. empty the current glyph */
103 TA_GlyphLoader_Prepare(TA_GlyphLoader loader
);
105 /* add the current glyph to the base glyph */
107 TA_GlyphLoader_Add(TA_GlyphLoader loader
);
109 /* copy points from one glyph loader to another */
111 TA_GlyphLoader_CopyPoints(TA_GlyphLoader target
,
112 TA_GlyphLoader source
);
114 #endif /* __TAGLOADR_H__ */
116 /* end of tagloadr.h */