ScummVM API documentation
ftgloadr.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 /***************************************************************************/
23 /* */
24 /* ftgloadr.h */
25 /* */
26 /* The FreeType glyph loader (specification). */
27 /* */
28 /* Copyright 2002 by */
29 /* David Turner, Robert Wilhelm, and Werner Lemberg */
30 /* */
31 /* This file is part of the FreeType project, and may only be used, */
32 /* modified, and distributed under the terms of the FreeType project */
33 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
34 /* this file you indicate that you have read the license and */
35 /* understand and accept it fully. */
36 /* */
37 /***************************************************************************/
38 
39 
40 #ifndef AGS_LIB_FREETYPE_FTGLOADR_H
41 #define AGS_LIB_FREETYPE_FTGLOADR_H
42 
43 
44 #include "graphics/fonts/freetype.h"
45 
46 namespace AGS3 {
47 namespace FreeType213 {
48 
49 
50 typedef struct FT_GlyphLoaderRec_ *FT_GlyphLoader;
51 
52 #define FT_SUBGLYPH_FLAG_ARGS_ARE_WORDS 1
53 #define FT_SUBGLYPH_FLAG_ARGS_ARE_XY_VALUES 2
54 #define FT_SUBGLYPH_FLAG_ROUND_XY_TO_GRID 4
55 #define FT_SUBGLYPH_FLAG_SCALE 8
56 #define FT_SUBGLYPH_FLAG_XY_SCALE 0x40
57 #define FT_SUBGLYPH_FLAG_2X2 0x80
58 #define FT_SUBGLYPH_FLAG_USE_MY_METRICS 0x200
59 
60 
61 enum {
62  FT_GLYPH_OWN_BITMAP = 1
63 };
64 
65 
66 typedef struct FT_SubGlyphRec_ {
67  FT_Int index;
68  FT_UShort flags;
69  FT_Int arg1;
70  FT_Int arg2;
71  FT_Matrix transform;
72 
74 
76 
77 typedef struct FT_GlyphLoadRec_ {
78  FT_Outline outline; /* outline */
79  FT_Vector *extra_points; /* extra points table */
80  FT_UInt num_subglyphs; /* number of subglyphs */
81  FT_SubGlyph subglyphs; /* subglyphs */
82 
84 
85 
86 typedef struct FT_GlyphLoaderRec_ {
87  FT_Memory memory;
88  FT_UInt max_points;
89  FT_UInt max_contours;
90  FT_UInt max_subglyphs;
91  FT_Bool use_extra;
92 
93  FT_GlyphLoadRec base;
94  FT_GlyphLoadRec current;
95 
96  void* other; /* for possible future extension? */
97 
99 
100 
101 /* create new empty glyph loader */
102 FT_Error FT_GlyphLoader_New(FT_Memory memory, FT_GlyphLoader *aloader);
103 
104 /* add an extra points table to a glyph loader */
105 FT_Error FT_GlyphLoader_CreateExtra(FT_GlyphLoader loader);
106 
107 /* destroy a glyph loader */
108 void FT_GlyphLoader_Done(FT_GlyphLoader loader);
109 
110 /* reset a glyph loader (frees everything int it) */
111 void FT_GlyphLoader_Reset(FT_GlyphLoader loader);
112 
113 /* rewind a glyph loader */
114 void FT_GlyphLoader_Rewind(FT_GlyphLoader loader);
115 
116 /* check that there is enough room to add 'n_points' and 'n_contours' */
117 /* to the glyph loader */
118 FT_Error FT_GlyphLoader_CheckPoints(FT_GlyphLoader loader, FT_UInt n_points, FT_UInt n_contours);
119 
120 /* check that there is enough room to add 'n_subs' sub-glyphs to */
121 /* a glyph loader */
122 FT_Error FT_GlyphLoader_CheckSubGlyphs(FT_GlyphLoader loader, FT_UInt n_subs);
123 
124 /* prepare a glyph loader, i.e. empty the current glyph */
125 void FT_GlyphLoader_Prepare(FT_GlyphLoader loader);
126 
127 /* add the current glyph to the base glyph */
128 void FT_GlyphLoader_Add(FT_GlyphLoader loader);
129 
130 /* copy points from one glyph loader to another */
131 FT_Error FT_GlyphLoader_CopyPoints(FT_GlyphLoader target, FT_GlyphLoader source);
132 
133 
134 } // End of namespace FreeType213
135 } // End of namespace AGS3
136 
137 #endif /* AGS_LIB_FREETYPE_FTGLOADR_H */
Definition: ftgloadr.h:86
Definition: ftgloadr.h:66
Definition: ags.h:40
Definition: ftgloadr.h:77