1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/modules/freetype2/include/ftstroke.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,751 @@ 1.4 +/***************************************************************************/ 1.5 +/* */ 1.6 +/* ftstroke.h */ 1.7 +/* */ 1.8 +/* FreeType path stroker (specification). */ 1.9 +/* */ 1.10 +/* Copyright 2002-2006, 2008, 2009, 2011-2012 by */ 1.11 +/* David Turner, Robert Wilhelm, and Werner Lemberg. */ 1.12 +/* */ 1.13 +/* This file is part of the FreeType project, and may only be used, */ 1.14 +/* modified, and distributed under the terms of the FreeType project */ 1.15 +/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ 1.16 +/* this file you indicate that you have read the license and */ 1.17 +/* understand and accept it fully. */ 1.18 +/* */ 1.19 +/***************************************************************************/ 1.20 + 1.21 + 1.22 +#ifndef __FT_STROKE_H__ 1.23 +#define __FT_STROKE_H__ 1.24 + 1.25 +#include <ft2build.h> 1.26 +#include FT_OUTLINE_H 1.27 +#include FT_GLYPH_H 1.28 + 1.29 + 1.30 +FT_BEGIN_HEADER 1.31 + 1.32 + 1.33 + /************************************************************************ 1.34 + * 1.35 + * @section: 1.36 + * glyph_stroker 1.37 + * 1.38 + * @title: 1.39 + * Glyph Stroker 1.40 + * 1.41 + * @abstract: 1.42 + * Generating bordered and stroked glyphs. 1.43 + * 1.44 + * @description: 1.45 + * This component generates stroked outlines of a given vectorial 1.46 + * glyph. It also allows you to retrieve the `outside' and/or the 1.47 + * `inside' borders of the stroke. 1.48 + * 1.49 + * This can be useful to generate `bordered' glyph, i.e., glyphs 1.50 + * displayed with a coloured (and anti-aliased) border around their 1.51 + * shape. 1.52 + */ 1.53 + 1.54 + 1.55 + /************************************************************** 1.56 + * 1.57 + * @type: 1.58 + * FT_Stroker 1.59 + * 1.60 + * @description: 1.61 + * Opaque handler to a path stroker object. 1.62 + */ 1.63 + typedef struct FT_StrokerRec_* FT_Stroker; 1.64 + 1.65 + 1.66 + /************************************************************** 1.67 + * 1.68 + * @enum: 1.69 + * FT_Stroker_LineJoin 1.70 + * 1.71 + * @description: 1.72 + * These values determine how two joining lines are rendered 1.73 + * in a stroker. 1.74 + * 1.75 + * @values: 1.76 + * FT_STROKER_LINEJOIN_ROUND :: 1.77 + * Used to render rounded line joins. Circular arcs are used 1.78 + * to join two lines smoothly. 1.79 + * 1.80 + * FT_STROKER_LINEJOIN_BEVEL :: 1.81 + * Used to render beveled line joins. The outer corner of 1.82 + * the joined lines is filled by enclosing the triangular 1.83 + * region of the corner with a straight line between the 1.84 + * outer corners of each stroke. 1.85 + * 1.86 + * FT_STROKER_LINEJOIN_MITER_FIXED :: 1.87 + * Used to render mitered line joins, with fixed bevels if the 1.88 + * miter limit is exceeded. The outer edges of the strokes 1.89 + * for the two segments are extended until they meet at an 1.90 + * angle. If the segments meet at too sharp an angle (such 1.91 + * that the miter would extend from the intersection of the 1.92 + * segments a distance greater than the product of the miter 1.93 + * limit value and the border radius), then a bevel join (see 1.94 + * above) is used instead. This prevents long spikes being 1.95 + * created. FT_STROKER_LINEJOIN_MITER_FIXED generates a miter 1.96 + * line join as used in PostScript and PDF. 1.97 + * 1.98 + * FT_STROKER_LINEJOIN_MITER_VARIABLE :: 1.99 + * FT_STROKER_LINEJOIN_MITER :: 1.100 + * Used to render mitered line joins, with variable bevels if 1.101 + * the miter limit is exceeded. The intersection of the 1.102 + * strokes is clipped at a line perpendicular to the bisector 1.103 + * of the angle between the strokes, at the distance from the 1.104 + * intersection of the segments equal to the product of the 1.105 + * miter limit value and the border radius. This prevents 1.106 + * long spikes being created. 1.107 + * FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line 1.108 + * join as used in XPS. FT_STROKER_LINEJOIN_MITER is an alias 1.109 + * for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for 1.110 + * backwards compatibility. 1.111 + */ 1.112 + typedef enum FT_Stroker_LineJoin_ 1.113 + { 1.114 + FT_STROKER_LINEJOIN_ROUND = 0, 1.115 + FT_STROKER_LINEJOIN_BEVEL = 1, 1.116 + FT_STROKER_LINEJOIN_MITER_VARIABLE = 2, 1.117 + FT_STROKER_LINEJOIN_MITER = FT_STROKER_LINEJOIN_MITER_VARIABLE, 1.118 + FT_STROKER_LINEJOIN_MITER_FIXED = 3 1.119 + 1.120 + } FT_Stroker_LineJoin; 1.121 + 1.122 + 1.123 + /************************************************************** 1.124 + * 1.125 + * @enum: 1.126 + * FT_Stroker_LineCap 1.127 + * 1.128 + * @description: 1.129 + * These values determine how the end of opened sub-paths are 1.130 + * rendered in a stroke. 1.131 + * 1.132 + * @values: 1.133 + * FT_STROKER_LINECAP_BUTT :: 1.134 + * The end of lines is rendered as a full stop on the last 1.135 + * point itself. 1.136 + * 1.137 + * FT_STROKER_LINECAP_ROUND :: 1.138 + * The end of lines is rendered as a half-circle around the 1.139 + * last point. 1.140 + * 1.141 + * FT_STROKER_LINECAP_SQUARE :: 1.142 + * The end of lines is rendered as a square around the 1.143 + * last point. 1.144 + */ 1.145 + typedef enum FT_Stroker_LineCap_ 1.146 + { 1.147 + FT_STROKER_LINECAP_BUTT = 0, 1.148 + FT_STROKER_LINECAP_ROUND, 1.149 + FT_STROKER_LINECAP_SQUARE 1.150 + 1.151 + } FT_Stroker_LineCap; 1.152 + 1.153 + 1.154 + /************************************************************** 1.155 + * 1.156 + * @enum: 1.157 + * FT_StrokerBorder 1.158 + * 1.159 + * @description: 1.160 + * These values are used to select a given stroke border 1.161 + * in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder. 1.162 + * 1.163 + * @values: 1.164 + * FT_STROKER_BORDER_LEFT :: 1.165 + * Select the left border, relative to the drawing direction. 1.166 + * 1.167 + * FT_STROKER_BORDER_RIGHT :: 1.168 + * Select the right border, relative to the drawing direction. 1.169 + * 1.170 + * @note: 1.171 + * Applications are generally interested in the `inside' and `outside' 1.172 + * borders. However, there is no direct mapping between these and the 1.173 + * `left' and `right' ones, since this really depends on the glyph's 1.174 + * drawing orientation, which varies between font formats. 1.175 + * 1.176 + * You can however use @FT_Outline_GetInsideBorder and 1.177 + * @FT_Outline_GetOutsideBorder to get these. 1.178 + */ 1.179 + typedef enum FT_StrokerBorder_ 1.180 + { 1.181 + FT_STROKER_BORDER_LEFT = 0, 1.182 + FT_STROKER_BORDER_RIGHT 1.183 + 1.184 + } FT_StrokerBorder; 1.185 + 1.186 + 1.187 + /************************************************************** 1.188 + * 1.189 + * @function: 1.190 + * FT_Outline_GetInsideBorder 1.191 + * 1.192 + * @description: 1.193 + * Retrieve the @FT_StrokerBorder value corresponding to the 1.194 + * `inside' borders of a given outline. 1.195 + * 1.196 + * @input: 1.197 + * outline :: 1.198 + * The source outline handle. 1.199 + * 1.200 + * @return: 1.201 + * The border index. @FT_STROKER_BORDER_RIGHT for empty or invalid 1.202 + * outlines. 1.203 + */ 1.204 + FT_EXPORT( FT_StrokerBorder ) 1.205 + FT_Outline_GetInsideBorder( FT_Outline* outline ); 1.206 + 1.207 + 1.208 + /************************************************************** 1.209 + * 1.210 + * @function: 1.211 + * FT_Outline_GetOutsideBorder 1.212 + * 1.213 + * @description: 1.214 + * Retrieve the @FT_StrokerBorder value corresponding to the 1.215 + * `outside' borders of a given outline. 1.216 + * 1.217 + * @input: 1.218 + * outline :: 1.219 + * The source outline handle. 1.220 + * 1.221 + * @return: 1.222 + * The border index. @FT_STROKER_BORDER_LEFT for empty or invalid 1.223 + * outlines. 1.224 + */ 1.225 + FT_EXPORT( FT_StrokerBorder ) 1.226 + FT_Outline_GetOutsideBorder( FT_Outline* outline ); 1.227 + 1.228 + 1.229 + /************************************************************** 1.230 + * 1.231 + * @function: 1.232 + * FT_Stroker_New 1.233 + * 1.234 + * @description: 1.235 + * Create a new stroker object. 1.236 + * 1.237 + * @input: 1.238 + * library :: 1.239 + * FreeType library handle. 1.240 + * 1.241 + * @output: 1.242 + * astroker :: 1.243 + * A new stroker object handle. NULL in case of error. 1.244 + * 1.245 + * @return: 1.246 + * FreeType error code. 0~means success. 1.247 + */ 1.248 + FT_EXPORT( FT_Error ) 1.249 + FT_Stroker_New( FT_Library library, 1.250 + FT_Stroker *astroker ); 1.251 + 1.252 + 1.253 + /************************************************************** 1.254 + * 1.255 + * @function: 1.256 + * FT_Stroker_Set 1.257 + * 1.258 + * @description: 1.259 + * Reset a stroker object's attributes. 1.260 + * 1.261 + * @input: 1.262 + * stroker :: 1.263 + * The target stroker handle. 1.264 + * 1.265 + * radius :: 1.266 + * The border radius. 1.267 + * 1.268 + * line_cap :: 1.269 + * The line cap style. 1.270 + * 1.271 + * line_join :: 1.272 + * The line join style. 1.273 + * 1.274 + * miter_limit :: 1.275 + * The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and 1.276 + * FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles, 1.277 + * expressed as 16.16 fixed-point value. 1.278 + * 1.279 + * @note: 1.280 + * The radius is expressed in the same units as the outline 1.281 + * coordinates. 1.282 + */ 1.283 + FT_EXPORT( void ) 1.284 + FT_Stroker_Set( FT_Stroker stroker, 1.285 + FT_Fixed radius, 1.286 + FT_Stroker_LineCap line_cap, 1.287 + FT_Stroker_LineJoin line_join, 1.288 + FT_Fixed miter_limit ); 1.289 + 1.290 + 1.291 + /************************************************************** 1.292 + * 1.293 + * @function: 1.294 + * FT_Stroker_Rewind 1.295 + * 1.296 + * @description: 1.297 + * Reset a stroker object without changing its attributes. 1.298 + * You should call this function before beginning a new 1.299 + * series of calls to @FT_Stroker_BeginSubPath or 1.300 + * @FT_Stroker_EndSubPath. 1.301 + * 1.302 + * @input: 1.303 + * stroker :: 1.304 + * The target stroker handle. 1.305 + */ 1.306 + FT_EXPORT( void ) 1.307 + FT_Stroker_Rewind( FT_Stroker stroker ); 1.308 + 1.309 + 1.310 + /************************************************************** 1.311 + * 1.312 + * @function: 1.313 + * FT_Stroker_ParseOutline 1.314 + * 1.315 + * @description: 1.316 + * A convenience function used to parse a whole outline with 1.317 + * the stroker. The resulting outline(s) can be retrieved 1.318 + * later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export. 1.319 + * 1.320 + * @input: 1.321 + * stroker :: 1.322 + * The target stroker handle. 1.323 + * 1.324 + * outline :: 1.325 + * The source outline. 1.326 + * 1.327 + * opened :: 1.328 + * A boolean. If~1, the outline is treated as an open path instead 1.329 + * of a closed one. 1.330 + * 1.331 + * @return: 1.332 + * FreeType error code. 0~means success. 1.333 + * 1.334 + * @note: 1.335 + * If `opened' is~0 (the default), the outline is treated as a closed 1.336 + * path, and the stroker generates two distinct `border' outlines. 1.337 + * 1.338 + * If `opened' is~1, the outline is processed as an open path, and the 1.339 + * stroker generates a single `stroke' outline. 1.340 + * 1.341 + * This function calls @FT_Stroker_Rewind automatically. 1.342 + */ 1.343 + FT_EXPORT( FT_Error ) 1.344 + FT_Stroker_ParseOutline( FT_Stroker stroker, 1.345 + FT_Outline* outline, 1.346 + FT_Bool opened ); 1.347 + 1.348 + 1.349 + /************************************************************** 1.350 + * 1.351 + * @function: 1.352 + * FT_Stroker_BeginSubPath 1.353 + * 1.354 + * @description: 1.355 + * Start a new sub-path in the stroker. 1.356 + * 1.357 + * @input: 1.358 + * stroker :: 1.359 + * The target stroker handle. 1.360 + * 1.361 + * to :: 1.362 + * A pointer to the start vector. 1.363 + * 1.364 + * open :: 1.365 + * A boolean. If~1, the sub-path is treated as an open one. 1.366 + * 1.367 + * @return: 1.368 + * FreeType error code. 0~means success. 1.369 + * 1.370 + * @note: 1.371 + * This function is useful when you need to stroke a path that is 1.372 + * not stored as an @FT_Outline object. 1.373 + */ 1.374 + FT_EXPORT( FT_Error ) 1.375 + FT_Stroker_BeginSubPath( FT_Stroker stroker, 1.376 + FT_Vector* to, 1.377 + FT_Bool open ); 1.378 + 1.379 + 1.380 + /************************************************************** 1.381 + * 1.382 + * @function: 1.383 + * FT_Stroker_EndSubPath 1.384 + * 1.385 + * @description: 1.386 + * Close the current sub-path in the stroker. 1.387 + * 1.388 + * @input: 1.389 + * stroker :: 1.390 + * The target stroker handle. 1.391 + * 1.392 + * @return: 1.393 + * FreeType error code. 0~means success. 1.394 + * 1.395 + * @note: 1.396 + * You should call this function after @FT_Stroker_BeginSubPath. 1.397 + * If the subpath was not `opened', this function `draws' a 1.398 + * single line segment to the start position when needed. 1.399 + */ 1.400 + FT_EXPORT( FT_Error ) 1.401 + FT_Stroker_EndSubPath( FT_Stroker stroker ); 1.402 + 1.403 + 1.404 + /************************************************************** 1.405 + * 1.406 + * @function: 1.407 + * FT_Stroker_LineTo 1.408 + * 1.409 + * @description: 1.410 + * `Draw' a single line segment in the stroker's current sub-path, 1.411 + * from the last position. 1.412 + * 1.413 + * @input: 1.414 + * stroker :: 1.415 + * The target stroker handle. 1.416 + * 1.417 + * to :: 1.418 + * A pointer to the destination point. 1.419 + * 1.420 + * @return: 1.421 + * FreeType error code. 0~means success. 1.422 + * 1.423 + * @note: 1.424 + * You should call this function between @FT_Stroker_BeginSubPath and 1.425 + * @FT_Stroker_EndSubPath. 1.426 + */ 1.427 + FT_EXPORT( FT_Error ) 1.428 + FT_Stroker_LineTo( FT_Stroker stroker, 1.429 + FT_Vector* to ); 1.430 + 1.431 + 1.432 + /************************************************************** 1.433 + * 1.434 + * @function: 1.435 + * FT_Stroker_ConicTo 1.436 + * 1.437 + * @description: 1.438 + * `Draw' a single quadratic Bézier in the stroker's current sub-path, 1.439 + * from the last position. 1.440 + * 1.441 + * @input: 1.442 + * stroker :: 1.443 + * The target stroker handle. 1.444 + * 1.445 + * control :: 1.446 + * A pointer to a Bézier control point. 1.447 + * 1.448 + * to :: 1.449 + * A pointer to the destination point. 1.450 + * 1.451 + * @return: 1.452 + * FreeType error code. 0~means success. 1.453 + * 1.454 + * @note: 1.455 + * You should call this function between @FT_Stroker_BeginSubPath and 1.456 + * @FT_Stroker_EndSubPath. 1.457 + */ 1.458 + FT_EXPORT( FT_Error ) 1.459 + FT_Stroker_ConicTo( FT_Stroker stroker, 1.460 + FT_Vector* control, 1.461 + FT_Vector* to ); 1.462 + 1.463 + 1.464 + /************************************************************** 1.465 + * 1.466 + * @function: 1.467 + * FT_Stroker_CubicTo 1.468 + * 1.469 + * @description: 1.470 + * `Draw' a single cubic Bézier in the stroker's current sub-path, 1.471 + * from the last position. 1.472 + * 1.473 + * @input: 1.474 + * stroker :: 1.475 + * The target stroker handle. 1.476 + * 1.477 + * control1 :: 1.478 + * A pointer to the first Bézier control point. 1.479 + * 1.480 + * control2 :: 1.481 + * A pointer to second Bézier control point. 1.482 + * 1.483 + * to :: 1.484 + * A pointer to the destination point. 1.485 + * 1.486 + * @return: 1.487 + * FreeType error code. 0~means success. 1.488 + * 1.489 + * @note: 1.490 + * You should call this function between @FT_Stroker_BeginSubPath and 1.491 + * @FT_Stroker_EndSubPath. 1.492 + */ 1.493 + FT_EXPORT( FT_Error ) 1.494 + FT_Stroker_CubicTo( FT_Stroker stroker, 1.495 + FT_Vector* control1, 1.496 + FT_Vector* control2, 1.497 + FT_Vector* to ); 1.498 + 1.499 + 1.500 + /************************************************************** 1.501 + * 1.502 + * @function: 1.503 + * FT_Stroker_GetBorderCounts 1.504 + * 1.505 + * @description: 1.506 + * Call this function once you have finished parsing your paths 1.507 + * with the stroker. It returns the number of points and 1.508 + * contours necessary to export one of the `border' or `stroke' 1.509 + * outlines generated by the stroker. 1.510 + * 1.511 + * @input: 1.512 + * stroker :: 1.513 + * The target stroker handle. 1.514 + * 1.515 + * border :: 1.516 + * The border index. 1.517 + * 1.518 + * @output: 1.519 + * anum_points :: 1.520 + * The number of points. 1.521 + * 1.522 + * anum_contours :: 1.523 + * The number of contours. 1.524 + * 1.525 + * @return: 1.526 + * FreeType error code. 0~means success. 1.527 + * 1.528 + * @note: 1.529 + * When an outline, or a sub-path, is `closed', the stroker generates 1.530 + * two independent `border' outlines, named `left' and `right'. 1.531 + * 1.532 + * When the outline, or a sub-path, is `opened', the stroker merges 1.533 + * the `border' outlines with caps. The `left' border receives all 1.534 + * points, while the `right' border becomes empty. 1.535 + * 1.536 + * Use the function @FT_Stroker_GetCounts instead if you want to 1.537 + * retrieve the counts associated to both borders. 1.538 + */ 1.539 + FT_EXPORT( FT_Error ) 1.540 + FT_Stroker_GetBorderCounts( FT_Stroker stroker, 1.541 + FT_StrokerBorder border, 1.542 + FT_UInt *anum_points, 1.543 + FT_UInt *anum_contours ); 1.544 + 1.545 + 1.546 + /************************************************************** 1.547 + * 1.548 + * @function: 1.549 + * FT_Stroker_ExportBorder 1.550 + * 1.551 + * @description: 1.552 + * Call this function after @FT_Stroker_GetBorderCounts to 1.553 + * export the corresponding border to your own @FT_Outline 1.554 + * structure. 1.555 + * 1.556 + * Note that this function appends the border points and 1.557 + * contours to your outline, but does not try to resize its 1.558 + * arrays. 1.559 + * 1.560 + * @input: 1.561 + * stroker :: 1.562 + * The target stroker handle. 1.563 + * 1.564 + * border :: 1.565 + * The border index. 1.566 + * 1.567 + * outline :: 1.568 + * The target outline handle. 1.569 + * 1.570 + * @note: 1.571 + * Always call this function after @FT_Stroker_GetBorderCounts to 1.572 + * get sure that there is enough room in your @FT_Outline object to 1.573 + * receive all new data. 1.574 + * 1.575 + * When an outline, or a sub-path, is `closed', the stroker generates 1.576 + * two independent `border' outlines, named `left' and `right' 1.577 + * 1.578 + * When the outline, or a sub-path, is `opened', the stroker merges 1.579 + * the `border' outlines with caps. The `left' border receives all 1.580 + * points, while the `right' border becomes empty. 1.581 + * 1.582 + * Use the function @FT_Stroker_Export instead if you want to 1.583 + * retrieve all borders at once. 1.584 + */ 1.585 + FT_EXPORT( void ) 1.586 + FT_Stroker_ExportBorder( FT_Stroker stroker, 1.587 + FT_StrokerBorder border, 1.588 + FT_Outline* outline ); 1.589 + 1.590 + 1.591 + /************************************************************** 1.592 + * 1.593 + * @function: 1.594 + * FT_Stroker_GetCounts 1.595 + * 1.596 + * @description: 1.597 + * Call this function once you have finished parsing your paths 1.598 + * with the stroker. It returns the number of points and 1.599 + * contours necessary to export all points/borders from the stroked 1.600 + * outline/path. 1.601 + * 1.602 + * @input: 1.603 + * stroker :: 1.604 + * The target stroker handle. 1.605 + * 1.606 + * @output: 1.607 + * anum_points :: 1.608 + * The number of points. 1.609 + * 1.610 + * anum_contours :: 1.611 + * The number of contours. 1.612 + * 1.613 + * @return: 1.614 + * FreeType error code. 0~means success. 1.615 + */ 1.616 + FT_EXPORT( FT_Error ) 1.617 + FT_Stroker_GetCounts( FT_Stroker stroker, 1.618 + FT_UInt *anum_points, 1.619 + FT_UInt *anum_contours ); 1.620 + 1.621 + 1.622 + /************************************************************** 1.623 + * 1.624 + * @function: 1.625 + * FT_Stroker_Export 1.626 + * 1.627 + * @description: 1.628 + * Call this function after @FT_Stroker_GetBorderCounts to 1.629 + * export all borders to your own @FT_Outline structure. 1.630 + * 1.631 + * Note that this function appends the border points and 1.632 + * contours to your outline, but does not try to resize its 1.633 + * arrays. 1.634 + * 1.635 + * @input: 1.636 + * stroker :: 1.637 + * The target stroker handle. 1.638 + * 1.639 + * outline :: 1.640 + * The target outline handle. 1.641 + */ 1.642 + FT_EXPORT( void ) 1.643 + FT_Stroker_Export( FT_Stroker stroker, 1.644 + FT_Outline* outline ); 1.645 + 1.646 + 1.647 + /************************************************************** 1.648 + * 1.649 + * @function: 1.650 + * FT_Stroker_Done 1.651 + * 1.652 + * @description: 1.653 + * Destroy a stroker object. 1.654 + * 1.655 + * @input: 1.656 + * stroker :: 1.657 + * A stroker handle. Can be NULL. 1.658 + */ 1.659 + FT_EXPORT( void ) 1.660 + FT_Stroker_Done( FT_Stroker stroker ); 1.661 + 1.662 + 1.663 + /************************************************************** 1.664 + * 1.665 + * @function: 1.666 + * FT_Glyph_Stroke 1.667 + * 1.668 + * @description: 1.669 + * Stroke a given outline glyph object with a given stroker. 1.670 + * 1.671 + * @inout: 1.672 + * pglyph :: 1.673 + * Source glyph handle on input, new glyph handle on output. 1.674 + * 1.675 + * @input: 1.676 + * stroker :: 1.677 + * A stroker handle. 1.678 + * 1.679 + * destroy :: 1.680 + * A Boolean. If~1, the source glyph object is destroyed 1.681 + * on success. 1.682 + * 1.683 + * @return: 1.684 + * FreeType error code. 0~means success. 1.685 + * 1.686 + * @note: 1.687 + * The source glyph is untouched in case of error. 1.688 + * 1.689 + * Adding stroke may yield a significantly wider and taller glyph 1.690 + * depending on how large of a radius was used to stroke the glyph. You 1.691 + * may need to manually adjust horizontal and vertical advance amounts 1.692 + * to account for this added size. 1.693 + */ 1.694 + FT_EXPORT( FT_Error ) 1.695 + FT_Glyph_Stroke( FT_Glyph *pglyph, 1.696 + FT_Stroker stroker, 1.697 + FT_Bool destroy ); 1.698 + 1.699 + 1.700 + /************************************************************** 1.701 + * 1.702 + * @function: 1.703 + * FT_Glyph_StrokeBorder 1.704 + * 1.705 + * @description: 1.706 + * Stroke a given outline glyph object with a given stroker, but 1.707 + * only return either its inside or outside border. 1.708 + * 1.709 + * @inout: 1.710 + * pglyph :: 1.711 + * Source glyph handle on input, new glyph handle on output. 1.712 + * 1.713 + * @input: 1.714 + * stroker :: 1.715 + * A stroker handle. 1.716 + * 1.717 + * inside :: 1.718 + * A Boolean. If~1, return the inside border, otherwise 1.719 + * the outside border. 1.720 + * 1.721 + * destroy :: 1.722 + * A Boolean. If~1, the source glyph object is destroyed 1.723 + * on success. 1.724 + * 1.725 + * @return: 1.726 + * FreeType error code. 0~means success. 1.727 + * 1.728 + * @note: 1.729 + * The source glyph is untouched in case of error. 1.730 + * 1.731 + * Adding stroke may yield a significantly wider and taller glyph 1.732 + * depending on how large of a radius was used to stroke the glyph. You 1.733 + * may need to manually adjust horizontal and vertical advance amounts 1.734 + * to account for this added size. 1.735 + */ 1.736 + FT_EXPORT( FT_Error ) 1.737 + FT_Glyph_StrokeBorder( FT_Glyph *pglyph, 1.738 + FT_Stroker stroker, 1.739 + FT_Bool inside, 1.740 + FT_Bool destroy ); 1.741 + 1.742 + /* */ 1.743 + 1.744 +FT_END_HEADER 1.745 + 1.746 +#endif /* __FT_STROKE_H__ */ 1.747 + 1.748 + 1.749 +/* END */ 1.750 + 1.751 + 1.752 +/* Local Variables: */ 1.753 +/* coding: utf-8 */ 1.754 +/* End: */