Index: ttf2lht/drv_approx.c =================================================================== --- ttf2lht/drv_approx.c (revision 20257) +++ ttf2lht/drv_approx.c (nonexistent) @@ -1,36 +0,0 @@ -#include "ttf2lht.h" - -char *drv_approx_comment = "!!"; - -static double sqr(double a) -{ - return a*a; -} - -int stroke_approx_conic_to(const FT_Vector *control, const FT_Vector *to, void *s_) -{ - pcb_ttf_stroke_t *s = (pcb_ttf_stroke_t *)s_; - double t; - double nodes = 10, td = 1.0 / nodes; - FT_Vector v; - - if (drv_approx_comment != NULL) printf("%s conic to {\n", drv_approx_comment); - for(t = 0.0; t <= 1.0; t += td) { - v.x = sqr(1.0-t) * s->x + 2*t*(1.0-t)*control->x + t*t*to->x; - v.y = sqr(1.0-t) * s->y + 2*t*(1.0-t)*control->y + t*t*to->y; - s->funcs.line_to(&v, s); - } - if (drv_approx_comment != NULL) printf("%s }\n", drv_approx_comment); - - s->x = to->x; - s->y = to->y; - return 0; -} - -int stroke_approx_cubic_to(const FT_Vector *control1, const FT_Vector *control2, const FT_Vector *to, void *s_) -{ - pcb_ttf_stroke_t *s = (pcb_ttf_stroke_t *)s_; - if (drv_approx_comment != NULL) printf("%s cubic to {\n", drv_approx_comment); - if (drv_approx_comment != NULL) printf("%s }\n", drv_approx_comment); - return 0; -} Index: ttf2lht/drv_approx.h =================================================================== --- ttf2lht/drv_approx.h (revision 20257) +++ ttf2lht/drv_approx.h (nonexistent) @@ -1,4 +0,0 @@ -extern char *drv_approx_comment; - -int stroke_approx_conic_to(const FT_Vector *control, const FT_Vector *to, void *s_); -int stroke_approx_cubic_to(const FT_Vector *control1, const FT_Vector *control2, const FT_Vector *to, void *s_); Index: ttf2lht/Makefile =================================================================== --- ttf2lht/Makefile (revision 20257) +++ ttf2lht/Makefile (revision 20258) @@ -1,17 +1,20 @@ TRUNK=../../../trunk RND=$(TRUNK)/src RND3=$(TRUNK)/src_3rd +PLUGIN=$(TRUNK)/src_plugins/import_ttf/ RNDLIB=$(RND)/polygon1.o $(RND)/heap.o $(RND)/rtree.o \ $(RND3)/genvector/gds_char.o $(RND3)/genvector/vtp0.o \ - $(TRUNK)/src_plugins/import_ttf/ttf_load.o + $(PLUGIN)/ttf_load.o $(PLUGIN)/drv_approx.o CFLAGS = -Wall -g -I/usr/include/freetype2 -I$(TRUNK) -I$(RND3) LDFLAGS = -lfreetype -lm -ttf2lht: ttf2lht.o drv_anim.o drv_poly.o drv_approx.o compat_dummy.o $(RNDLIB) +ttf2lht: ttf2lht.o drv_anim.o drv_poly.o compat_dummy.o $(RNDLIB) -$(TRUNK)/src_plugins/import_ttf/ttf_load.o: $(TRUNK)/src_plugins/import_ttf/ttf_load.c $(TRUNK)/src_plugins/import_ttf/ttf_load.h +$(PLUGIN)/ttf_load.o: $(PLUGIN)/ttf_load.c $(PLUGIN)/ttf_load.h +$(PLUGIN)/drv_approx.o: $(PLUGIN)/drv_approx.c $(PLUGIN)/drv_approx.h $(PLUGIN)/ttf_load.h + $(RND): cd $(RNDLIB) && make