rev |
line source |
nuclear@0
|
1 /***************************************************************************/
|
nuclear@0
|
2 /* */
|
nuclear@0
|
3 /* ftrender.h */
|
nuclear@0
|
4 /* */
|
nuclear@0
|
5 /* FreeType renderer modules public interface (specification). */
|
nuclear@0
|
6 /* */
|
nuclear@0
|
7 /* Copyright 1996-2001, 2005, 2006, 2010 by */
|
nuclear@0
|
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
nuclear@0
|
9 /* */
|
nuclear@0
|
10 /* This file is part of the FreeType project, and may only be used, */
|
nuclear@0
|
11 /* modified, and distributed under the terms of the FreeType project */
|
nuclear@0
|
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
nuclear@0
|
13 /* this file you indicate that you have read the license and */
|
nuclear@0
|
14 /* understand and accept it fully. */
|
nuclear@0
|
15 /* */
|
nuclear@0
|
16 /***************************************************************************/
|
nuclear@0
|
17
|
nuclear@0
|
18
|
nuclear@0
|
19 #ifndef __FTRENDER_H__
|
nuclear@0
|
20 #define __FTRENDER_H__
|
nuclear@0
|
21
|
nuclear@0
|
22
|
nuclear@0
|
23 #include <ft2build.h>
|
nuclear@0
|
24 #include FT_MODULE_H
|
nuclear@0
|
25 #include FT_GLYPH_H
|
nuclear@0
|
26
|
nuclear@0
|
27
|
nuclear@0
|
28 FT_BEGIN_HEADER
|
nuclear@0
|
29
|
nuclear@0
|
30
|
nuclear@0
|
31 /*************************************************************************/
|
nuclear@0
|
32 /* */
|
nuclear@0
|
33 /* <Section> */
|
nuclear@0
|
34 /* module_management */
|
nuclear@0
|
35 /* */
|
nuclear@0
|
36 /*************************************************************************/
|
nuclear@0
|
37
|
nuclear@0
|
38
|
nuclear@0
|
39 /* create a new glyph object */
|
nuclear@0
|
40 typedef FT_Error
|
nuclear@0
|
41 (*FT_Glyph_InitFunc)( FT_Glyph glyph,
|
nuclear@0
|
42 FT_GlyphSlot slot );
|
nuclear@0
|
43
|
nuclear@0
|
44 /* destroys a given glyph object */
|
nuclear@0
|
45 typedef void
|
nuclear@0
|
46 (*FT_Glyph_DoneFunc)( FT_Glyph glyph );
|
nuclear@0
|
47
|
nuclear@0
|
48 typedef void
|
nuclear@0
|
49 (*FT_Glyph_TransformFunc)( FT_Glyph glyph,
|
nuclear@0
|
50 const FT_Matrix* matrix,
|
nuclear@0
|
51 const FT_Vector* delta );
|
nuclear@0
|
52
|
nuclear@0
|
53 typedef void
|
nuclear@0
|
54 (*FT_Glyph_GetBBoxFunc)( FT_Glyph glyph,
|
nuclear@0
|
55 FT_BBox* abbox );
|
nuclear@0
|
56
|
nuclear@0
|
57 typedef FT_Error
|
nuclear@0
|
58 (*FT_Glyph_CopyFunc)( FT_Glyph source,
|
nuclear@0
|
59 FT_Glyph target );
|
nuclear@0
|
60
|
nuclear@0
|
61 typedef FT_Error
|
nuclear@0
|
62 (*FT_Glyph_PrepareFunc)( FT_Glyph glyph,
|
nuclear@0
|
63 FT_GlyphSlot slot );
|
nuclear@0
|
64
|
nuclear@0
|
65 /* deprecated */
|
nuclear@0
|
66 #define FT_Glyph_Init_Func FT_Glyph_InitFunc
|
nuclear@0
|
67 #define FT_Glyph_Done_Func FT_Glyph_DoneFunc
|
nuclear@0
|
68 #define FT_Glyph_Transform_Func FT_Glyph_TransformFunc
|
nuclear@0
|
69 #define FT_Glyph_BBox_Func FT_Glyph_GetBBoxFunc
|
nuclear@0
|
70 #define FT_Glyph_Copy_Func FT_Glyph_CopyFunc
|
nuclear@0
|
71 #define FT_Glyph_Prepare_Func FT_Glyph_PrepareFunc
|
nuclear@0
|
72
|
nuclear@0
|
73
|
nuclear@0
|
74 struct FT_Glyph_Class_
|
nuclear@0
|
75 {
|
nuclear@0
|
76 FT_Long glyph_size;
|
nuclear@0
|
77 FT_Glyph_Format glyph_format;
|
nuclear@0
|
78 FT_Glyph_InitFunc glyph_init;
|
nuclear@0
|
79 FT_Glyph_DoneFunc glyph_done;
|
nuclear@0
|
80 FT_Glyph_CopyFunc glyph_copy;
|
nuclear@0
|
81 FT_Glyph_TransformFunc glyph_transform;
|
nuclear@0
|
82 FT_Glyph_GetBBoxFunc glyph_bbox;
|
nuclear@0
|
83 FT_Glyph_PrepareFunc glyph_prepare;
|
nuclear@0
|
84 };
|
nuclear@0
|
85
|
nuclear@0
|
86
|
nuclear@0
|
87 typedef FT_Error
|
nuclear@0
|
88 (*FT_Renderer_RenderFunc)( FT_Renderer renderer,
|
nuclear@0
|
89 FT_GlyphSlot slot,
|
nuclear@0
|
90 FT_UInt mode,
|
nuclear@0
|
91 const FT_Vector* origin );
|
nuclear@0
|
92
|
nuclear@0
|
93 typedef FT_Error
|
nuclear@0
|
94 (*FT_Renderer_TransformFunc)( FT_Renderer renderer,
|
nuclear@0
|
95 FT_GlyphSlot slot,
|
nuclear@0
|
96 const FT_Matrix* matrix,
|
nuclear@0
|
97 const FT_Vector* delta );
|
nuclear@0
|
98
|
nuclear@0
|
99
|
nuclear@0
|
100 typedef void
|
nuclear@0
|
101 (*FT_Renderer_GetCBoxFunc)( FT_Renderer renderer,
|
nuclear@0
|
102 FT_GlyphSlot slot,
|
nuclear@0
|
103 FT_BBox* cbox );
|
nuclear@0
|
104
|
nuclear@0
|
105
|
nuclear@0
|
106 typedef FT_Error
|
nuclear@0
|
107 (*FT_Renderer_SetModeFunc)( FT_Renderer renderer,
|
nuclear@0
|
108 FT_ULong mode_tag,
|
nuclear@0
|
109 FT_Pointer mode_ptr );
|
nuclear@0
|
110
|
nuclear@0
|
111 /* deprecated identifiers */
|
nuclear@0
|
112 #define FTRenderer_render FT_Renderer_RenderFunc
|
nuclear@0
|
113 #define FTRenderer_transform FT_Renderer_TransformFunc
|
nuclear@0
|
114 #define FTRenderer_getCBox FT_Renderer_GetCBoxFunc
|
nuclear@0
|
115 #define FTRenderer_setMode FT_Renderer_SetModeFunc
|
nuclear@0
|
116
|
nuclear@0
|
117
|
nuclear@0
|
118 /*************************************************************************/
|
nuclear@0
|
119 /* */
|
nuclear@0
|
120 /* <Struct> */
|
nuclear@0
|
121 /* FT_Renderer_Class */
|
nuclear@0
|
122 /* */
|
nuclear@0
|
123 /* <Description> */
|
nuclear@0
|
124 /* The renderer module class descriptor. */
|
nuclear@0
|
125 /* */
|
nuclear@0
|
126 /* <Fields> */
|
nuclear@0
|
127 /* root :: The root @FT_Module_Class fields. */
|
nuclear@0
|
128 /* */
|
nuclear@0
|
129 /* glyph_format :: The glyph image format this renderer handles. */
|
nuclear@0
|
130 /* */
|
nuclear@0
|
131 /* render_glyph :: A method used to render the image that is in a */
|
nuclear@0
|
132 /* given glyph slot into a bitmap. */
|
nuclear@0
|
133 /* */
|
nuclear@0
|
134 /* transform_glyph :: A method used to transform the image that is in */
|
nuclear@0
|
135 /* a given glyph slot. */
|
nuclear@0
|
136 /* */
|
nuclear@0
|
137 /* get_glyph_cbox :: A method used to access the glyph's cbox. */
|
nuclear@0
|
138 /* */
|
nuclear@0
|
139 /* set_mode :: A method used to pass additional parameters. */
|
nuclear@0
|
140 /* */
|
nuclear@0
|
141 /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */
|
nuclear@0
|
142 /* This is a pointer to its raster's class. */
|
nuclear@0
|
143 /* */
|
nuclear@0
|
144 typedef struct FT_Renderer_Class_
|
nuclear@0
|
145 {
|
nuclear@0
|
146 FT_Module_Class root;
|
nuclear@0
|
147
|
nuclear@0
|
148 FT_Glyph_Format glyph_format;
|
nuclear@0
|
149
|
nuclear@0
|
150 FT_Renderer_RenderFunc render_glyph;
|
nuclear@0
|
151 FT_Renderer_TransformFunc transform_glyph;
|
nuclear@0
|
152 FT_Renderer_GetCBoxFunc get_glyph_cbox;
|
nuclear@0
|
153 FT_Renderer_SetModeFunc set_mode;
|
nuclear@0
|
154
|
nuclear@0
|
155 FT_Raster_Funcs* raster_class;
|
nuclear@0
|
156
|
nuclear@0
|
157 } FT_Renderer_Class;
|
nuclear@0
|
158
|
nuclear@0
|
159
|
nuclear@0
|
160 /*************************************************************************/
|
nuclear@0
|
161 /* */
|
nuclear@0
|
162 /* <Function> */
|
nuclear@0
|
163 /* FT_Get_Renderer */
|
nuclear@0
|
164 /* */
|
nuclear@0
|
165 /* <Description> */
|
nuclear@0
|
166 /* Retrieve the current renderer for a given glyph format. */
|
nuclear@0
|
167 /* */
|
nuclear@0
|
168 /* <Input> */
|
nuclear@0
|
169 /* library :: A handle to the library object. */
|
nuclear@0
|
170 /* */
|
nuclear@0
|
171 /* format :: The glyph format. */
|
nuclear@0
|
172 /* */
|
nuclear@0
|
173 /* <Return> */
|
nuclear@0
|
174 /* A renderer handle. 0~if none found. */
|
nuclear@0
|
175 /* */
|
nuclear@0
|
176 /* <Note> */
|
nuclear@0
|
177 /* An error will be returned if a module already exists by that name, */
|
nuclear@0
|
178 /* or if the module requires a version of FreeType that is too great. */
|
nuclear@0
|
179 /* */
|
nuclear@0
|
180 /* To add a new renderer, simply use @FT_Add_Module. To retrieve a */
|
nuclear@0
|
181 /* renderer by its name, use @FT_Get_Module. */
|
nuclear@0
|
182 /* */
|
nuclear@0
|
183 FT_EXPORT( FT_Renderer )
|
nuclear@0
|
184 FT_Get_Renderer( FT_Library library,
|
nuclear@0
|
185 FT_Glyph_Format format );
|
nuclear@0
|
186
|
nuclear@0
|
187
|
nuclear@0
|
188 /*************************************************************************/
|
nuclear@0
|
189 /* */
|
nuclear@0
|
190 /* <Function> */
|
nuclear@0
|
191 /* FT_Set_Renderer */
|
nuclear@0
|
192 /* */
|
nuclear@0
|
193 /* <Description> */
|
nuclear@0
|
194 /* Set the current renderer to use, and set additional mode. */
|
nuclear@0
|
195 /* */
|
nuclear@0
|
196 /* <InOut> */
|
nuclear@0
|
197 /* library :: A handle to the library object. */
|
nuclear@0
|
198 /* */
|
nuclear@0
|
199 /* <Input> */
|
nuclear@0
|
200 /* renderer :: A handle to the renderer object. */
|
nuclear@0
|
201 /* */
|
nuclear@0
|
202 /* num_params :: The number of additional parameters. */
|
nuclear@0
|
203 /* */
|
nuclear@0
|
204 /* parameters :: Additional parameters. */
|
nuclear@0
|
205 /* */
|
nuclear@0
|
206 /* <Return> */
|
nuclear@0
|
207 /* FreeType error code. 0~means success. */
|
nuclear@0
|
208 /* */
|
nuclear@0
|
209 /* <Note> */
|
nuclear@0
|
210 /* In case of success, the renderer will be used to convert glyph */
|
nuclear@0
|
211 /* images in the renderer's known format into bitmaps. */
|
nuclear@0
|
212 /* */
|
nuclear@0
|
213 /* This doesn't change the current renderer for other formats. */
|
nuclear@0
|
214 /* */
|
nuclear@0
|
215 FT_EXPORT( FT_Error )
|
nuclear@0
|
216 FT_Set_Renderer( FT_Library library,
|
nuclear@0
|
217 FT_Renderer renderer,
|
nuclear@0
|
218 FT_UInt num_params,
|
nuclear@0
|
219 FT_Parameter* parameters );
|
nuclear@0
|
220
|
nuclear@0
|
221
|
nuclear@0
|
222 /* */
|
nuclear@0
|
223
|
nuclear@0
|
224
|
nuclear@0
|
225 FT_END_HEADER
|
nuclear@0
|
226
|
nuclear@0
|
227 #endif /* __FTRENDER_H__ */
|
nuclear@0
|
228
|
nuclear@0
|
229
|
nuclear@0
|
230 /* END */
|