28 #include FT_INTERNAL_OBJECTS_H 29 #include FT_INTERNAL_CALC_H 30 #include FT_INTERNAL_DEBUG_H 31 #include FT_TRIGONOMETRY_H 41 #define FT_COMPONENT trace_outline 56 #define SCALED( x ) ( ( (x) < 0 ? -( -(x) << shift ) \ 57 : ( (x) << shift ) ) - delta ) 80 if ( !func_interface )
83 shift = func_interface->shift;
84 delta = func_interface->delta;
92 FT_TRACE5((
"FT_Outline_Decompose: Outline %d\n",
n ));
115 goto Invalid_Outline;
132 v_start.
x = ( v_start.
x + v_last.
x ) / 2;
133 v_start.
y = ( v_start.
y + v_last.
y ) / 2;
142 v_start.
x / 64.0, v_start.
y / 64.0 ));
143 error = func_interface->move_to( &v_start,
user );
192 " with control (%.2f, %.2f)\n",
194 v_control.
x / 64.0, v_control.
y / 64.0 ));
195 error = func_interface->conic_to( &v_control, &
vec,
user );
202 goto Invalid_Outline;
204 v_middle.
x = ( v_control.
x +
vec.
x ) / 2;
205 v_middle.
y = ( v_control.
y +
vec.
y ) / 2;
208 " with control (%.2f, %.2f)\n",
209 v_middle.
x / 64.0, v_middle.
y / 64.0,
210 v_control.
x / 64.0, v_control.
y / 64.0 ));
211 error = func_interface->conic_to( &v_control, &v_middle,
user );
220 " with control (%.2f, %.2f)\n",
221 v_start.
x / 64.0, v_start.
y / 64.0,
222 v_control.
x / 64.0, v_control.
y / 64.0 ));
223 error = func_interface->conic_to( &v_control, &v_start,
user );
233 goto Invalid_Outline;
253 " with controls (%.2f, %.2f) and (%.2f, %.2f)\n",
255 vec1.
x / 64.0, vec1.
y / 64.0,
256 vec2.
x / 64.0, vec2.
y / 64.0 ));
257 error = func_interface->cubic_to( &vec1, &vec2, &
vec,
user );
264 " with controls (%.2f, %.2f) and (%.2f, %.2f)\n",
265 v_start.
x / 64.0, v_start.
y / 64.0,
266 vec1.
x / 64.0, vec1.
y / 64.0,
267 vec2.
x / 64.0, vec2.
y / 64.0 ));
268 error = func_interface->cubic_to( &vec1, &vec2, &v_start,
user );
276 v_start.
x / 64.0, v_start.
y / 64.0 ));
277 error = func_interface->line_to( &v_start,
user );
286 FT_TRACE5((
"FT_Outline_Decompose: Done\n",
n ));
307 if ( !anoutline || !
memory )
308 return FT_THROW( Invalid_Argument );
312 if ( numContours < 0 ||
313 (
FT_UInt)numContours > numPoints )
314 return FT_THROW( Invalid_Argument );
324 anoutline->n_points = (
FT_Short)numPoints;
325 anoutline->n_contours = (
FT_Short)numContours;
347 return FT_THROW( Invalid_Library_Handle );
350 numContours, anoutline );
368 if ( n_points == 0 && n_contours == 0 )
372 if ( n_points <= 0 || n_contours <= 0 )
376 for (
n = 0;
n < n_contours;
n++ )
387 if (
end != n_points - 1 )
395 return FT_THROW( Invalid_Argument );
413 return FT_THROW( Invalid_Argument );
432 target->flags |= is_owner;
446 return FT_THROW( Invalid_Argument );
469 return FT_THROW( Invalid_Library_Handle );
481 FT_Pos xMin, yMin, xMax, yMax;
499 xMin = xMax =
vec->
x;
500 yMin = yMax =
vec->
y;
509 if (
x < xMin ) xMin =
x;
510 if (
x > xMax ) xMax =
x;
513 if (
y < yMin ) yMin =
y;
514 if (
y > yMax ) yMax =
y;
624 return FT_THROW( Invalid_Library_Handle );
630 return FT_THROW( Invalid_Argument );
669 return FT_THROW( Invalid_Argument );
731 #define FT_OUTLINE_GET_CONTOUR( outline, c, first, last ) \ 734 (first) = ( c > 0 ) ? (outline)->points + \ 735 (outline)->contours[c - 1] + 1 \ 736 : (outline)->points; \ 737 (last) = (outline)->points + (outline)->contours[c]; \ 771 if ( intersect >= 0 )
773 if ( intersect == 0 &&
a->y ==
point->
y )
783 x =
a->x + (
b->x -
a->x ) * (
point->
y -
a->y ) / (
b->y -
a->y );
852 if ( ft_contour_enclosed(
outline,
i ) )
874 prev = ( xmin_point ==
first ) ?
last : xmin_point - 1;
877 if (
FT_Atan2( prev->
x - xmin_point->
x, prev->
y - xmin_point->
y ) >
885 else if ( orient != o )
923 if ( xstrength == 0 && ystrength == 0 )
930 return FT_THROW( Invalid_Argument );
949 in.x =
in.y = anchor.
x = anchor.
y = 0;
1070 xshift =
FT_MAX( xshift, 0 );
1073 yshift =
FT_MAX( yshift, 0 );
1092 ( v_cur.
y - v_prev.
y ) * ( v_cur.
x + v_prev.
x ) );
1102 else if (
area < 0 )
FT_BEGIN_HEADER typedef signed long FT_Pos
FT_Outline_Done(FT_Library library, FT_Outline *outline)
#define FT_CURVE_TAG_CUBIC
#define FT_ARRAY_COPY(dest, source, count)
enum FT_Orientation_ FT_Orientation
GLint GLint GLint GLint GLint x
FT_Outline_EmboldenXY(FT_Outline *outline, FT_Pos xstrength, FT_Pos ystrength)
#define FT_RASTER_FLAG_AA
FT_Outline_Get_Bitmap(FT_Library library, FT_Outline *outline, const FT_Bitmap *abitmap)
static char memory[1024 *256]
FT_Lookup_Renderer(FT_Library library, FT_Glyph_Format format, FT_ListNode *node)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
FT_Outline_Reverse(FT_Outline *outline)
FT_Outline_Get_CBox(const FT_Outline *outline, FT_BBox *acbox)
GLenum const GLfloat * params
#define FT_OUTLINE_POINTS_MAX
FT_Vector_NormLen(FT_Vector *vector)
FT_Outline_Decompose(FT_Outline *outline, const FT_Outline_Funcs *func_interface, void *user)
FT_Outline_Embolden(FT_Outline *outline, FT_Pos strength)
FT_Outline_Done_Internal(FT_Memory memory, FT_Outline *outline)
FT_Atan2(FT_Fixed x, FT_Fixed y)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
FT_Outline_Copy(const FT_Outline *source, FT_Outline *target)
GLboolean GLboolean GLboolean b
FT_Vector_Transform(FT_Vector *vector, const FT_Matrix *matrix)
FT_Outline_New(FT_Library library, FT_UInt numPoints, FT_Int numContours, FT_Outline *anoutline)
smooth FT_Module_Constructor FT_Module_Destructor FT_Module_Requester FT_GLYPH_FORMAT_OUTLINE
FT_Outline_Transform(const FT_Outline *outline, const FT_Matrix *matrix)
GLdouble GLdouble GLdouble GLdouble q
FT_Outline_New_Internal(FT_Memory memory, FT_UInt numPoints, FT_Int numContours, FT_Outline *anoutline)
GLsizei const GLfloat * points
FT_Outline_Render(FT_Library library, FT_Outline *outline, FT_Raster_Params *params)
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
#define FT_NEW_ARRAY(ptr, count)
FT_MulFix(FT_Long a, FT_Long b)
static const FT_Outline null_outline
FT_Outline_Translate(const FT_Outline *outline, FT_Pos xOffset, FT_Pos yOffset)
static unsigned __int64 next
FT_Outline_Check(FT_Outline *outline)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
static Real area(Real A[2], Real B[2], Real C[2])
#define FT_TRACE5(varformat)
GLint GLint GLint GLint GLint GLint y
FT_Outline_Get_Orientation(FT_Outline *outline)
FT_Raster_Render_Func raster_render
#define FT_CURVE_TAG_CONIC
#define FT_CURVE_TAG(flag)
GLboolean GLboolean GLboolean GLboolean a
void user(int argc, const char *argv[])
#define FT_OUTLINE_REVERSE_FILL