Blame include/freetype/ftstroke.h

Packit cf904d
/***************************************************************************/
Packit cf904d
/*                                                                         */
Packit cf904d
/*  ftstroke.h                                                             */
Packit cf904d
/*                                                                         */
Packit cf904d
/*    FreeType path stroker (specification).                               */
Packit cf904d
/*                                                                         */
Packit cf904d
/*  Copyright 2002-2017 by                                                 */
Packit cf904d
/*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
Packit cf904d
/*                                                                         */
Packit cf904d
/*  This file is part of the FreeType project, and may only be used,       */
Packit cf904d
/*  modified, and distributed under the terms of the FreeType project      */
Packit cf904d
/*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
Packit cf904d
/*  this file you indicate that you have read the license and              */
Packit cf904d
/*  understand and accept it fully.                                        */
Packit cf904d
/*                                                                         */
Packit cf904d
/***************************************************************************/
Packit cf904d
Packit cf904d
Packit cf904d
#ifndef FTSTROKE_H_
Packit cf904d
#define FTSTROKE_H_
Packit cf904d
Packit cf904d
#include <ft2build.h>
Packit cf904d
#include FT_OUTLINE_H
Packit cf904d
#include FT_GLYPH_H
Packit cf904d
Packit cf904d
Packit cf904d
FT_BEGIN_HEADER
Packit cf904d
Packit cf904d
Packit cf904d
 /************************************************************************
Packit cf904d
  *
Packit cf904d
  * @section:
Packit cf904d
  *    glyph_stroker
Packit cf904d
  *
Packit cf904d
  * @title:
Packit cf904d
  *    Glyph Stroker
Packit cf904d
  *
Packit cf904d
  * @abstract:
Packit cf904d
  *    Generating bordered and stroked glyphs.
Packit cf904d
  *
Packit cf904d
  * @description:
Packit cf904d
  *    This component generates stroked outlines of a given vectorial
Packit cf904d
  *    glyph.  It also allows you to retrieve the `outside' and/or the
Packit cf904d
  *    `inside' borders of the stroke.
Packit cf904d
  *
Packit cf904d
  *    This can be useful to generate `bordered' glyph, i.e., glyphs
Packit cf904d
  *    displayed with a coloured (and anti-aliased) border around their
Packit cf904d
  *    shape.
Packit cf904d
  *
Packit cf904d
  * @order:
Packit cf904d
  *    FT_Stroker
Packit cf904d
  *
Packit cf904d
  *    FT_Stroker_LineJoin
Packit cf904d
  *    FT_Stroker_LineCap
Packit cf904d
  *    FT_StrokerBorder
Packit cf904d
  *
Packit cf904d
  *    FT_Outline_GetInsideBorder
Packit cf904d
  *    FT_Outline_GetOutsideBorder
Packit cf904d
  *
Packit cf904d
  *    FT_Glyph_Stroke
Packit cf904d
  *    FT_Glyph_StrokeBorder
Packit cf904d
  *
Packit cf904d
  *    FT_Stroker_New
Packit cf904d
  *    FT_Stroker_Set
Packit cf904d
  *    FT_Stroker_Rewind
Packit cf904d
  *    FT_Stroker_ParseOutline
Packit cf904d
  *    FT_Stroker_Done
Packit cf904d
  *
Packit cf904d
  *    FT_Stroker_BeginSubPath
Packit cf904d
  *    FT_Stroker_EndSubPath
Packit cf904d
  *
Packit cf904d
  *    FT_Stroker_LineTo
Packit cf904d
  *    FT_Stroker_ConicTo
Packit cf904d
  *    FT_Stroker_CubicTo
Packit cf904d
  *
Packit cf904d
  *    FT_Stroker_GetBorderCounts
Packit cf904d
  *    FT_Stroker_ExportBorder
Packit cf904d
  *    FT_Stroker_GetCounts
Packit cf904d
  *    FT_Stroker_Export
Packit cf904d
  *
Packit cf904d
  */
Packit cf904d
Packit cf904d
Packit cf904d
 /**************************************************************
Packit cf904d
  *
Packit cf904d
  * @type:
Packit cf904d
  *   FT_Stroker
Packit cf904d
  *
Packit cf904d
  * @description:
Packit cf904d
  *   Opaque handle to a path stroker object.
Packit cf904d
  */
