|
|
|
@ -21,6 +21,7 @@ |
|
|
|
|
|
|
|
|
|
#include <ft2build.h> |
|
|
|
|
#include FT_OUTLINE_H |
|
|
|
|
#include FT_GLYPH_H |
|
|
|
|
|
|
|
|
|
FT_BEGIN_HEADER |
|
|
|
|
|
|
|
|
@ -128,7 +129,7 @@ FT_BEGIN_HEADER |
|
|
|
|
{ |
|
|
|
|
FT_STROKER_BORDER_LEFT = 0, |
|
|
|
|
FT_STROKER_BORDER_RIGHT |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} FT_StrokerBorder; |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -173,7 +174,7 @@ FT_BEGIN_HEADER |
|
|
|
|
FT_EXPORT( FT_StrokerBorder ) |
|
|
|
|
FT_Outline_GetOutsideBorder( FT_Outline* outline ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************
|
|
|
|
|
* |
|
|
|
|
* @function: |
|
|
|
@ -234,6 +235,24 @@ FT_BEGIN_HEADER |
|
|
|
|
FT_Fixed miter_limit ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************
|
|
|
|
|
* |
|
|
|
|
* @function: |
|
|
|
|
* FT_Stroker_Rewind |
|
|
|
|
* |
|
|
|
|
* @description: |
|
|
|
|
* Reset a stroker object without changing its attributes. |
|
|
|
|
* you should call this function before beginning a new |
|
|
|
|
* series of calls to @FT_Stroker_BeginSubPath/@FT_Stroker_EndSubPath |
|
|
|
|
* |
|
|
|
|
* @input: |
|
|
|
|
* stroker :: |
|
|
|
|
* The target stroker handle. |
|
|
|
|
*/ |
|
|
|
|
FT_EXPORT( void ) |
|
|
|
|
FT_Stroker_Rewind( FT_Stroker stroker ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************
|
|
|
|
|
* |
|
|
|
|
* @function: |
|
|
|
@ -264,6 +283,8 @@ FT_BEGIN_HEADER |
|
|
|
|
* |
|
|
|
|
* If `opened' is 1, the outline is processed as an open path, and the |
|
|
|
|
* stroker will generate a single `stroke' outline. |
|
|
|
|
* |
|
|
|
|
* this function calls @FT_Stroker_Rewind automatically |
|
|
|
|
*/ |
|
|
|
|
FT_EXPORT( FT_Error ) |
|
|
|
|
FT_Stroker_ParseOutline( FT_Stroker stroker, |
|
|
|
@ -278,7 +299,7 @@ FT_BEGIN_HEADER |
|
|
|
|
* |
|
|
|
|
* @description: |
|
|
|
|
* Start a new sub-path in the stroker. |
|
|
|
|
*
|
|
|
|
|
* |
|
|
|
|
* @input: |
|
|
|
|
* stroker :: |
|
|
|
|
* The target stroker handle. |
|
|
|
@ -309,7 +330,7 @@ FT_BEGIN_HEADER |
|
|
|
|
* |
|
|
|
|
* @description: |
|
|
|
|
* Close the current sub-path in the stroker. |
|
|
|
|
*
|
|
|
|
|
* |
|
|
|
|
* @input: |
|
|
|
|
* stroker :: |
|
|
|
|
* The target stroker handle. |
|
|
|
@ -334,7 +355,7 @@ FT_BEGIN_HEADER |
|
|
|
|
* @description: |
|
|
|
|
* `Draw' a single line segment in the stroker's current sub-path, |
|
|
|
|
* from the last position. |
|
|
|
|
*
|
|
|
|
|
* |
|
|
|
|
* @input: |
|
|
|
|
* stroker :: |
|
|
|
|
* The target stroker handle. |
|
|
|
@ -362,7 +383,7 @@ FT_BEGIN_HEADER |
|
|
|
|
* @description: |
|
|
|
|
* `Draw; a single quadratic bezier in the stroker's current sub-path, |
|
|
|
|
* from the last position. |
|
|
|
|
*
|
|
|
|
|
* |
|
|
|
|
* @input: |
|
|
|
|
* stroker :: |
|
|
|
|
* The target stroker handle. |
|
|
|
@ -394,7 +415,7 @@ FT_BEGIN_HEADER |
|
|
|
|
* @description: |
|
|
|
|
* `Draw' a single cubic Bézier in the stroker's current sub-path, |
|
|
|
|
* from the last position. |
|
|
|
|
*
|
|
|
|
|
* |
|
|
|
|
* @input: |
|
|
|
|
* stroker :: |
|
|
|
|
* The target stroker handle. |
|
|
|
@ -432,7 +453,7 @@ FT_BEGIN_HEADER |
|
|
|
|
* with the stroker. It will return the number of points and |
|
|
|
|
* contours necessary to export one of the `border' or `stroke' |
|
|
|
|
* outlines generated by the stroker. |
|
|
|
|
*
|
|
|
|
|
* |
|
|
|
|
* @input: |
|
|
|
|
* stroker :: |
|
|
|
|
* The target stroker handle. |
|
|
|
@ -453,7 +474,7 @@ FT_BEGIN_HEADER |
|
|
|
|
* @note: |
|
|
|
|
* When an outline, or a sub-path, is `closed', the stroker generates |
|
|
|
|
* two independent `border' outlines, named `left' and `right'. |
|
|
|
|
*
|
|
|
|
|
* |
|
|
|
|
* When the outline, or a sub-path, is `opened', the stroker merges |
|
|
|
|
* the `border' outlines with caps. The `left' border receives all |
|
|
|
|
* points, while the `right' border becomes empty. |
|
|
|
@ -477,7 +498,7 @@ FT_BEGIN_HEADER |
|
|
|
|
* Call this function after @FT_Stroker_GetBorderCounts to |
|
|
|
|
* export the corresponding border to your own @FT_Outline |
|
|
|
|
* structure. |
|
|
|
|
*
|
|
|
|
|
* |
|
|
|
|
* Note that this function will append the border points and |
|
|
|
|
* contours to your outline, but will not try to resize its |
|
|
|
|
* arrays. |
|
|
|
@ -499,7 +520,7 @@ FT_BEGIN_HEADER |
|
|
|
|
* |
|
|
|
|
* When an outline, or a sub-path, is `closed', the stroker generates |
|
|
|
|
* two independent `border' outlines, named `left' and `right' |
|
|
|
|
*
|
|
|
|
|
* |
|
|
|
|
* When the outline, or a sub-path, is `opened', the stroker merges |
|
|
|
|
* the `border' outlines with caps. The `left' border receives all |
|
|
|
|
* points, while the `right' border becomes empty. |
|
|
|
@ -523,7 +544,7 @@ FT_BEGIN_HEADER |
|
|
|
|
* with the stroker. It returns the number of points and |
|
|
|
|
* contours necessary to export all points/borders from the stroked |
|
|
|
|
* outline/path. |
|
|
|
|
*
|
|
|
|
|
* |
|
|
|
|
* @input: |
|
|
|
|
* stroker :: |
|
|
|
|
* The target stroker handle. |
|
|
|
@ -552,7 +573,7 @@ FT_BEGIN_HEADER |
|
|
|
|
* @description: |
|
|
|
|
* Call this function after @FT_Stroker_GetBorderCounts to |
|
|
|
|
* export the all borders to your own @FT_Outline structure. |
|
|
|
|
*
|
|
|
|
|
* |
|
|
|
|
* Note that this function will append the border points and |
|
|
|
|
* contours to your outline, but will not try to resize its |
|
|
|
|
* arrays. |
|
|
|
@ -584,6 +605,73 @@ FT_BEGIN_HEADER |
|
|
|
|
FT_EXPORT( void ) |
|
|
|
|
FT_Stroker_Done( FT_Stroker stroker ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************
|
|
|
|
|
* |
|
|
|
|
* @function: |
|
|
|
|
* FT_Glyph_Stroke |
|
|
|
|
* |
|
|
|
|
* @description: |
|
|
|
|
* stroke a given outline glyph object with a given stroker |
|
|
|
|
* |
|
|
|
|
* @inout: |
|
|
|
|
* pglyph :: source glyph handle on input, new glyph handle |
|
|
|
|
* on output. |
|
|
|
|
* |
|
|
|
|
* @input: |
|
|
|
|
* stroker :: |
|
|
|
|
* A stroker handle. |
|
|
|
|
* |
|
|
|
|
* destroy :: boolean. If TRUE, the source glyph object is destroyed |
|
|
|
|
* on success |
|
|
|
|
* |
|
|
|
|
* @return: |
|
|
|
|
* FreeType error code. 0 means success |
|
|
|
|
* |
|
|
|
|
* @note: |
|
|
|
|
* the source glyph is untouched in case of error. |
|
|
|
|
*/ |
|
|
|
|
FT_EXPORT( FT_Error ) |
|
|
|
|
FT_Glyph_Stroke( FT_Glyph *pglyph, |
|
|
|
|
FT_Stroker stroker, |
|
|
|
|
FT_Bool destroy ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**************************************************************
|
|
|
|
|
* |
|
|
|
|
* @function: |
|
|
|
|
* FT_Glyph_StrokeBorder |
|
|
|
|
* |
|
|
|
|
* @description: |
|
|
|
|
* stroke a given outline glyph object with a given stroker, but |
|
|
|
|
* only returns either its inside or outside border |
|
|
|
|
* |
|
|
|
|
* @inout: |
|
|
|
|
* pglyph :: source glyph handle on input, new glyph handle |
|
|
|
|
* on output. |
|
|
|
|
* |
|
|
|
|
* @input: |
|
|
|
|
* stroker :: |
|
|
|
|
* A stroker handle. |
|
|
|
|
* |
|
|
|
|
* inside :: boolean. If TRUE, return the inside border; otherwise, |
|
|
|
|
* the outside border |
|
|
|
|
* |
|
|
|
|
* destroy :: boolean. If TRUE, the source glyph object is destroyed |
|
|
|
|
* on success |
|
|
|
|
* |
|
|
|
|
* @return: |
|
|
|
|
* FreeType error code. 0 means success |
|
|
|
|
* |
|
|
|
|
* @note: |
|
|
|
|
* the source glyph is untouched in case of error. |
|
|
|
|
*/ |
|
|
|
|
FT_EXPORT( FT_Error ) |
|
|
|
|
FT_Glyph_StrokeBorder( FT_Glyph *pglyph, |
|
|
|
|
FT_Stroker stroker, |
|
|
|
|
FT_Bool inside, |
|
|
|
|
FT_Bool destroy ); |
|
|
|
|
|
|
|
|
|
/* */ |
|
|
|
|
|
|
|
|
|
FT_END_HEADER |
|
|
|
|