ftstroker.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #ifndef __FT_STROKER_H__
  2. #define __FT_STROKER_H__
  3. #include <ft2build.h>
  4. #include FT_OUTLINE_H
  5. FT_BEGIN_HEADER
  6. /*@*************************************************************
  7. *
  8. * @type: FT_Stroker
  9. *
  10. * @description:
  11. * opaque handler to a path stroker object
  12. */
  13. typedef struct FT_StrokerRec_* FT_Stroker;
  14. /*@*************************************************************
  15. *
  16. * @enum: FT_Stroker_LineJoin
  17. *
  18. * @description:
  19. * these values determine how two joining lines are rendered
  20. * in a stroker.
  21. *
  22. * @values:
  23. * FT_STROKER_LINEJOIN_ROUND ::
  24. * used to render rounded line joins. circular arcs are used
  25. * to join two lines smoothly
  26. *
  27. * FT_STROKER_LINEJOIN_BEVEL ::
  28. * used to render beveled line joins; i.e. the two joining lines
  29. * are extended until they intersect
  30. *
  31. * FT_STROKER_LINEJOIN_MITER ::
  32. * same as beveled rendering, except that an additional line
  33. * break is added if the angle between the two joining lines
  34. * is too closed (this is useful to avoid unpleasant spikes
  35. * in beveled rendering).
  36. */
  37. typedef enum
  38. {
  39. FT_STROKER_LINEJOIN_ROUND = 0,
  40. FT_STROKER_LINEJOIN_BEVEL,
  41. FT_STROKER_LINEJOIN_MITER
  42. } FT_Stroker_LineJoin;
  43. /*@*************************************************************
  44. *
  45. * @enum: FT_Stroker_LineCap
  46. *
  47. * @description:
  48. * these values determine how the end of opened sub-paths are
  49. * rendered in a stroke
  50. *
  51. * @values:
  52. * FT_STROKER_LINECAP_BUTT ::
  53. * the end of lines is rendered as a full stop on the last
  54. * point itself
  55. *
  56. * FT_STROKER_LINECAP_ROUND ::
  57. * the end of lines is rendered as a half-circle around the
  58. * last point
  59. *
  60. * FT_STROKER_LINECAP_SQUARE ::
  61. * the end of lines is rendered as a square around the
  62. * last point
  63. */
  64. typedef enum
  65. {
  66. FT_STROKER_LINECAP_BUTT = 0,
  67. FT_STROKER_LINECAP_ROUND,
  68. FT_STROKER_LINECAP_SQUARE
  69. } FT_Stroker_LineCap;
  70. /* */
  71. FT_EXPORT( FT_Error )
  72. FT_Stroker_New( FT_Memory memory,
  73. FT_Stroker *astroker );
  74. FT_EXPORT( void )
  75. FT_Stroker_Set( FT_Stroker stroker,
  76. FT_Fixed radius,
  77. FT_Stroker_LineCap line_cap,
  78. FT_Stroker_LineJoin line_join,
  79. FT_Fixed miter_limit );
  80. FT_EXPORT( FT_Error )
  81. FT_Stroker_ParseOutline( FT_Stroker stroker,
  82. FT_Outline* outline,
  83. FT_Bool opened );
  84. FT_EXPORT( FT_Error )
  85. FT_Stroker_BeginSubPath( FT_Stroker stroker,
  86. FT_Vector* to,
  87. FT_Bool open );
  88. FT_EXPORT( FT_Error )
  89. FT_Stroker_EndSubPath( FT_Stroker stroker );
  90. FT_EXPORT( FT_Error )
  91. FT_Stroker_LineTo( FT_Stroker stroker,
  92. FT_Vector* to );
  93. FT_EXPORT( FT_Error )
  94. FT_Stroker_ConicTo( FT_Stroker stroker,
  95. FT_Vector* control,
  96. FT_Vector* to );
  97. FT_EXPORT( FT_Error )
  98. FT_Stroker_CubicTo( FT_Stroker stroker,
  99. FT_Vector* control1,
  100. FT_Vector* control2,
  101. FT_Vector* to );
  102. FT_EXPORT( FT_Error )
  103. FT_Stroker_GetCounts( FT_Stroker stroker,
  104. FT_UInt *anum_points,
  105. FT_UInt *anum_contours );
  106. FT_EXPORT( void )
  107. FT_Stroker_Export( FT_Stroker stroker,
  108. FT_Outline* outline );
  109. FT_EXPORT( void )
  110. FT_Stroker_Done( FT_Stroker stroker );
  111. FT_END_HEADER
  112. #endif /* __FT_STROKER_H__ */