Packit cf904d
  typedef struct FT_StrokerRec_*  FT_Stroker;
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @enum:
Packit cf904d
   *   FT_Stroker_LineJoin
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   These values determine how two joining lines are rendered
Packit cf904d
   *   in a stroker.
Packit cf904d
   *
Packit cf904d
   * @values:
Packit cf904d
   *   FT_STROKER_LINEJOIN_ROUND ::
Packit cf904d
   *     Used to render rounded line joins.  Circular arcs are used
Packit cf904d
   *     to join two lines smoothly.
Packit cf904d
   *
Packit cf904d
   *   FT_STROKER_LINEJOIN_BEVEL ::
Packit cf904d
   *     Used to render beveled line joins.  The outer corner of
Packit cf904d
   *     the joined lines is filled by enclosing the triangular
Packit cf904d
   *     region of the corner with a straight line between the
Packit cf904d
   *     outer corners of each stroke.
Packit cf904d
   *
Packit cf904d
   *   FT_STROKER_LINEJOIN_MITER_FIXED ::
Packit cf904d
   *     Used to render mitered line joins, with fixed bevels if the
Packit cf904d
   *     miter limit is exceeded.  The outer edges of the strokes
Packit cf904d
   *     for the two segments are extended until they meet at an
Packit cf904d
   *     angle.  If the segments meet at too sharp an angle (such
Packit cf904d
   *     that the miter would extend from the intersection of the
Packit cf904d
   *     segments a distance greater than the product of the miter
Packit cf904d
   *     limit value and the border radius), then a bevel join (see
Packit cf904d
   *     above) is used instead.  This prevents long spikes being
Packit cf904d
   *     created.  FT_STROKER_LINEJOIN_MITER_FIXED generates a miter
Packit cf904d
   *     line join as used in PostScript and PDF.
Packit cf904d
   *
Packit cf904d
   *   FT_STROKER_LINEJOIN_MITER_VARIABLE ::
Packit cf904d
   *   FT_STROKER_LINEJOIN_MITER ::
Packit cf904d
   *     Used to render mitered line joins, with variable bevels if
Packit cf904d
   *     the miter limit is exceeded.  The intersection of the
Packit cf904d
   *     strokes is clipped at a line perpendicular to the bisector
Packit cf904d
   *     of the angle between the strokes, at the distance from the
Packit cf904d
   *     intersection of the segments equal to the product of the
Packit cf904d
   *     miter limit value and the border radius.  This prevents
Packit cf904d
   *     long spikes being created.
Packit cf904d
   *     FT_STROKER_LINEJOIN_MITER_VARIABLE generates a mitered line
Packit cf904d
   *     join as used in XPS.  FT_STROKER_LINEJOIN_MITER is an alias
Packit cf904d
   *     for FT_STROKER_LINEJOIN_MITER_VARIABLE, retained for
Packit cf904d
   *     backward compatibility.
Packit cf904d
   */
Packit cf904d
  typedef enum  FT_Stroker_LineJoin_
Packit cf904d
  {
Packit cf904d
    FT_STROKER_LINEJOIN_ROUND          = 0,
Packit cf904d
    FT_STROKER_LINEJOIN_BEVEL          = 1,
Packit cf904d
    FT_STROKER_LINEJOIN_MITER_VARIABLE = 2,
Packit cf904d
    FT_STROKER_LINEJOIN_MITER          = FT_STROKER_LINEJOIN_MITER_VARIABLE,
Packit cf904d
    FT_STROKER_LINEJOIN_MITER_FIXED    = 3
Packit cf904d
Packit cf904d
  } FT_Stroker_LineJoin;
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @enum:
Packit cf904d
   *   FT_Stroker_LineCap
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   These values determine how the end of opened sub-paths are
Packit cf904d
   *   rendered in a stroke.
Packit cf904d
   *
Packit cf904d
   * @values:
Packit cf904d
   *   FT_STROKER_LINECAP_BUTT ::
Packit cf904d
   *     The end of lines is rendered as a full stop on the last
Packit cf904d
   *     point itself.
Packit cf904d
   *
