Commit 291f776d authored by John Ellson's avatar John Ellson Committed by GitHub

Merge pull request #1133 from ikrabbe/master

fixed metapost core plugin to compile
parents 9e4b5552 c58dc8b2
......@@ -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 \
......
......@@ -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,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment