Index: work/util/ttf2lht/Makefile =================================================================== --- work/util/ttf2lht/Makefile (revision 18922) +++ work/util/ttf2lht/Makefile (revision 18923) @@ -1,4 +1,4 @@ CFLAGS = -Wall -g -I/usr/include/freetype2 -LDFLAGS = -lfreetype +LDFLAGS = -lfreetype -lm ttf2lht: ttf2lht.c Index: work/util/ttf2lht/ttf2lht.c =================================================================== --- work/util/ttf2lht/ttf2lht.c (revision 18922) +++ work/util/ttf2lht/ttf2lht.c (revision 18923) @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -13,7 +14,7 @@ }; typedef struct { - int x, y; + double x, y; FT_Outline_Funcs *funcs; } stroke_t; @@ -34,7 +35,20 @@ int stroke_conic_to(const FT_Vector *control, const FT_Vector *to, void *s_) { stroke_t *s = (stroke_t *)s_; - printf("# conic to\n"); + double t; + double nodes = 10, td = 1.0 / nodes; + FT_Vector v; + + printf("## conic to {\n"); + for(t = 0.0; t <= 1.0; t += td) { + v.x = pow(1.0-t, 2) * s->x + 2*t*(1.0-t)*control->x + t*t*to->x; + v.y = pow(1.0-t, 2) * s->y + 2*t*(1.0-t)*control->y + t*t*to->y; + s->funcs->line_to(&v, s); + } + printf("## }\n"); + + s->x = to->x; + s->y = to->y; return 0; }