Packit cf904d
   *   FT_STROKER_LINECAP_ROUND ::
Packit cf904d
   *     The end of lines is rendered as a half-circle around the
Packit cf904d
   *     last point.
Packit cf904d
   *
Packit cf904d
   *   FT_STROKER_LINECAP_SQUARE ::
Packit cf904d
   *     The end of lines is rendered as a square around the
Packit cf904d
   *     last point.
Packit cf904d
   */
Packit cf904d
  typedef enum  FT_Stroker_LineCap_
Packit cf904d
  {
Packit cf904d
    FT_STROKER_LINECAP_BUTT = 0,
Packit cf904d
    FT_STROKER_LINECAP_ROUND,
Packit cf904d
    FT_STROKER_LINECAP_SQUARE
Packit cf904d
Packit cf904d
  } FT_Stroker_LineCap;
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @enum:
Packit cf904d
   *   FT_StrokerBorder
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   These values are used to select a given stroke border
Packit cf904d
   *   in @FT_Stroker_GetBorderCounts and @FT_Stroker_ExportBorder.
Packit cf904d
   *
Packit cf904d
   * @values:
Packit cf904d
   *   FT_STROKER_BORDER_LEFT ::
Packit cf904d
   *     Select the left border, relative to the drawing direction.
Packit cf904d
   *
Packit cf904d
   *   FT_STROKER_BORDER_RIGHT ::
Packit cf904d
   *     Select the right border, relative to the drawing direction.
Packit cf904d
   *
Packit cf904d
   * @note:
Packit cf904d
   *   Applications are generally interested in the `inside' and `outside'
Packit cf904d
   *   borders.  However, there is no direct mapping between these and the
Packit cf904d
   *   `left' and `right' ones, since this really depends on the glyph's
Packit cf904d
   *   drawing orientation, which varies between font formats.
Packit cf904d
   *
Packit cf904d
   *   You can however use @FT_Outline_GetInsideBorder and
Packit cf904d
   *   @FT_Outline_GetOutsideBorder to get these.
Packit cf904d
   */
Packit cf904d
  typedef enum  FT_StrokerBorder_
Packit cf904d
  {
Packit cf904d
    FT_STROKER_BORDER_LEFT = 0,
Packit cf904d
    FT_STROKER_BORDER_RIGHT
Packit cf904d
Packit cf904d
  } FT_StrokerBorder;
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Outline_GetInsideBorder
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   Retrieve the @FT_StrokerBorder value corresponding to the
Packit cf904d
   *   `inside' borders of a given outline.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   outline ::
Packit cf904d
   *     The source outline handle.
Packit cf904d
   *
Packit cf904d
   * @return:
Packit cf904d
   *   The border index.  @FT_STROKER_BORDER_RIGHT for empty or invalid
Packit cf904d
   *   outlines.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( FT_StrokerBorder )
Packit cf904d
  FT_Outline_GetInsideBorder( FT_Outline*  outline );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Outline_GetOutsideBorder
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   Retrieve the @FT_StrokerBorder value corresponding to the
Packit cf904d
   *   `outside' borders of a given outline.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   outline ::
Packit cf904d
   *     The source outline handle.
Packit cf904d
   *
Packit cf904d
   * @return:
Packit cf904d
   *   The border index.  @FT_STROKER_BORDER_LEFT for empty or invalid
Packit cf904d
   *   outlines.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( FT_StrokerBorder )
Packit cf904d
  FT_Outline_GetOutsideBorder( FT_Outline*  outline );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Stroker_New
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   Create a new stroker object.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   library ::
Packit cf904d
   *     FreeType library handle.
Packit cf904d
   *
Packit cf904d
   * @output:
Packit cf904d
   *   astroker ::
Packit cf904d
   *     A new stroker object handle.  NULL in case of error.
Packit cf904d
   *
Packit cf904d
   * @return:
Packit cf904d
   *    FreeType error code.  0~means success.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( FT_Error )
Packit cf904d
  FT_Stroker_New( FT_Library   library,
Packit cf904d
                  FT_Stroker  *astroker );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Stroker_Set
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   Reset a stroker object's attributes.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     The target stroker handle.
Packit cf904d
   *
Packit cf904d
   *   radius ::
