1 /***************************************************************************/ |
1 /**************************************************************************** |
2 /* */ |
2 * |
3 /* ftrender.h */ |
3 * ftrender.h |
4 /* */ |
4 * |
5 /* FreeType renderer modules public interface (specification). */ |
5 * FreeType renderer modules public interface (specification). |
6 /* */ |
6 * |
7 /* Copyright 1996-2018 by */ |
7 * Copyright (C) 1996-2019 by |
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
8 * David Turner, Robert Wilhelm, and Werner Lemberg. |
9 /* */ |
9 * |
10 /* This file is part of the FreeType project, and may only be used, */ |
10 * This file is part of the FreeType project, and may only be used, |
11 /* modified, and distributed under the terms of the FreeType project */ |
11 * modified, and distributed under the terms of the FreeType project |
12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
12 * license, LICENSE.TXT. By continuing to use, modify, or distribute |
13 /* this file you indicate that you have read the license and */ |
13 * this file you indicate that you have read the license and |
14 /* understand and accept it fully. */ |
14 * understand and accept it fully. |
15 /* */ |
15 * |
16 /***************************************************************************/ |
16 */ |
17 |
17 |
18 |
18 |
19 #ifndef FTRENDER_H_ |
19 #ifndef FTRENDER_H_ |
20 #define FTRENDER_H_ |
20 #define FTRENDER_H_ |
21 |
21 |
114 #define FTRenderer_transform FT_Renderer_TransformFunc |
114 #define FTRenderer_transform FT_Renderer_TransformFunc |
115 #define FTRenderer_getCBox FT_Renderer_GetCBoxFunc |
115 #define FTRenderer_getCBox FT_Renderer_GetCBoxFunc |
116 #define FTRenderer_setMode FT_Renderer_SetModeFunc |
116 #define FTRenderer_setMode FT_Renderer_SetModeFunc |
117 |
117 |
118 |
118 |
119 /*************************************************************************/ |
119 /************************************************************************** |
120 /* */ |
120 * |
121 /* <Struct> */ |
121 * @struct: |
122 /* FT_Renderer_Class */ |
122 * FT_Renderer_Class |
123 /* */ |
123 * |
124 /* <Description> */ |
124 * @description: |
125 /* The renderer module class descriptor. */ |
125 * The renderer module class descriptor. |
126 /* */ |
126 * |
127 /* <Fields> */ |
127 * @fields: |
128 /* root :: The root @FT_Module_Class fields. */ |
128 * root :: |
129 /* */ |
129 * The root @FT_Module_Class fields. |
130 /* glyph_format :: The glyph image format this renderer handles. */ |
130 * |
131 /* */ |
131 * glyph_format :: |
132 /* render_glyph :: A method used to render the image that is in a */ |
132 * The glyph image format this renderer handles. |
133 /* given glyph slot into a bitmap. */ |
133 * |
134 /* */ |
134 * render_glyph :: |
135 /* transform_glyph :: A method used to transform the image that is in */ |
135 * A method used to render the image that is in a given glyph slot into |
136 /* a given glyph slot. */ |
136 * a bitmap. |
137 /* */ |
137 * |
138 /* get_glyph_cbox :: A method used to access the glyph's cbox. */ |
138 * transform_glyph :: |
139 /* */ |
139 * A method used to transform the image that is in a given glyph slot. |
140 /* set_mode :: A method used to pass additional parameters. */ |
140 * |
141 /* */ |
141 * get_glyph_cbox :: |
142 /* raster_class :: For @FT_GLYPH_FORMAT_OUTLINE renderers only. */ |
142 * A method used to access the glyph's cbox. |
143 /* This is a pointer to its raster's class. */ |
143 * |
144 /* */ |
144 * set_mode :: |
|
145 * A method used to pass additional parameters. |
|
146 * |
|
147 * raster_class :: |
|
148 * For @FT_GLYPH_FORMAT_OUTLINE renderers only. This is a pointer to |
|
149 * its raster's class. |
|
150 */ |
145 typedef struct FT_Renderer_Class_ |
151 typedef struct FT_Renderer_Class_ |
146 { |
152 { |
147 FT_Module_Class root; |
153 FT_Module_Class root; |
148 |
154 |
149 FT_Glyph_Format glyph_format; |
155 FT_Glyph_Format glyph_format; |
156 FT_Raster_Funcs* raster_class; |
162 FT_Raster_Funcs* raster_class; |
157 |
163 |
158 } FT_Renderer_Class; |
164 } FT_Renderer_Class; |
159 |
165 |
160 |
166 |
161 /*************************************************************************/ |
167 /************************************************************************** |
162 /* */ |
168 * |
163 /* <Function> */ |
169 * @function: |
164 /* FT_Get_Renderer */ |
170 * FT_Get_Renderer |
165 /* */ |
171 * |
166 /* <Description> */ |
172 * @description: |
167 /* Retrieve the current renderer for a given glyph format. */ |
173 * Retrieve the current renderer for a given glyph format. |
168 /* */ |
174 * |
169 /* <Input> */ |
175 * @input: |
170 /* library :: A handle to the library object. */ |
176 * library :: |
171 /* */ |
177 * A handle to the library object. |
172 /* format :: The glyph format. */ |
178 * |
173 /* */ |
179 * format :: |
174 /* <Return> */ |
180 * The glyph format. |
175 /* A renderer handle. 0~if none found. */ |
181 * |
176 /* */ |
182 * @return: |
177 /* <Note> */ |
183 * A renderer handle. 0~if none found. |
178 /* An error will be returned if a module already exists by that name, */ |
184 * |
179 /* or if the module requires a version of FreeType that is too great. */ |
185 * @note: |
180 /* */ |
186 * An error will be returned if a module already exists by that name, or |
181 /* To add a new renderer, simply use @FT_Add_Module. To retrieve a */ |
187 * if the module requires a version of FreeType that is too great. |
182 /* renderer by its name, use @FT_Get_Module. */ |
188 * |
183 /* */ |
189 * To add a new renderer, simply use @FT_Add_Module. To retrieve a |
|
190 * renderer by its name, use @FT_Get_Module. |
|
191 */ |
184 FT_EXPORT( FT_Renderer ) |
192 FT_EXPORT( FT_Renderer ) |
185 FT_Get_Renderer( FT_Library library, |
193 FT_Get_Renderer( FT_Library library, |
186 FT_Glyph_Format format ); |
194 FT_Glyph_Format format ); |
187 |
195 |
188 |
196 |
189 /*************************************************************************/ |
197 /************************************************************************** |
190 /* */ |
198 * |
191 /* <Function> */ |
199 * @function: |
192 /* FT_Set_Renderer */ |
200 * FT_Set_Renderer |
193 /* */ |
201 * |
194 /* <Description> */ |
202 * @description: |
195 /* Set the current renderer to use, and set additional mode. */ |
203 * Set the current renderer to use, and set additional mode. |
196 /* */ |
204 * |
197 /* <InOut> */ |
205 * @inout: |
198 /* library :: A handle to the library object. */ |
206 * library :: |
199 /* */ |
207 * A handle to the library object. |
200 /* <Input> */ |
208 * |
201 /* renderer :: A handle to the renderer object. */ |
209 * @input: |
202 /* */ |
210 * renderer :: |
203 /* num_params :: The number of additional parameters. */ |
211 * A handle to the renderer object. |
204 /* */ |
212 * |
205 /* parameters :: Additional parameters. */ |
213 * num_params :: |
206 /* */ |
214 * The number of additional parameters. |
207 /* <Return> */ |
215 * |
208 /* FreeType error code. 0~means success. */ |
216 * parameters :: |
209 /* */ |
217 * Additional parameters. |
210 /* <Note> */ |
218 * |
211 /* In case of success, the renderer will be used to convert glyph */ |
219 * @return: |
212 /* images in the renderer's known format into bitmaps. */ |
220 * FreeType error code. 0~means success. |
213 /* */ |
221 * |
214 /* This doesn't change the current renderer for other formats. */ |
222 * @note: |
215 /* */ |
223 * In case of success, the renderer will be used to convert glyph images |
216 /* Currently, no FreeType renderer module uses `parameters'; you */ |
224 * in the renderer's known format into bitmaps. |
217 /* should thus always pass NULL as the value. */ |
225 * |
218 /* */ |
226 * This doesn't change the current renderer for other formats. |
|
227 * |
|
228 * Currently, no FreeType renderer module uses `parameters`; you should |
|
229 * thus always pass `NULL` as the value. |
|
230 */ |
219 FT_EXPORT( FT_Error ) |
231 FT_EXPORT( FT_Error ) |
220 FT_Set_Renderer( FT_Library library, |
232 FT_Set_Renderer( FT_Library library, |
221 FT_Renderer renderer, |
233 FT_Renderer renderer, |
222 FT_UInt num_params, |
234 FT_UInt num_params, |
223 FT_Parameter* parameters ); |
235 FT_Parameter* parameters ); |