Index: ttf2lht/Makefile =================================================================== --- ttf2lht/Makefile (revision 18932) +++ ttf2lht/Makefile (revision 18933) @@ -1,8 +1,9 @@ -RND=../../../trunk/src -RND3=../../../trunk/src_3rd +TRUNK=../../../trunk +RND=$(TRUNK)/src +RND3=$(TRUNK)/src_3rd RNDLIB=$(RND)/polygon1.o $(RND)/heap.o $(RND)/rtree.o \ $(RND3)/genvector/gds_char.o $(RND3)/genvector/vtp0.o -CFLAGS = -Wall -g -I/usr/include/freetype2 +CFLAGS = -Wall -g -I/usr/include/freetype2 -I$(TRUNK) -I$(RND3) LDFLAGS = -lfreetype -lm Index: ttf2lht/drv_poly.c =================================================================== --- ttf2lht/drv_poly.c (revision 18932) +++ ttf2lht/drv_poly.c (revision 18933) @@ -2,9 +2,29 @@ #include "drv_poly.h" #include "drv_approx.h" +#define APPEND(list, pl) \ +do { \ + pl->next = list; \ + list = pl; \ +} while(0) + +static void pline_close(poly_stroke_t *s) +{ + if (s->curr == NULL) + return; + APPEND(s->pos, s->curr); + s->curr = NULL; +} + static int stroke_poly_move_to(const FT_Vector *to, void *s_) { poly_stroke_t *s = (poly_stroke_t *)s_; + pcb_vector_t v; + + pline_close(s); + v[0] = to->x; + v[1] = to->y; + s->curr = pcb_poly_contour_new(v); s->s.x = to->x; s->s.y = to->y; return 0; @@ -19,12 +39,14 @@ return 0; } -void stroke_poly_init(stroke_t *s) +void stroke_poly_init(stroke_t *s_) { } -void stroke_poly_uninit(stroke_t *s) +void stroke_poly_uninit(stroke_t *s_) { + poly_stroke_t *s = (poly_stroke_t *)s_; + pline_close(s); } poly_stroke_t poly_stroke = { Index: ttf2lht/drv_poly.h =================================================================== --- ttf2lht/drv_poly.h (revision 18932) +++ ttf2lht/drv_poly.h (revision 18933) @@ -1,5 +1,13 @@ +#include "config.h" +#include "src/pcb_bool.h" +#include "src/rtree.h" +#include "src/polyarea.h" + typedef struct { stroke_t s; + pcb_pline_t *curr; + pcb_pline_t *pos; + pcb_pline_t *neg; } poly_stroke_t; extern poly_stroke_t poly_stroke;