Packit cf904d
   *     The border radius.
Packit cf904d
   *
Packit cf904d
   *   line_cap ::
Packit cf904d
   *     The line cap style.
Packit cf904d
   *
Packit cf904d
   *   line_join ::
Packit cf904d
   *     The line join style.
Packit cf904d
   *
Packit cf904d
   *   miter_limit ::
Packit cf904d
   *     The miter limit for the FT_STROKER_LINEJOIN_MITER_FIXED and
Packit cf904d
   *     FT_STROKER_LINEJOIN_MITER_VARIABLE line join styles,
Packit cf904d
   *     expressed as 16.16 fixed-point value.
Packit cf904d
   *
Packit cf904d
   * @note:
Packit cf904d
   *   The radius is expressed in the same units as the outline
Packit cf904d
   *   coordinates.
Packit cf904d
   *
Packit cf904d
   *   This function calls @FT_Stroker_Rewind automatically.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( void )
Packit cf904d
  FT_Stroker_Set( FT_Stroker           stroker,
Packit cf904d
                  FT_Fixed             radius,
Packit cf904d
                  FT_Stroker_LineCap   line_cap,
Packit cf904d
                  FT_Stroker_LineJoin  line_join,
Packit cf904d
                  FT_Fixed             miter_limit );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Stroker_Rewind
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   Reset a stroker object without changing its attributes.
Packit cf904d
   *   You should call this function before beginning a new
Packit cf904d
   *   series of calls to @FT_Stroker_BeginSubPath or
Packit cf904d
   *   @FT_Stroker_EndSubPath.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     The target stroker handle.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( void )
Packit cf904d
  FT_Stroker_Rewind( FT_Stroker  stroker );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Stroker_ParseOutline
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   A convenience function used to parse a whole outline with
Packit cf904d
   *   the stroker.  The resulting outline(s) can be retrieved
Packit cf904d
   *   later by functions like @FT_Stroker_GetCounts and @FT_Stroker_Export.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     The target stroker handle.
Packit cf904d
   *
Packit cf904d
   *   outline ::
Packit cf904d
   *     The source outline.
Packit cf904d
   *
Packit cf904d
   *   opened ::
Packit cf904d
   *     A boolean.  If~1, the outline is treated as an open path instead
Packit cf904d
   *     of a closed one.
Packit cf904d
   *
Packit cf904d
   * @return:
Packit cf904d
   *   FreeType error code.  0~means success.
Packit cf904d
   *
Packit cf904d
   * @note:
Packit cf904d
   *   If `opened' is~0 (the default), the outline is treated as a closed
Packit cf904d
   *   path, and the stroker generates two distinct `border' outlines.
Packit cf904d
   *
Packit cf904d
   *   If `opened' is~1, the outline is processed as an open path, and the
Packit cf904d
   *   stroker generates a single `stroke' outline.
Packit cf904d
   *
Packit cf904d
   *   This function calls @FT_Stroker_Rewind automatically.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( FT_Error )
Packit cf904d
  FT_Stroker_ParseOutline( FT_Stroker   stroker,
Packit cf904d
                           FT_Outline*  outline,
Packit cf904d
                           FT_Bool      opened );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Stroker_BeginSubPath
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   Start a new sub-path in the stroker.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     The target stroker handle.
Packit cf904d
   *
Packit cf904d
   *   to ::
Packit cf904d
   *     A pointer to the start vector.
Packit cf904d
   *
Packit cf904d
   *   open ::
Packit cf904d
   *     A boolean.  If~1, the sub-path is treated as an open one.
Packit cf904d
   *
Packit cf904d
   * @return:
Packit cf904d
   *   FreeType error code.  0~means success.
Packit cf904d
   *
Packit cf904d
   * @note:
Packit cf904d
   *   This function is useful when you need to stroke a path that is
Packit cf904d
   *   not stored as an @FT_Outline object.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( FT_Error )
Packit cf904d
  FT_Stroker_BeginSubPath( FT_Stroker  stroker,
Packit cf904d
                           FT_Vector*  to,
Packit cf904d
                           FT_Bool     open );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Stroker_EndSubPath
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   Close the current sub-path in the stroker.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     The target stroker handle.
Packit cf904d
   *
