Index: libuhpgl.h =================================================================== --- libuhpgl.h (revision 11233) +++ libuhpgl.h (revision 11234) @@ -40,6 +40,8 @@ typedef enum uhpgl_fill_type_s { UHPGL_FILL_NONE, + UHPGL_FILL_PAINT1, + UHPGL_FILL_PAINT2, UHPGL_FILL_SINGLE, UHPGL_FILL_CROSS } uhpgl_fill_type_t; @@ -48,6 +50,7 @@ uhpgl_fill_type_t type; /* UHPGL_FILL_NONE if no fill */ uhpgl_coord_t spacing; uhpgl_angle_t angle; + double pen_thick; unsigned stroke:1; /* 1 if stroked */ } uhpgl_fill_stroke_t; @@ -126,6 +129,7 @@ unsigned pen_down:1; /* whether pen is down (drawing) */ uhpgl_point_t at; /* last known coordinate of the pen */ int ct; /* Chord Tolerance */ + uhpgl_fill_stroke_t fill; /* last char parsed */ size_t offs; Index: parse.c =================================================================== --- parse.c (revision 11233) +++ parse.c (revision 11234) @@ -245,10 +245,10 @@ case inst2num('C','I'): case inst2num('A','A'): case inst2num('A','R'): + case inst2num('F','T'): + case inst2num('P','T'): /* case inst2num('L','T'): - case inst2num('F','T'): - case inst2num('P','T'): case inst2num('W','G'): case inst2num('E','W'): case inst2num('R','A'): @@ -336,6 +336,24 @@ return -1; } return 0; + case inst2num('F','T'): + if (is_last) { + switch(p->argc) { + case 3: ctx->state.fill.angle = p->argv[2]; + case 2: ctx->state.fill.spacing = p->argv[1]; + case 1: ctx->state.fill.type = p->argv[0]; break; + case 0: ctx->state.fill.type = 1; break; + default: + return error(ctx, "Wrong number of arguments (expected 0, 1, 2 or 3)"); + } + } + return 0; + case inst2num('P','T'): + if ((p->argc == 1) && (is_last)) { + ctx->state.fill.pen_thick = p->argv[0]; + return 0; + } + return error(ctx, "PT needs 1 argument"); } return error(ctx, "unimplemented coord instruction"); }