static void mif_set_color(GVJ_t * job, char *name) { int i; for (i = 0; i < (sizeof(mif_colors)/sizeof(mif_color_t)); i++) { if (strcasecmp(mif_colors[i].name, name) == 0) mif_color(job, i); } agerr(AGERR, "color %s not supported in MIF\n", name); }
static void mif_style(GVJ_t * job, int filled) { obj_state_t *obj = job->obj; gvputs(job, "style=\"fill:"); if (filled) mif_color(job->obj->fillcolor); else gvputs(job, "none"); gvputs(job, ";stroke:"); while ((line = *s++)) { if (streq(line, "solid")) pen = P_SOLID; else if (streq(line, "dashed")) pen = P_DASHED; else if (streq(line, "dotted")) pen = P_DOTTED; else if (streq(line, "invis")) pen = P_NONE; else if (streq(line, "bold")) penwidth = WIDTH_BOLD; else if (streq(line, "filled")) fill = P_SOLID; else if (streq(line, "unfilled")) fill = P_NONE; else { agerr(AGERR, "mif_style: unsupported style %s - ignoring\n", line); } } fw = fa = "Regular"; switch (cp->fontopt) { case BOLD: fw = "Bold"; break; case ITALIC: fa = "Italic"; break; } gvprintf(job, "<Font <FFamily `%s'> <FSize %.1f pt> <FWeight %s> <FAngle %s>>\n", cp->fontfam, job->scale.x * cp->fontsz, fw, fa); gvprintf(job, "<Pen %d> <Fill %d> <PenWidth %d>\n", job->pen, job->fill, job->penwidth); }
static void mif_end_context(void) { int c, psp = SP - 1; assert(SP > 0); if (cstk[SP].color_ix != (c = cstk[psp].color_ix)) mif_color(c); if (cstk[SP].font_was_set) mif_font(&(cstk[psp])); if (cstk[SP].style_was_set) mif_style(&(cstk[psp])); /*free(cstk[psp].fontfam); */ SP = psp; }
static void mif_set_color(char *name) { int i; char *tok; static char *mifcolor[] = { "black", "white", "red", "green", "blue", "cyan", "magenta", "yellow", "comment", "aquamarine", "plum", "peru", "pink", "mediumpurple", "grey", "lightgrey", "lightskyblue", "lightcoral", "yellowgreen", (char *) 0 }; tok = canontoken(name); for (i = 0; mifcolor[i]; i++) { if (strcasecmp(mifcolor[i], tok) == 0) { cstk[SP].color_ix = i; mif_color(i); return; } } agerr(AGERR, "color %s not supported in MIF\n", name); }