Packit cf904d
   * @return:
Packit cf904d
   *   FreeType error code.  0~means success.
Packit cf904d
   *
Packit cf904d
   * @note:
Packit cf904d
   *   You should call this function after @FT_Stroker_BeginSubPath.
Packit cf904d
   *   If the subpath was not `opened', this function `draws' a
Packit cf904d
   *   single line segment to the start position when needed.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( FT_Error )
Packit cf904d
  FT_Stroker_EndSubPath( FT_Stroker  stroker );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Stroker_LineTo
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   `Draw' a single line segment in the stroker's current sub-path,
Packit cf904d
   *   from the last position.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     The target stroker handle.
Packit cf904d
   *
Packit cf904d
   *   to ::
Packit cf904d
   *     A pointer to the destination point.
Packit cf904d
   *
Packit cf904d
   * @return:
Packit cf904d
   *   FreeType error code.  0~means success.
Packit cf904d
   *
Packit cf904d
   * @note:
Packit cf904d
   *   You should call this function between @FT_Stroker_BeginSubPath and
Packit cf904d
   *   @FT_Stroker_EndSubPath.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( FT_Error )
Packit cf904d
  FT_Stroker_LineTo( FT_Stroker  stroker,
Packit cf904d
                     FT_Vector*  to );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Stroker_ConicTo
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   `Draw' a single quadratic Bézier in the stroker's current sub-path,
Packit cf904d
   *   from the last position.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     The target stroker handle.
Packit cf904d
   *
Packit cf904d
   *   control ::
Packit cf904d
   *     A pointer to a Bézier control point.
Packit cf904d
   *
Packit cf904d
   *   to ::
Packit cf904d
   *     A pointer to the destination point.
Packit cf904d
   *
Packit cf904d
   * @return:
Packit cf904d
   *   FreeType error code.  0~means success.
Packit cf904d
   *
Packit cf904d
   * @note:
Packit cf904d
   *   You should call this function between @FT_Stroker_BeginSubPath and
Packit cf904d
   *   @FT_Stroker_EndSubPath.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( FT_Error )
Packit cf904d
  FT_Stroker_ConicTo( FT_Stroker  stroker,
Packit cf904d
                      FT_Vector*  control,
Packit cf904d
                      FT_Vector*  to );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Stroker_CubicTo
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   `Draw' a single cubic Bézier in the stroker's current sub-path,
Packit cf904d
   *   from the last position.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     The target stroker handle.
Packit cf904d
   *
Packit cf904d
   *   control1 ::
Packit cf904d
   *     A pointer to the first Bézier control point.
Packit cf904d
   *
Packit cf904d
   *   control2 ::
Packit cf904d
   *     A pointer to second Bézier control point.
Packit cf904d
   *
Packit cf904d
   *   to ::
Packit cf904d
   *     A pointer to the destination point.
Packit cf904d
   *
Packit cf904d
   * @return:
Packit cf904d
   *   FreeType error code.  0~means success.
Packit cf904d
   *
Packit cf904d
   * @note:
Packit cf904d
   *   You should call this function between @FT_Stroker_BeginSubPath and
Packit cf904d
   *   @FT_Stroker_EndSubPath.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( FT_Error )
Packit cf904d
  FT_Stroker_CubicTo( FT_Stroker  stroker,
Packit cf904d
                      FT_Vector*  control1,
Packit cf904d
                      FT_Vector*  control2,
Packit cf904d
                      FT_Vector*  to );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Stroker_GetBorderCounts
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   Call this function once you have finished parsing your paths
Packit cf904d
   *   with the stroker.  It returns the number of points and
Packit cf904d
   *   contours necessary to export one of the `border' or `stroke'
Packit cf904d
   *   outlines generated by the stroker.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     The target stroker handle.
Packit cf904d
   *
Packit cf904d
   *   border ::
Packit cf904d
   *     The border index.
Packit cf904d
   *
Packit cf904d
   * @output:
Packit cf904d
   *   anum_points ::
Packit cf904d
   *     The number of points.
Packit cf904d
   *
Packit cf904d
   *   anum_contours ::
Packit cf904d
   *     The number of contours.
Packit cf904d
   *
