33 #define FT_COMPONENT outline
48 #define SCALED( x ) ( (x) * ( 1L << shift ) - delta )
71 if ( !func_interface )
74 shift = func_interface->shift;
75 delta = func_interface->delta;
78 for (
n = 0;
n < outline->n_contours;
n++ )
83 FT_TRACE5((
"FT_Outline_Decompose: Outline %d\n",
n ));
85 last = outline->contours[
n];
88 limit = outline->points + last;
90 v_start = outline->points[
first];
94 v_last = outline->points[last];
100 point = outline->points +
first;
101 tags = outline->tags +
first;
106 goto Invalid_Outline;
123 v_start.
x = ( v_start.
x + v_last.
x ) / 2;
124 v_start.
y = ( v_start.
y + v_last.
y ) / 2;
133 v_start.
x / 64.0, v_start.
y / 64.0 ));
134 error = func_interface->move_to( &v_start, user );
138 while ( point <
limit )
156 error = func_interface->line_to( &
vec, user );
183 " with control (%.2f, %.2f)\n",
185 v_control.
x / 64.0, v_control.
y / 64.0 ));
186 error = func_interface->conic_to( &v_control, &
vec, user );
193 goto Invalid_Outline;
195 v_middle.
x = ( v_control.
x +
vec.
x ) / 2;
196 v_middle.
y = ( v_control.
y +
vec.
y ) / 2;
199 " with control (%.2f, %.2f)\n",
200 v_middle.
x / 64.0, v_middle.
y / 64.0,
201 v_control.
x / 64.0, v_control.
y / 64.0 ));
202 error = func_interface->conic_to( &v_control, &v_middle, user );
211 " with control (%.2f, %.2f)\n",
212 v_start.
x / 64.0, v_start.
y / 64.0,
213 v_control.
x / 64.0, v_control.
y / 64.0 ));
214 error = func_interface->conic_to( &v_control, &v_start, user );
222 if ( point + 1 >
limit ||
224 goto Invalid_Outline;
235 if ( point <=
limit )
244 " with controls (%.2f, %.2f) and (%.2f, %.2f)\n",
246 vec1.
x / 64.0, vec1.
y / 64.0,
247 vec2.
x / 64.0, vec2.
y / 64.0 ));
248 error = func_interface->cubic_to( &vec1, &vec2, &
vec, user );
255 " with controls (%.2f, %.2f) and (%.2f, %.2f)\n",
256 v_start.
x / 64.0, v_start.
y / 64.0,
257 vec1.
x / 64.0, vec1.
y / 64.0,
258 vec2.
x / 64.0, vec2.
y / 64.0 ));
259 error = func_interface->cubic_to( &vec1, &vec2, &v_start, user );
267 v_start.
x / 64.0, v_start.
y / 64.0 ));
268 error = func_interface->line_to( &v_start, user );
277 FT_TRACE5((
"FT_Outline_Decompose: Done\n" ));
303 return FT_THROW( Invalid_Library_Handle );
307 if ( !anoutline || !
memory )
308 return FT_THROW( Invalid_Argument );
310 *anoutline = null_outline;
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;
345 FT_Int n_points = outline->n_points;
346 FT_Int n_contours = outline->n_contours;
352 if ( n_points == 0 && n_contours == 0 )
356 if ( n_points <= 0 || n_contours <= 0 )
360 for (
n = 0;
n < n_contours;
n++ )
362 end = outline->contours[
n];
371 if (
end != n_points - 1 )
379 return FT_THROW( Invalid_Argument );
397 return FT_THROW( Invalid_Argument );
416 target->flags |= is_owner;
432 return FT_THROW( Invalid_Library_Handle );
440 return FT_THROW( Invalid_Argument );
448 *outline = null_outline;
460 FT_Pos xMin, yMin, xMax, yMax;
463 if ( outline && acbox )
465 if ( outline->n_points == 0 )
478 xMin = xMax =
vec->
x;
479 yMin = yMax =
vec->
y;
488 if (
x < xMin ) xMin =
x;
489 if (
x > xMax ) xMax =
x;
492 if (
y < yMin ) yMin =
y;
493 if (
y > yMax ) yMax =
y;
518 vec = outline->points;
520 for (
n = 0;
n < outline->n_points;
n++ )
543 for (
n = 0;
n < outline->n_contours;
n++ )
545 last = outline->contours[
n];
566 char*
p = outline->tags +
first;
567 char*
q = outline->tags + last;
604 return FT_THROW( Invalid_Library_Handle );
610 return FT_THROW( Invalid_Argument );
613 if ( cbox.
xMin < -0x1000000L || cbox.
yMin < -0x1000000L ||
614 cbox.
xMax > 0x1000000L || cbox.
yMax > 0x1000000L )
620 params->source = (
void*)outline;
628 params->clip_box.xMax = ( cbox.
xMax + 63 ) >> 6;
629 params->clip_box.yMax = ( cbox.
yMax + 63 ) >> 6;
664 return FT_THROW( Invalid_Argument );
713 if ( !outline || !
matrix || !outline->points )
716 vec = outline->points;
726 #define FT_OUTLINE_GET_CONTOUR( outline, c, first, last ) \
729 (first) = ( c > 0 ) ? (outline)->points + \
730 (outline)->contours[c - 1] + 1 \
731 : (outline)->points; \
732 (last) = (outline)->points + (outline)->contours[c]; \
753 FT_OUTLINE_GET_CONTOUR( outline,
c,
first, last );
763 intersect = (
a->y - point->
y ) ^ (
b->y - point->
y );
766 if ( intersect >= 0 )
768 if ( intersect == 0 &&
a->y == point->
y )
770 if ( (
a->x <= point->
x &&
b->x >= point->
x ) ||
771 (
a->x >= point->
x &&
b->x <= point->
x ) )
778 x =
a->x + (
b->x -
a->x ) * (point->
y -
a->y ) / (
b->y -
a->y );
782 else if (
x == point->
x )
799 FT_OUTLINE_GET_CONTOUR( outline,
c,
first, last );
803 if (
i !=
c && ft_contour_has( outline,
i,
first ) )
808 for ( pt =
first + 1; pt <= last; pt++ )
809 if ( !ft_contour_has( outline,
i, pt ) )
825 ft_outline_get_orientation(
FT_Outline* outline )
844 if ( last <
first + 2 )
847 if ( ft_contour_enclosed( outline,
i ) )
853 for ( point =
first + 1; point <= last; point++ )
855 if ( point->
x < xmin )
869 prev = ( xmin_point ==
first ) ? last : xmin_point - 1;
870 next = ( xmin_point == last ) ?
first : xmin_point + 1;
872 if (
FT_Atan2( prev->
x - xmin_point->
x, prev->
y - xmin_point->
y ) >
880 else if ( orient !=
o )
918 if ( xstrength == 0 && ystrength == 0 )
924 if ( outline->n_contours )
925 return FT_THROW( Invalid_Argument );
933 for (
c = 0;
c < outline->n_contours;
c++ )
941 last = outline->contours[
c];
944 in.x =
in.y = anchor.
x = anchor.
y = 0;
948 for (
i = last,
j =
first, k = -1;
1041 FT_BBox cbox = { 0, 0, 0, 0 };
1049 if ( !outline || outline->n_points <= 0 )
1064 if ( cbox.
xMin < -0x1000000L || cbox.
yMin < -0x1000000L ||
1065 cbox.
xMax > 0x1000000L || cbox.
yMax > 0x1000000L )
1070 xshift =
FT_MAX( xshift, 0 );
1073 yshift =
FT_MAX( yshift, 0 );
1075 points = outline->points;
1078 for (
c = 0;
c < outline->n_contours;
c++ )
1080 FT_Int last = outline->contours[
c];
1083 v_prev.
x =
points[last].x >> xshift;
1084 v_prev.
y =
points[last].y >> yshift;
1093 v_cur.
x + v_prev.
x ) );
1103 else if ( area < 0 )
small capitals from c petite p scientific i
[1]
FT_MulDiv(FT_Long a, FT_Long b, FT_Long c)
FT_MulFix(FT_Long a, FT_Long b)
FT_Vector_NormLen(FT_Vector *vector)
#define FT_TRACE5(varformat)
#define FT_CURVE_TAG_CUBIC
#define FT_RASTER_FLAG_AA
#define FT_CURVE_TAG_CONIC
#define FT_RASTER_FLAG_CLIP
#define FT_RASTER_FLAG_DIRECT
#define FT_CURVE_TAG(flag)
#define FT_OUTLINE_POINTS_MAX
#define FT_OUTLINE_REVERSE_FILL
FT_BEGIN_HEADER typedef signed long FT_Pos
#define FT_NEW_ARRAY(ptr, count)
#define FT_ARRAY_COPY(dest, source, count)
FT_Lookup_Renderer(FT_Library library, FT_Glyph_Format format, FT_ListNode *node)
FT_Outline_Check(FT_Outline *outline)
FT_Outline_EmboldenXY(FT_Outline *outline, FT_Pos xstrength, FT_Pos ystrength)
FT_Outline_Reverse(FT_Outline *outline)
FT_Outline_Translate(const FT_Outline *outline, FT_Pos xOffset, FT_Pos yOffset)
FT_Outline_Get_Bitmap(FT_Library library, FT_Outline *outline, const FT_Bitmap *abitmap)
FT_Outline_Get_Orientation(FT_Outline *outline)
FT_Outline_New(FT_Library library, FT_UInt numPoints, FT_Int numContours, FT_Outline *anoutline)
FT_Outline_Decompose(FT_Outline *outline, const FT_Outline_Funcs *func_interface, void *user)
FT_Vector_Transform(FT_Vector *vector, const FT_Matrix *matrix)
FT_Outline_Embolden(FT_Outline *outline, FT_Pos strength)
FT_Outline_Transform(const FT_Outline *outline, const FT_Matrix *matrix)
FT_Outline_Done(FT_Library library, FT_Outline *outline)
FT_Outline_Render(FT_Library library, FT_Outline *outline, FT_Raster_Params *params)
FT_Outline_Copy(const FT_Outline *source, FT_Outline *target)
FT_Outline_Get_CBox(const FT_Outline *outline, FT_BBox *acbox)
@ FT_ORIENTATION_POSTSCRIPT
@ FT_ORIENTATION_TRUETYPE
enum FT_Orientation_ FT_Orientation
typedefFT_BEGIN_HEADER struct FT_MemoryRec_ * FT_Memory
FT_Atan2(FT_Fixed x, FT_Fixed y)
FT_BEGIN_HEADER typedef unsigned char FT_Bool
auto it unsigned count const
GLboolean GLboolean GLboolean b
GLint GLint GLint GLint GLint x
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLsizei GLenum GLsizei GLsizei GLuint memory
GLsizei GLsizei GLchar * source
GLfixed GLfixed GLint GLint GLfixed points
GLdouble GLdouble GLdouble GLdouble q
QTextStream out(stdout)
[7]
FT_Raster_Render_Func raster_render
virtual HRESULT STDMETHODCALLTYPE Close(void)=0
XmlOutput::xml_output tag(const QString &name)