rev |
line source |
nuclear@0
|
1 /***************************************************************************/
|
nuclear@0
|
2 /* */
|
nuclear@0
|
3 /* ftstroke.h */
|
nuclear@0
|
4 /* */
|
nuclear@0
|
5 /* FreeType path stroker (specification). */
|
nuclear@0
|
6 /* */
|
nuclear@0
|
7 /* Copyright 2002, 2003, 2004, 2005, 2006, 2008, 2009 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 __FT_STROKE_H__
|
nuclear@0
|
20 #define __FT_STROKE_H__
|
nuclear@0
|
21
|
nuclear@0
|
22 #include <ft2build.h>
|
nuclear@0
|
23 #include FT_OUTLINE_H
|
nuclear@0
|
24 #include FT_GLYPH_H
|
nuclear@0
|
25
|
nuclear@0
|
26
|
nuclear@0
|
27 FT_BEGIN_HEADER
|
nuclear@0
|
28
|
nuclear@0
|
29
|
nuclear@0
|
30 /************************************************************************
|
nuclear@0
|
31 *
|
nuclear@0
|
32 * @section:
|
nuclear@0
|
33 * glyph_stroker
|
nuclear@0
|
34 *
|
nuclear@0
|
35 * @title:
|
nuclear@0
|
36 * Glyph Stroker
|
nuclear@0
|
37 *
|
nuclear@0
|
38 * @abstract:
|
nuclear@0
|
39 * Generating bordered and stroked glyphs.
|
nuclear@0
|
40 *
|
nuclear@0
|
41 * @description:
|
nuclear@0
|
42 * This component generates stroked outlines of a given vectorial
|
nuclear@0
|
43 * glyph. It also allows you to retrieve the `outside' and/or the
|
nuclear@0
|
44 * `inside' borders of the stroke.
|
nuclear@0
|
45 *
|
nuclear@0
|
46 * This can be useful to generate `bordered' glyph, i.e., glyphs
|
nuclear@0
|
47 * displayed with a coloured (and anti-aliased) border around their
|
nuclear@0
|
48 * shape.
|
nuclear@0
|
49 */
|
nuclear@0
|
50
|
nuclear@0
|
51
|
nuclear@0
|
52 /**************************************************************
|
nuclear@0
|
53 *
|
nuclear@0
|
54 * @type:
|
nuclear@0
|
55 * FT_Stroker
|
nuclear@0
|
56 *
|
nuclear@0
|
57 * @description:
|
nuclear@0
|
58 * Opaque handler to a path stroker object.
|
nuclear@0
|
59 */
|
nuclear@0
|
60 typedef struct FT_StrokerRec_* FT_Stroker;
|
nuclear@0
|
61
|
nuclear@0
|
62
|
nuclear@0
|
63 /**************************************************************
|
nuclear@0
|
64 *
|
nuclear@0
|
65 * @enum:
|
nuclear@0
|
66 * FT_Stroker_LineJoin
|
nuclear@0
|
67 *
|
nuclear@0
|
68 * @description:
|
nuclear@0
|
69 * These values determine how two joining lines are rendered
|
nuclear@0
|
70 * in a stroker.
|
nuclear@0
|
71 *
|
nuclear@0
|
72 * @values:
|
nuclear@0
|
73 * FT_STROKER_LINEJOIN_ROUND ::
|
nuclear@0
|
74 * Used to render rounded line joins. Circular arcs are used
|
nuclear@0
|
75 * to join two lines smoothly.
|
nuclear@0
|
76 *
|
nuclear@0
|
77 * FT_STROKER_LINEJOIN_BEVEL ::
|
nuclear@0
|
78 * Used to render beveled line joins; i.e., the two joining lines
|
nuclear@0
|
79 * are extended until they intersect.
|
nuclear@0
|
80 *
|
nuclear@0
|
81 * FT_STROKER_LINEJOIN_MITER ::
|
nuclear@0
|
82 * Same as beveled rendering, except that an additional line
|
nuclear@0
|
83 * break is added if the angle between the two joining lines
|
nuclear@0
|
84 * is too closed (this is useful to avoid unpleasant spikes
|
nuclear@0
|
85 * in beveled rendering).
|
nuclear@0
|
86 */
|
nuclear@0
|
87 typedef enum FT_Stroker_LineJoin_
|
nuclear@0
|
88 {
|
nuclear@0
|
89 FT_STROKER_LINEJOIN_ROUND = 0,
|
nuclear@0
|
90 FT_STROKER_LINEJOIN_BEVEL,
|
nuclear@0
|
91 FT_STROKER_LINEJOIN_MITER
|
nuclear@0
|
92
|
nuclear@0
|
93 } FT_Stroker_LineJoin;
|
nuclear@0
|
94
|
nuclear@0
|
95
|
nuclear@0
|
96 /**************************************************************
|
nuclear@0
|
97 *
|
nuclear@0
|
98 * @enum:
|
nuclear@0
|
99 * FT_Stroker_LineCap
|
nuclear@0
|
100 *
|
nuclear@0
|
101 * @description:
|
nuclear@0
|
102 * These values determine how the end of opened sub-paths are
|
nuclear@0
|
103 * rendered in a stroke.
|
nuclear@0
|
104 *
|
nuclear@0
|
105 * @values:
|
nuclear@0
|
106 * FT_STROKER_LINECAP_BUTT ::
|
nuclear@0
|
107 * The end of lines is rendered as a full stop on the last
|
nuclear@0
|
108 * point itself.
|
nuclear@0
|
109 *
|
nuclear@0
|
110 * FT_STROKER_LINECAP_ROUND ::
|
nuclear@0
|
111 * The end of lines is rendered as a half-circle around the
|
nuclear@0
|
112 * last point.
|
nuclear@0
|
113 *
|
nuclear@0
|
114 * FT_STROKER_LINECAP_SQUARE ::
|
nuclear@0
|
115 * The end of lines is rendered as a square around the
|
nuclear@0
|
116 * last point.
|
nuclear@0
|
117 */
|
nuclear@0
|
118 typedef enum FT_Stroker_LineCap_
|
nuclear@0
|
119 {
|
nuclear@0
|
120 FT_STROKER_LINECAP_BUTT = 0,
|
nuclear@0
|
121 FT_STROKER_LINECAP_ROUND,
|
nuclear@0
|
122 FT_STROKER_LINECAP_SQUARE
|
nuclear@0
|
123
|
nuclear@0
|
124 } FT_Stroker_LineCap;
|
nuclear@0
|
125
|
nuclear@0
|
126
|
nuclear@0
|
127 /**************************************************************
|
nuclear@0
|
128 *
|
nuclear@0
|
129 * @enum:
|
nuclear@0
|
130 * FT_StrokerBorder
|
nuclear@0
|
131 *
|
nuclear@0
|
132 * @description:
|
nuclear@0
|
133 * These values are used to select a given stroke border
|
nuclear@0
|
134 * in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
|
nuclear@0
|
135 *
|
nuclear@0
|
136 * @values:
|
nuclear@0
|
137 * FT_STROKER_BORDER_LEFT ::
|
nuclear@0
|
138 * Select the left border, relative to the drawing direction.
|
nuclear@0
|
139 *
|
nuclear@0
|
140 * FT_STROKER_BORDER_RIGHT ::
|
nuclear@0
|
141 * Select the right border, relative to the drawing direction.
|
nuclear@0
|
142 *
|
nuclear@0
|
143 * @note:
|
nuclear@0
|
144 * Applications are generally interested in the `inside' and `outside'
|
nuclear@0
|
145 * borders. However, there is no direct mapping between these and the
|
nuclear@0
|
146 * `left' and `right' ones, since this really depends on the glyph's
|
nuclear@0
|
147 * drawing orientation, which varies between font formats.
|
nuclear@0
|
148 *
|
nuclear@0
|
149 * You can however use @FT_Outline_GetInsideBorder and
|
nuclear@0
|
150 * @FT_Outline_GetOutsideBorder to get these.
|
nuclear@0
|
151 */
|
nuclear@0
|
152 typedef enum FT_StrokerBorder_
|
nuclear@0
|
153 {
|
nuclear@0
|
154 FT_STROKER_BORDER_LEFT = 0,
|
nuclear@0
|
155 FT_STROKER_BORDER_RIGHT
|
nuclear@0
|
156
|
nuclear@0
|
157 } FT_StrokerBorder;
|
nuclear@0
|
158
|
nuclear@0
|
159
|
nuclear@0
|
160 /**************************************************************
|
nuclear@0
|
161 *
|
nuclear@0
|
162 * @function:
|
nuclear@0
|
163 * FT_Outline_GetInsideBorder
|
nuclear@0
|
164 *
|
nuclear@0
|
165 * @description:
|
nuclear@0
|
166 * Retrieve the @FT_StrokerBorder value corresponding to the
|
nuclear@0
|
167 * `inside' borders of a given outline.
|
nuclear@0
|
168 *
|
nuclear@0
|
169 * @input:
|
nuclear@0
|
170 * outline ::
|
nuclear@0
|
171 * The source outline handle.
|
nuclear@0
|
172 *
|
nuclear@0
|
173 * @return:
|
nuclear@0
|
174 * The border index. @FT_STROKER_BORDER_RIGHT for empty or invalid
|
nuclear@0
|
175 * outlines.
|
nuclear@0
|
176 */
|
nuclear@0
|
177 FT_EXPORT( FT_StrokerBorder )
|
nuclear@0
|
178 FT_Outline_GetInsideBorder( FT_Outline* outline );
|
nuclear@0
|
179
|
nuclear@0
|
180
|
nuclear@0
|
181 /**************************************************************
|
nuclear@0
|
182 *
|
nuclear@0
|
183 * @function:
|
nuclear@0
|
184 * FT_Outline_GetOutsideBorder
|
nuclear@0
|
185 *
|
nuclear@0
|
186 * @description:
|
nuclear@0
|
187 * Retrieve the @FT_StrokerBorder value corresponding to the
|
nuclear@0
|
188 * `outside' borders of a given outline.
|
nuclear@0
|
189 *
|
nuclear@0
|
190 * @input:
|
nuclear@0
|
191 * outline ::
|
nuclear@0
|
192 * The source outline handle.
|
nuclear@0
|
193 *
|
nuclear@0
|
194 * @return:
|
nuclear@0
|
195 * The border index. @FT_STROKER_BORDER_LEFT for empty or invalid
|
nuclear@0
|
196 * outlines.
|
nuclear@0
|
197 */
|
nuclear@0
|
198 FT_EXPORT( FT_StrokerBorder )
|
nuclear@0
|
199 FT_Outline_GetOutsideBorder( FT_Outline* outline );
|
nuclear@0
|
200
|
nuclear@0
|
201
|
nuclear@0
|
202 /**************************************************************
|
nuclear@0
|
203 *
|
nuclear@0
|
204 * @function:
|
nuclear@0
|
205 * FT_Stroker_New
|
nuclear@0
|
206 *
|
nuclear@0
|
207 * @description:
|
nuclear@0
|
208 * Create a new stroker object.
|
nuclear@0
|
209 *
|
nuclear@0
|
210 * @input:
|
nuclear@0
|
211 * library ::
|
nuclear@0
|
212 * FreeType library handle.
|
nuclear@0
|
213 *
|
nuclear@0
|
214 * @output:
|
nuclear@0
|
215 * astroker ::
|
nuclear@0
|
216 * A new stroker object handle. NULL in case of error.
|
nuclear@0
|
217 *
|
nuclear@0
|
218 * @return:
|
nuclear@0
|
219 * FreeType error code. 0~means success.
|
nuclear@0
|
220 */
|
nuclear@0
|
221 FT_EXPORT( FT_Error )
|
nuclear@0
|
222 FT_Stroker_New( FT_Library library,
|
nuclear@0
|
223 FT_Stroker *astroker );
|
nuclear@0
|
224
|
nuclear@0
|
225
|
nuclear@0
|
226 /**************************************************************
|
nuclear@0
|
227 *
|
nuclear@0
|
228 * @function:
|
nuclear@0
|
229 * FT_Stroker_Set
|
nuclear@0
|
230 *
|
nuclear@0
|
231 * @description:
|
nuclear@0
|
232 * Reset a stroker object's attributes.
|
nuclear@0
|
233 *
|
nuclear@0
|
234 * @input:
|
nuclear@0
|
235 * stroker ::
|
nuclear@0
|
236 * The target stroker handle.
|
nuclear@0
|
237 *
|
nuclear@0
|
238 * radius ::
|
nuclear@0
|
239 * The border radius.
|
nuclear@0
|
240 *
|
nuclear@0
|
241 * line_cap ::
|
nuclear@0
|
242 * The line cap style.
|
nuclear@0
|
243 *
|
nuclear@0
|
244 * line_join ::
|
nuclear@0
|
245 * The line join style.
|
nuclear@0
|
246 *
|
nuclear@0
|
247 * miter_limit ::
|
nuclear@0
|
248 * The miter limit for the FT_STROKER_LINEJOIN_MITER style,
|
nuclear@0
|
249 * expressed as 16.16 fixed point value.
|
nuclear@0
|
250 *
|
nuclear@0
|
251 * @note:
|
nuclear@0
|
252 * The radius is expressed in the same units as the outline
|
nuclear@0
|
253 * coordinates.
|
nuclear@0
|
254 */
|
nuclear@0
|
255 FT_EXPORT( void )
|
nuclear@0
|
256 FT_Stroker_Set( FT_Stroker stroker,
|
nuclear@0
|
257 FT_Fixed radius,
|
nuclear@0
|
258 FT_Stroker_LineCap line_cap,
|
nuclear@0
|
259 FT_Stroker_LineJoin line_join,
|
nuclear@0
|
260 FT_Fixed miter_limit );
|
nuclear@0
|
261
|
nuclear@0
|
262
|
nuclear@0
|
263 /**************************************************************
|
nuclear@0
|
264 *
|
nuclear@0
|
265 * @function:
|
nuclear@0
|
266 * FT_Stroker_Rewind
|
nuclear@0
|
267 *
|
nuclear@0
|
268 * @description:
|
nuclear@0
|
269 * Reset a stroker object without changing its attributes.
|
nuclear@0
|
270 * You should call this function before beginning a new
|
nuclear@0
|
271 * series of calls to @FT_Stroker_BeginSubPath or
|
nuclear@0
|
272 * @FT_Stroker_EndSubPath.
|
nuclear@0
|
273 *
|
nuclear@0
|
274 * @input:
|
nuclear@0
|
275 * stroker ::
|
nuclear@0
|
276 * The target stroker handle.
|
nuclear@0
|
277 */
|
nuclear@0
|
278 FT_EXPORT( void )
|
nuclear@0
|
279 FT_Stroker_Rewind( FT_Stroker stroker );
|
nuclear@0
|
280
|
nuclear@0
|
281
|
nuclear@0
|
282 /**************************************************************
|
nuclear@0
|
283 *
|
nuclear@0
|
284 * @function:
|
nuclear@0
|
285 * FT_Stroker_ParseOutline
|
nuclear@0
|
286 *
|
nuclear@0
|
287 * @description:
|
nuclear@0
|
288 * A convenience function used to parse a whole outline with
|
nuclear@0
|
289 * the stroker. The resulting outline(s) can be retrieved
|
nuclear@0
|
290 * later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.
|
nuclear@0
|
291 *
|
nuclear@0
|
292 * @input:
|
nuclear@0
|
293 * stroker ::
|
nuclear@0
|
294 * The target stroker handle.
|
nuclear@0
|
295 *
|
nuclear@0
|
296 * outline ::
|
nuclear@0
|
297 * The source outline.
|
nuclear@0
|
298 *
|
nuclear@0
|
299 * opened ::
|
nuclear@0
|
300 * A boolean. If~1, the outline is treated as an open path instead
|
nuclear@0
|
301 * of a closed one.
|
nuclear@0
|
302 *
|
nuclear@0
|
303 * @return:
|
nuclear@0
|
304 * FreeType error code. 0~means success.
|
nuclear@0
|
305 *
|
nuclear@0
|
306 * @note:
|
nuclear@0
|
307 * If `opened' is~0 (the default), the outline is treated as a closed
|
nuclear@0
|
308 * path, and the stroker generates two distinct `border' outlines.
|
nuclear@0
|
309 *
|
nuclear@0
|
310 * If `opened' is~1, the outline is processed as an open path, and the
|
nuclear@0
|
311 * stroker generates a single `stroke' outline.
|
nuclear@0
|
312 *
|
nuclear@0
|
313 * This function calls @FT_Stroker_Rewind automatically.
|
nuclear@0
|
314 */
|
nuclear@0
|
315 FT_EXPORT( FT_Error )
|
nuclear@0
|
316 FT_Stroker_ParseOutline( FT_Stroker stroker,
|
nuclear@0
|
317 FT_Outline* outline,
|
nuclear@0
|
318 FT_Bool opened );
|
nuclear@0
|
319
|
nuclear@0
|
320
|
nuclear@0
|
321 /**************************************************************
|
nuclear@0
|
322 *
|
nuclear@0
|
323 * @function:
|
nuclear@0
|
324 * FT_Stroker_BeginSubPath
|
nuclear@0
|
325 *
|
nuclear@0
|
326 * @description:
|
nuclear@0
|
327 * Start a new sub-path in the stroker.
|
nuclear@0
|
328 *
|
nuclear@0
|
329 * @input:
|
nuclear@0
|
330 * stroker ::
|
nuclear@0
|
331 * The target stroker handle.
|
nuclear@0
|
332 *
|
nuclear@0
|
333 * to ::
|
nuclear@0
|
334 * A pointer to the start vector.
|
nuclear@0
|
335 *
|
nuclear@0
|
336 * open ::
|
nuclear@0
|
337 * A boolean. If~1, the sub-path is treated as an open one.
|
nuclear@0
|
338 *
|
nuclear@0
|
339 * @return:
|
nuclear@0
|
340 * FreeType error code. 0~means success.
|
nuclear@0
|
341 *
|
nuclear@0
|
342 * @note:
|
nuclear@0
|
343 * This function is useful when you need to stroke a path that is
|
nuclear@0
|
344 * not stored as an @FT_Outline object.
|
nuclear@0
|
345 */
|
nuclear@0
|
346 FT_EXPORT( FT_Error )
|
nuclear@0
|
347 FT_Stroker_BeginSubPath( FT_Stroker stroker,
|
nuclear@0
|
348 FT_Vector* to,
|
nuclear@0
|
349 FT_Bool open );
|
nuclear@0
|
350
|
nuclear@0
|
351
|
nuclear@0
|
352 /**************************************************************
|
nuclear@0
|
353 *
|
nuclear@0
|
354 * @function:
|
nuclear@0
|
355 * FT_Stroker_EndSubPath
|
nuclear@0
|
356 *
|
nuclear@0
|
357 * @description:
|
nuclear@0
|
358 * Close the current sub-path in the stroker.
|
nuclear@0
|
359 *
|
nuclear@0
|
360 * @input:
|
nuclear@0
|
361 * stroker ::
|
nuclear@0
|
362 * The target stroker handle.
|
nuclear@0
|
363 *
|
nuclear@0
|
364 * @return:
|
nuclear@0
|
365 * FreeType error code. 0~means success.
|
nuclear@0
|
366 *
|
nuclear@0
|
367 * @note:
|
nuclear@0
|
368 * You should call this function after @FT_Stroker_BeginSubPath.
|
nuclear@0
|
369 * If the subpath was not `opened', this function `draws' a
|
nuclear@0
|
370 * single line segment to the start position when needed.
|
nuclear@0
|
371 */
|
nuclear@0
|
372 FT_EXPORT( FT_Error )
|
nuclear@0
|
373 FT_Stroker_EndSubPath( FT_Stroker stroker );
|
nuclear@0
|
374
|
nuclear@0
|
375
|
nuclear@0
|
376 /**************************************************************
|
nuclear@0
|
377 *
|
nuclear@0
|
378 * @function:
|
nuclear@0
|
379 * FT_Stroker_LineTo
|
nuclear@0
|
380 *
|
nuclear@0
|
381 * @description:
|
nuclear@0
|
382 * `Draw' a single line segment in the stroker's current sub-path,
|
nuclear@0
|
383 * from the last position.
|
nuclear@0
|
384 *
|
nuclear@0
|
385 * @input:
|
nuclear@0
|
386 * stroker ::
|
nuclear@0
|
387 * The target stroker handle.
|
nuclear@0
|
388 *
|
nuclear@0
|
389 * to ::
|
nuclear@0
|
390 * A pointer to the destination point.
|
nuclear@0
|
391 *
|
nuclear@0
|
392 * @return:
|
nuclear@0
|
393 * FreeType error code. 0~means success.
|
nuclear@0
|
394 *
|
nuclear@0
|
395 * @note:
|
nuclear@0
|
396 * You should call this function between @FT_Stroker_BeginSubPath and
|
nuclear@0
|
397 * @FT_Stroker_EndSubPath.
|
nuclear@0
|
398 */
|
nuclear@0
|
399 FT_EXPORT( FT_Error )
|
nuclear@0
|
400 FT_Stroker_LineTo( FT_Stroker stroker,
|
nuclear@0
|
401 FT_Vector* to );
|
nuclear@0
|
402
|
nuclear@0
|
403
|
nuclear@0
|
404 /**************************************************************
|
nuclear@0
|
405 *
|
nuclear@0
|
406 * @function:
|
nuclear@0
|
407 * FT_Stroker_ConicTo
|
nuclear@0
|
408 *
|
nuclear@0
|
409 * @description:
|
nuclear@0
|
410 * `Draw' a single quadratic Bézier in the stroker's current sub-path,
|
nuclear@0
|
411 * from the last position.
|
nuclear@0
|
412 *
|
nuclear@0
|
413 * @input:
|
nuclear@0
|
414 * stroker ::
|
nuclear@0
|
415 * The target stroker handle.
|
nuclear@0
|
416 *
|
nuclear@0
|
417 * control ::
|
nuclear@0
|
418 * A pointer to a Bézier control point.
|
nuclear@0
|
419 *
|
nuclear@0
|
420 * to ::
|
nuclear@0
|
421 * A pointer to the destination point.
|
nuclear@0
|
422 *
|
nuclear@0
|
423 * @return:
|
nuclear@0
|
424 * FreeType error code. 0~means success.
|
nuclear@0
|
425 *
|
nuclear@0
|
426 * @note:
|
nuclear@0
|
427 * You should call this function between @FT_Stroker_BeginSubPath and
|
nuclear@0
|
428 * @FT_Stroker_EndSubPath.
|
nuclear@0
|
429 */
|
nuclear@0
|
430 FT_EXPORT( FT_Error )
|
nuclear@0
|
431 FT_Stroker_ConicTo( FT_Stroker stroker,
|
nuclear@0
|
432 FT_Vector* control,
|
nuclear@0
|
433 FT_Vector* to );
|
nuclear@0
|
434
|
nuclear@0
|
435
|
nuclear@0
|
436 /**************************************************************
|
nuclear@0
|
437 *
|
nuclear@0
|
438 * @function:
|
nuclear@0
|
439 * FT_Stroker_CubicTo
|
nuclear@0
|
440 *
|
nuclear@0
|
441 * @description:
|
nuclear@0
|
442 * `Draw' a single cubic Bézier in the stroker's current sub-path,
|
nuclear@0
|
443 * from the last position.
|
nuclear@0
|
444 *
|
nuclear@0
|
445 * @input:
|
nuclear@0
|
446 * stroker ::
|
nuclear@0
|
447 * The target stroker handle.
|
nuclear@0
|
448 *
|
nuclear@0
|
449 * control1 ::
|
nuclear@0
|
450 * A pointer to the first Bézier control point.
|
nuclear@0
|
451 *
|
nuclear@0
|
452 * control2 ::
|
nuclear@0
|
453 * A pointer to second Bézier control point.
|
nuclear@0
|
454 *
|
nuclear@0
|
455 * to ::
|
nuclear@0
|
456 * A pointer to the destination point.
|
nuclear@0
|
457 *
|
nuclear@0
|
458 * @return:
|
nuclear@0
|
459 * FreeType error code. 0~means success.
|
nuclear@0
|
460 *
|
nuclear@0
|
461 * @note:
|
nuclear@0
|
462 * You should call this function between @FT_Stroker_BeginSubPath and
|
nuclear@0
|
463 * @FT_Stroker_EndSubPath.
|
nuclear@0
|
464 */
|
nuclear@0
|
465 FT_EXPORT( FT_Error )
|
nuclear@0
|
466 FT_Stroker_CubicTo( FT_Stroker stroker,
|
nuclear@0
|
467 FT_Vector* control1,
|
nuclear@0
|
468 FT_Vector* control2,
|
nuclear@0
|
469 FT_Vector* to );
|
nuclear@0
|
470
|
nuclear@0
|
471
|
nuclear@0
|
472 /**************************************************************
|
nuclear@0
|
473 *
|
nuclear@0
|
474 * @function:
|
nuclear@0
|
475 * FT_Stroker_GetBorderCounts
|
nuclear@0
|
476 *
|
nuclear@0
|
477 * @description:
|
nuclear@0
|
478 * Call this function once you have finished parsing your paths
|
nuclear@0
|
479 * with the stroker. It returns the number of points and
|
nuclear@0
|
480 * contours necessary to export one of the `border' or `stroke'
|
nuclear@0
|
481 * outlines generated by the stroker.
|
nuclear@0
|
482 *
|
nuclear@0
|
483 * @input:
|
nuclear@0
|
484 * stroker ::
|
nuclear@0
|
485 * The target stroker handle.
|
nuclear@0
|
486 *
|
nuclear@0
|
487 * border ::
|
nuclear@0
|
488 * The border index.
|
nuclear@0
|
489 *
|
nuclear@0
|
490 * @output:
|
nuclear@0
|
491 * anum_points ::
|
nuclear@0
|
492 * The number of points.
|
nuclear@0
|
493 *
|
nuclear@0
|
494 * anum_contours ::
|
nuclear@0
|
495 * The number of contours.
|
nuclear@0
|
496 *
|
nuclear@0
|
497 * @return:
|
nuclear@0
|
498 * FreeType error code. 0~means success.
|
nuclear@0
|
499 *
|
nuclear@0
|
500 * @note:
|
nuclear@0
|
501 * When an outline, or a sub-path, is `closed', the stroker generates
|
nuclear@0
|
502 * two independent `border' outlines, named `left' and `right'.
|
nuclear@0
|
503 *
|
nuclear@0
|
504 * When the outline, or a sub-path, is `opened', the stroker merges
|
nuclear@0
|
505 * the `border' outlines with caps. The `left' border receives all
|
nuclear@0
|
506 * points, while the `right' border becomes empty.
|
nuclear@0
|
507 *
|
nuclear@0
|
508 * Use the function @FT_Stroker_GetCounts instead if you want to
|
nuclear@0
|
509 * retrieve the counts associated to both borders.
|
nuclear@0
|
510 */
|
nuclear@0
|
511 FT_EXPORT( FT_Error )
|
nuclear@0
|
512 FT_Stroker_GetBorderCounts( FT_Stroker stroker,
|
nuclear@0
|
513 FT_StrokerBorder border,
|
nuclear@0
|
514 FT_UInt *anum_points,
|
nuclear@0
|
515 FT_UInt *anum_contours );
|
nuclear@0
|
516
|
nuclear@0
|
517
|
nuclear@0
|
518 /**************************************************************
|
nuclear@0
|
519 *
|
nuclear@0
|
520 * @function:
|
nuclear@0
|
521 * FT_Stroker_ExportBorder
|
nuclear@0
|
522 *
|
nuclear@0
|
523 * @description:
|
nuclear@0
|
524 * Call this function after @FT_Stroker_GetBorderCounts to
|
nuclear@0
|
525 * export the corresponding border to your own @FT_Outline
|
nuclear@0
|
526 * structure.
|
nuclear@0
|
527 *
|
nuclear@0
|
528 * Note that this function appends the border points and
|
nuclear@0
|
529 * contours to your outline, but does not try to resize its
|
nuclear@0
|
530 * arrays.
|
nuclear@0
|
531 *
|
nuclear@0
|
532 * @input:
|
nuclear@0
|
533 * stroker ::
|
nuclear@0
|
534 * The target stroker handle.
|
nuclear@0
|
535 *
|
nuclear@0
|
536 * border ::
|
nuclear@0
|
537 * The border index.
|
nuclear@0
|
538 *
|
nuclear@0
|
539 * outline ::
|
nuclear@0
|
540 * The target outline handle.
|
nuclear@0
|
541 *
|
nuclear@0
|
542 * @note:
|
nuclear@0
|
543 * Always call this function after @FT_Stroker_GetBorderCounts to
|
nuclear@0
|
544 * get sure that there is enough room in your @FT_Outline object to
|
nuclear@0
|
545 * receive all new data.
|
nuclear@0
|
546 *
|
nuclear@0
|
547 * When an outline, or a sub-path, is `closed', the stroker generates
|
nuclear@0
|
548 * two independent `border' outlines, named `left' and `right'
|
nuclear@0
|
549 *
|
nuclear@0
|
550 * When the outline, or a sub-path, is `opened', the stroker merges
|
nuclear@0
|
551 * the `border' outlines with caps. The `left' border receives all
|
nuclear@0
|
552 * points, while the `right' border becomes empty.
|
nuclear@0
|
553 *
|
nuclear@0
|
554 * Use the function @FT_Stroker_Export instead if you want to
|
nuclear@0
|
555 * retrieve all borders at once.
|
nuclear@0
|
556 */
|
nuclear@0
|
557 FT_EXPORT( void )
|
nuclear@0
|
558 FT_Stroker_ExportBorder( FT_Stroker stroker,
|
nuclear@0
|
559 FT_StrokerBorder border,
|
nuclear@0
|
560 FT_Outline* outline );
|
nuclear@0
|
561
|
nuclear@0
|
562
|
nuclear@0
|
563 /**************************************************************
|
nuclear@0
|
564 *
|
nuclear@0
|
565 * @function:
|
nuclear@0
|
566 * FT_Stroker_GetCounts
|
nuclear@0
|
567 *
|
nuclear@0
|
568 * @description:
|
nuclear@0
|
569 * Call this function once you have finished parsing your paths
|
nuclear@0
|
570 * with the stroker. It returns the number of points and
|
nuclear@0
|
571 * contours necessary to export all points/borders from the stroked
|
nuclear@0
|
572 * outline/path.
|
nuclear@0
|
573 *
|
nuclear@0
|
574 * @input:
|
nuclear@0
|
575 * stroker ::
|
nuclear@0
|
576 * The target stroker handle.
|
nuclear@0
|
577 *
|
nuclear@0
|
578 * @output:
|
nuclear@0
|
579 * anum_points ::
|
nuclear@0
|
580 * The number of points.
|
nuclear@0
|
581 *
|
nuclear@0
|
582 * anum_contours ::
|
nuclear@0
|
583 * The number of contours.
|
nuclear@0
|
584 *
|
nuclear@0
|
585 * @return:
|
nuclear@0
|
586 * FreeType error code. 0~means success.
|
nuclear@0
|
587 */
|
nuclear@0
|
588 FT_EXPORT( FT_Error )
|
nuclear@0
|
589 FT_Stroker_GetCounts( FT_Stroker stroker,
|
nuclear@0
|
590 FT_UInt *anum_points,
|
nuclear@0
|
591 FT_UInt *anum_contours );
|
nuclear@0
|
592
|
nuclear@0
|
593
|
nuclear@0
|
594 /**************************************************************
|
nuclear@0
|
595 *
|
nuclear@0
|
596 * @function:
|
nuclear@0
|
597 * FT_Stroker_Export
|
nuclear@0
|
598 *
|
nuclear@0
|
599 * @description:
|
nuclear@0
|
600 * Call this function after @FT_Stroker_GetBorderCounts to
|
nuclear@0
|
601 * export all borders to your own @FT_Outline structure.
|
nuclear@0
|
602 *
|
nuclear@0
|
603 * Note that this function appends the border points and
|
nuclear@0
|
604 * contours to your outline, but does not try to resize its
|
nuclear@0
|
605 * arrays.
|
nuclear@0
|
606 *
|
nuclear@0
|
607 * @input:
|
nuclear@0
|
608 * stroker ::
|
nuclear@0
|
609 * The target stroker handle.
|
nuclear@0
|
610 *
|
nuclear@0
|
611 * outline ::
|
nuclear@0
|
612 * The target outline handle.
|
nuclear@0
|
613 */
|
nuclear@0
|
614 FT_EXPORT( void )
|
nuclear@0
|
615 FT_Stroker_Export( FT_Stroker stroker,
|
nuclear@0
|
616 FT_Outline* outline );
|
nuclear@0
|
617
|
nuclear@0
|
618
|
nuclear@0
|
619 /**************************************************************
|
nuclear@0
|
620 *
|
nuclear@0
|
621 * @function:
|
nuclear@0
|
622 * FT_Stroker_Done
|
nuclear@0
|
623 *
|
nuclear@0
|
624 * @description:
|
nuclear@0
|
625 * Destroy a stroker object.
|
nuclear@0
|
626 *
|
nuclear@0
|
627 * @input:
|
nuclear@0
|
628 * stroker ::
|
nuclear@0
|
629 * A stroker handle. Can be NULL.
|
nuclear@0
|
630 */
|
nuclear@0
|
631 FT_EXPORT( void )
|
nuclear@0
|
632 FT_Stroker_Done( FT_Stroker stroker );
|
nuclear@0
|
633
|
nuclear@0
|
634
|
nuclear@0
|
635 /**************************************************************
|
nuclear@0
|
636 *
|
nuclear@0
|
637 * @function:
|
nuclear@0
|
638 * FT_Glyph_Stroke
|
nuclear@0
|
639 *
|
nuclear@0
|
640 * @description:
|
nuclear@0
|
641 * Stroke a given outline glyph object with a given stroker.
|
nuclear@0
|
642 *
|
nuclear@0
|
643 * @inout:
|
nuclear@0
|
644 * pglyph ::
|
nuclear@0
|
645 * Source glyph handle on input, new glyph handle on output.
|
nuclear@0
|
646 *
|
nuclear@0
|
647 * @input:
|
nuclear@0
|
648 * stroker ::
|
nuclear@0
|
649 * A stroker handle.
|
nuclear@0
|
650 *
|
nuclear@0
|
651 * destroy ::
|
nuclear@0
|
652 * A Boolean. If~1, the source glyph object is destroyed
|
nuclear@0
|
653 * on success.
|
nuclear@0
|
654 *
|
nuclear@0
|
655 * @return:
|
nuclear@0
|
656 * FreeType error code. 0~means success.
|
nuclear@0
|
657 *
|
nuclear@0
|
658 * @note:
|
nuclear@0
|
659 * The source glyph is untouched in case of error.
|
nuclear@0
|
660 */
|
nuclear@0
|
661 FT_EXPORT( FT_Error )
|
nuclear@0
|
662 FT_Glyph_Stroke( FT_Glyph *pglyph,
|
nuclear@0
|
663 FT_Stroker stroker,
|
nuclear@0
|
664 FT_Bool destroy );
|
nuclear@0
|
665
|
nuclear@0
|
666
|
nuclear@0
|
667 /**************************************************************
|
nuclear@0
|
668 *
|
nuclear@0
|
669 * @function:
|
nuclear@0
|
670 * FT_Glyph_StrokeBorder
|
nuclear@0
|
671 *
|
nuclear@0
|
672 * @description:
|
nuclear@0
|
673 * Stroke a given outline glyph object with a given stroker, but
|
nuclear@0
|
674 * only return either its inside or outside border.
|
nuclear@0
|
675 *
|
nuclear@0
|
676 * @inout:
|
nuclear@0
|
677 * pglyph ::
|
nuclear@0
|
678 * Source glyph handle on input, new glyph handle on output.
|
nuclear@0
|
679 *
|
nuclear@0
|
680 * @input:
|
nuclear@0
|
681 * stroker ::
|
nuclear@0
|
682 * A stroker handle.
|
nuclear@0
|
683 *
|
nuclear@0
|
684 * inside ::
|
nuclear@0
|
685 * A Boolean. If~1, return the inside border, otherwise
|
nuclear@0
|
686 * the outside border.
|
nuclear@0
|
687 *
|
nuclear@0
|
688 * destroy ::
|
nuclear@0
|
689 * A Boolean. If~1, the source glyph object is destroyed
|
nuclear@0
|
690 * on success.
|
nuclear@0
|
691 *
|
nuclear@0
|
692 * @return:
|
nuclear@0
|
693 * FreeType error code. 0~means success.
|
nuclear@0
|
694 *
|
nuclear@0
|
695 * @note:
|
nuclear@0
|
696 * The source glyph is untouched in case of error.
|
nuclear@0
|
697 */
|
nuclear@0
|
698 FT_EXPORT( FT_Error )
|
nuclear@0
|
699 FT_Glyph_StrokeBorder( FT_Glyph *pglyph,
|
nuclear@0
|
700 FT_Stroker stroker,
|
nuclear@0
|
701 FT_Bool inside,
|
nuclear@0
|
702 FT_Bool destroy );
|
nuclear@0
|
703
|
nuclear@0
|
704 /* */
|
nuclear@0
|
705
|
nuclear@0
|
706 FT_END_HEADER
|
nuclear@0
|
707
|
nuclear@0
|
708 #endif /* __FT_STROKE_H__ */
|
nuclear@0
|
709
|
nuclear@0
|
710
|
nuclear@0
|
711 /* END */
|
nuclear@0
|
712
|
nuclear@0
|
713
|
nuclear@0
|
714 /* Local Variables: */
|
nuclear@0
|
715 /* coding: utf-8 */
|
nuclear@0
|
716 /* End: */
|