87 return cubicTo( aControlPoint,
nullptr, aEndPoint, aCallbackData );
92 const FT_Vector* aSecondControlPoint,
const FT_Vector* aEndPoint,
97 std::vector<VECTOR2D> bezier;
99 bezier.push_back(
toVector2D( aFirstControlPoint ) );
101 if( aSecondControlPoint )
104 bezier.push_back(
toVector2D( aSecondControlPoint ) );
109 std::vector<VECTOR2D>
result;
126 FT_Outline_Funcs callbacks;
128 callbacks.move_to =
moveTo;
129 callbacks.line_to =
lineTo;
135 FT_Error e = FT_Outline_Decompose( &
m_outline, &callbacks,
this );
141 c.m_Winding =
winding( c.m_Points );
154 if( aContour.size() < 2 )
164 size_t len = aContour.size();
166 for(
size_t i = 0; i < len - 1; i++ )
171 sum += ( ( p2.
x - p1.
x ) * ( p2.
y + p1.
y ) );
174 sum += ( ( aContour[0].x - aContour[len - 1].x ) * ( aContour[0].y + aContour[len - 1].y ) );
static const ADVANCED_CFG & GetCfg()
Get the singleton instance's config, which is shared by all consumers.
Bezier curves to polygon converter.
void GetPoly(std::vector< VECTOR2I > &aOutput, int aMaxError=10)
Convert a Bezier curve to a polygon.
void addContourPoint(const VECTOR2D &p)
OUTLINE_DECOMPOSER(FT_Outline &aOutline)
std::vector< CONTOUR > * m_contours
static int cubicTo(const FT_Vector *aFirstControlPoint, const FT_Vector *aSecondControlPoint, const FT_Vector *aEndPoint, void *aCallbackData)
static int moveTo(const FT_Vector *aEndPoint, void *aCallbackData)
bool OutlineToSegments(std::vector< CONTOUR > *aContours)
static int lineTo(const FT_Vector *aEndPoint, void *aCallbackData)
static int quadraticTo(const FT_Vector *aControlPoint, const FT_Vector *aEndPoint, void *aCallbackData)
int winding(const std::vector< VECTOR2D > &aContour) const
constexpr double GLYPH_SIZE_SCALER
static VECTOR2D toVector2D(const FT_Vector *aFreeTypeVector)
FT_Orientation m_Orientation
wxString result
Test unit parsing edge cases and error handling.
VECTOR2< double > VECTOR2D