Packit cf904d
   * @return:
Packit cf904d
   *   FreeType error code.  0~means success.
Packit cf904d
   *
Packit cf904d
   * @note:
Packit cf904d
   *   When an outline, or a sub-path, is `closed', the stroker generates
Packit cf904d
   *   two independent `border' outlines, named `left' and `right'.
Packit cf904d
   *
Packit cf904d
   *   When the outline, or a sub-path, is `opened', the stroker merges
Packit cf904d
   *   the `border' outlines with caps.  The `left' border receives all
Packit cf904d
   *   points, while the `right' border becomes empty.
Packit cf904d
   *
Packit cf904d
   *   Use the function @FT_Stroker_GetCounts instead if you want to
Packit cf904d
   *   retrieve the counts associated to both borders.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( FT_Error )
Packit cf904d
  FT_Stroker_GetBorderCounts( FT_Stroker        stroker,
Packit cf904d
                              FT_StrokerBorder  border,
Packit cf904d
                              FT_UInt          *anum_points,
Packit cf904d
                              FT_UInt          *anum_contours );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Stroker_ExportBorder
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   Call this function after @FT_Stroker_GetBorderCounts to
Packit cf904d
   *   export the corresponding border to your own @FT_Outline
Packit cf904d
   *   structure.
Packit cf904d
   *
Packit cf904d
   *   Note that this function appends the border points and
Packit cf904d
   *   contours to your outline, but does not try to resize its
Packit cf904d
   *   arrays.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     The target stroker handle.
Packit cf904d
   *
Packit cf904d
   *   border ::
Packit cf904d
   *     The border index.
Packit cf904d
   *
Packit cf904d
   *   outline ::
Packit cf904d
   *     The target outline handle.
Packit cf904d
   *
Packit cf904d
   * @note:
Packit cf904d
   *   Always call this function after @FT_Stroker_GetBorderCounts to
Packit cf904d
   *   get sure that there is enough room in your @FT_Outline object to
Packit cf904d
   *   receive all new data.
Packit cf904d
   *
Packit cf904d
   *   When an outline, or a sub-path, is `closed', the stroker generates
Packit cf904d
   *   two independent `border' outlines, named `left' and `right'.
Packit cf904d
   *
Packit cf904d
   *   When the outline, or a sub-path, is `opened', the stroker merges
Packit cf904d
   *   the `border' outlines with caps.  The `left' border receives all
