From: Ingo Krabbe Date: Sat, 9 Jul 2016 08:47:45 +0000 (+0200) Subject: fixed metapost core plugin to compile X-Git-Tag: untagged-fd4ca25a4ca4e4dc471c~6^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c58dc8b2e4444e5a5a70ef122f341a70acda4883;p=graphviz fixed metapost core plugin to compile --- diff --git a/plugin/core/Makefile.am b/plugin/core/Makefile.am index 9fb63f562..1ff24d6a9 100644 --- a/plugin/core/Makefile.am +++ b/plugin/core/Makefile.am @@ -29,6 +29,7 @@ libgvplugin_core_C_la_SOURCES = \ gvrender_core_json.c \ gvrender_core_fig.c \ gvrender_core_map.c \ + gvrender_core_mp.c \ gvrender_core_ps.c \ gvrender_core_svg.c \ gvrender_core_tk.c \ diff --git a/plugin/core/gvrender_core_mp.c b/plugin/core/gvrender_core_mp.c index 4962793d0..5b729ea50 100644 --- a/plugin/core/gvrender_core_mp.c +++ b/plugin/core/gvrender_core_mp.c @@ -30,9 +30,9 @@ #include "macros.h" #include "const.h" -#include "gvio.h" #include "gvplugin_render.h" #include "gvplugin_device.h" +#include "gvio.h" #include "agxbuf.h" #include "utils.h" #include "color.h" @@ -201,7 +201,7 @@ static void mp_begin_graph(GVJ_t * job) gvputs(job, "#FIG 3.2\n"); gvprintf(job, "# Generated by %s version %s (%s)\n", job->common->info[0], job->common->info[1], job->common->info[2]); - gvprintf(job, "# Title: %s\n", obj->u.g->name); + gvprintf(job, "# Title: %s\n", agnameof(obj->u.g)); gvprintf(job, "# Pages: %d\n", job->pagesArraySize.x * job->pagesArraySize.y); gvputs(job, "Portrait\n"); /* orientation */ gvputs(job, "Center\n"); /* justification */ @@ -244,7 +244,7 @@ static void mp_end_edge(GVJ_t * job) Depth = 2; } -static void mp_textpara(GVJ_t * job, pointf p, textpara_t * para) +static void mp_textspan(GVJ_t * job, pointf p, textspan_t * span) { obj_state_t *obj = job->obj; @@ -254,16 +254,16 @@ static void mp_textpara(GVJ_t * job, pointf p, textpara_t * para) int depth = Depth; int pen_style = 0; /* not used */ int font = -1; /* init to xfig's default font */ - double font_size = para->fontsize * job->zoom; + double font_size = span->font->size * job->zoom; double angle = job->rotation ? (M_PI / 2.0) : 0.0; int font_flags = 4; /* PostScript font */ double height = 0.0; double length = 0.0; - if (para->postscript_alias) /* if it is a standard postscript font */ - font = para->postscript_alias->xfig_code; + if (span->font->postscript_alias) /* if it is a standard postscript font */ + font = span->font->postscript_alias->xfig_code; - switch (para->just) { + switch (span->just) { case 'l': sub_type = 0; break; @@ -280,7 +280,7 @@ static void mp_textpara(GVJ_t * job, pointf p, textpara_t * para) "%d %d %d %d %d %d %.1f %.4f %d %.1f %.1f %d %d %s\\001\n", object_code, sub_type, color, depth, pen_style, font, font_size, angle, font_flags, height, length, ROUND(p.x), ROUND(p.y), - mp_string(para->str)); + mp_string(span->str)); } static void mp_ellipse(GVJ_t * job, pointf * A, int filled) @@ -493,7 +493,7 @@ gvrender_engine_t mp_engine = { 0, /* mp_end_anchor */ 0, /* mp_begin_label */ 0, /* mp_end_label */ - mp_textpara, + mp_textspan, mp_resolve_color, mp_ellipse, mp_polygon,