op->kind = xd_grad_pen_color;
op->u.grad_color = clr;
if (ops)
- op->drawfunc = ops[xop_grad_pen_color];
+ op->drawfunc = ops[xop_grad_color];
}
break;
op->kind = xd_grad_fill_color;
op->u.grad_color = clr;
if (ops)
- op->drawfunc = ops[xop_grad_fill_color];
+ op->drawfunc = ops[xop_grad_color];
}
break;
op->drawfunc = ops[xop_image];
break;
+ case 't':
+ op->kind = xd_fontchar;
+ s = parseInt(s, &op->u.fontchar);
+ CHK(s);
+ if (ops)
+ op->drawfunc = ops[xop_fontchar];
+ break;
+
case '\0':
s = 0;
break;
case xd_filled_bezier:
print("b", info);
- op->kind = xd_filled_bezier;
printPolyline(&op->u.bezier, print, info);
break;
case xd_unfilled_bezier:
break;
case xd_font:
print("F", info);
- op->kind = xd_font;
printFloat(op->u.font.size, print, info, 1);
printString(op->u.font.name, print, info);
break;
+ case xd_fontchar:
+ print("t", info);
+ printInt(op->u.fontchar, print, info);
+ break;
case xd_style:
print("S", info);
printString(op->u.style, print, info);
jsonString(op->u.font.name, print, info);
print("]", info);
break;
+ case xd_fontchar:
+ print("{t : ", info);
+ printInt(op->u.fontchar, print, info);
+ break;
case xd_style:
print("{S : ", info);
jsonString(op->u.style, print, info);
case xd_pen_color:
sp->n_color++;
break;
+ case xd_grad_fill_color:
+ case xd_grad_pen_color:
+ sp->n_gradcolor++;
+ break;
case xd_font:
sp->n_font++;
break;
+ case xd_fontchar:
+ sp->n_fontchar++;
+ break;
case xd_style:
sp->n_style++;
break;
#ifdef _WIN32
#include <windows.h>
#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define INITIAL_XDOT_CAPACITY 512
typedef enum {
xd_filled_bezier, xd_unfilled_bezier,
xd_polyline, xd_text,
xd_fill_color, xd_pen_color, xd_font, xd_style, xd_image,
- xd_grad_fill_color, xd_grad_pen_color
+ xd_grad_fill_color, xd_grad_pen_color,
+ xd_fontchar
} xdot_kind;
typedef enum {
xop_bezier,
xop_polyline, xop_text,
xop_fill_color, xop_pen_color, xop_font, xop_style, xop_image,
- xop_grad_fill_color, xop_grad_pen_color
+ xop_grad_color,
+ xop_fontchar
} xop_kind;
typedef struct _xdot_op xdot_op;
xdot_color grad_color; /* xd_grad_fill_color, xd_grad_pen_color */
xdot_font font; /* xd_font */
char* style; /* xd_style */
+ int fontchar; /* xd_fontchar */
} u;
drawfunc_t drawfunc;
};
int n_style;
int n_color;
int n_image;
+ int n_gradcolor;
+ int n_fontchar;
} xdot_stats;
/* ops are indexed by xop_kind */
extern char* parseXDotColor (char* cp, xdot_color* clr);
extern void freeXDotColor (xdot_color*);
+#ifdef __cplusplus
+}
+#endif
#endif