Packit cf904d
   *   points, while the `right' border becomes empty.
Packit cf904d
   *
Packit cf904d
   *   Use the function @FT_Stroker_Export instead if you want to
Packit cf904d
   *   retrieve all borders at once.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( void )
Packit cf904d
  FT_Stroker_ExportBorder( FT_Stroker        stroker,
Packit cf904d
                           FT_StrokerBorder  border,
Packit cf904d
                           FT_Outline*       outline );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Stroker_GetCounts
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   Call this function once you have finished parsing your paths
Packit cf904d
   *   with the stroker.  It returns the number of points and
Packit cf904d
   *   contours necessary to export all points/borders from the stroked
Packit cf904d
   *   outline/path.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     The target stroker handle.
Packit cf904d
   *
Packit cf904d
   * @output:
Packit cf904d
   *   anum_points ::
Packit cf904d
   *     The number of points.
Packit cf904d
   *
Packit cf904d
   *   anum_contours ::
Packit cf904d
   *     The number of contours.
Packit cf904d
   *
Packit cf904d
   * @return:
Packit cf904d
   *   FreeType error code.  0~means success.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( FT_Error )
Packit cf904d
  FT_Stroker_GetCounts( FT_Stroker  stroker,
Packit cf904d
                        FT_UInt    *anum_points,
Packit cf904d
                        FT_UInt    *anum_contours );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Stroker_Export
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   Call this function after @FT_Stroker_GetBorderCounts to
Packit cf904d
   *   export all borders to your own @FT_Outline structure.
Packit cf904d
   *
Packit cf904d
   *   Note that this function appends the border points and
Packit cf904d
   *   contours to your outline, but does not try to resize its
Packit cf904d
   *   arrays.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     The target stroker handle.
Packit cf904d
   *
Packit cf904d
   *   outline ::
Packit cf904d
   *     The target outline handle.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( void )
Packit cf904d
  FT_Stroker_Export( FT_Stroker   stroker,
Packit cf904d
                     FT_Outline*  outline );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Stroker_Done
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   Destroy a stroker object.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     A stroker handle.  Can be NULL.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( void )
Packit cf904d
  FT_Stroker_Done( FT_Stroker  stroker );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Glyph_Stroke
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   Stroke a given outline glyph object with a given stroker.
Packit cf904d
   *
Packit cf904d
   * @inout:
Packit cf904d
   *   pglyph ::
Packit cf904d
   *     Source glyph handle on input, new glyph handle on output.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     A stroker handle.
Packit cf904d
   *
Packit cf904d
   *   destroy ::
Packit cf904d
   *     A Boolean.  If~1, the source glyph object is destroyed
Packit cf904d
   *     on success.
Packit cf904d
   *
Packit cf904d
   * @return:
Packit cf904d
   *    FreeType error code.  0~means success.
Packit cf904d
   *
Packit cf904d
   * @note:
Packit cf904d
   *   The source glyph is untouched in case of error.
Packit cf904d
   *
Packit cf904d
   *   Adding stroke may yield a significantly wider and taller glyph
Packit cf904d
   *   depending on how large of a radius was used to stroke the glyph.  You
Packit cf904d
   *   may need to manually adjust horizontal and vertical advance amounts
Packit cf904d
   *   to account for this added size.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( FT_Error )
Packit cf904d
  FT_Glyph_Stroke( FT_Glyph    *pglyph,
Packit cf904d
                   FT_Stroker   stroker,
Packit cf904d
                   FT_Bool      destroy );
Packit cf904d
Packit cf904d
Packit cf904d
  /**************************************************************
Packit cf904d
   *
Packit cf904d
   * @function:
Packit cf904d
   *   FT_Glyph_StrokeBorder
Packit cf904d
   *
Packit cf904d
   * @description:
Packit cf904d
   *   Stroke a given outline glyph object with a given stroker, but
Packit cf904d
   *   only return either its inside or outside border.
Packit cf904d
   *
Packit cf904d
   * @inout:
Packit cf904d
   *   pglyph ::
Packit cf904d
   *     Source glyph handle on input, new glyph handle on output.
Packit cf904d
   *
Packit cf904d
   * @input:
Packit cf904d
   *   stroker ::
Packit cf904d
   *     A stroker handle.
Packit cf904d
   *
Packit cf904d
   *   inside ::
Packit cf904d
   *     A Boolean.  If~1, return the inside border, otherwise
Packit cf904d
   *     the outside border.
Packit cf904d
   *
Packit cf904d
   *   destroy ::
Packit cf904d
   *     A Boolean.  If~1, the source glyph object is destroyed
Packit cf904d
   *     on success.
Packit cf904d
   *
Packit cf904d
   * @return:
Packit cf904d
   *    FreeType error code.  0~means success.
Packit cf904d
   *
Packit cf904d
   * @note:
Packit cf904d
   *   The source glyph is untouched in case of error.
Packit cf904d
   *
Packit cf904d
   *   Adding stroke may yield a significantly wider and taller glyph
Packit cf904d
   *   depending on how large of a radius was used to stroke the glyph.  You
Packit cf904d
   *   may need to manually adjust horizontal and vertical advance amounts
Packit cf904d
   *   to account for this added size.
Packit cf904d
   */
Packit cf904d
  FT_EXPORT( FT_Error )
Packit cf904d
  FT_Glyph_StrokeBorder( FT_Glyph    *pglyph,
Packit cf904d
                         FT_Stroker   stroker,
Packit cf904d
                         FT_Bool      inside,
Packit cf904d
                         FT_Bool      destroy );
Packit cf904d
Packit cf904d
  /* */
Packit cf904d
Packit cf904d
FT_END_HEADER
Packit cf904d
Packit cf904d
#endif /* FTSTROKE_H_ */
Packit cf904d
Packit cf904d
Packit cf904d
/* END */
Packit cf904d
Packit cf904d
Packit cf904d
/* Local Variables: */
Packit cf904d
/* coding: utf-8    */
Packit cf904d
/* End:             */