GD_ranksep(g) = POINTS(xf);
GD_showboxes(g) = late_int(g, agfindattr(g, "showboxes"), 0, 0);
+ GD_fontmangling(g) = mapbool(agget(g,"fontmangling"));
setRatio(g);
GD_drawing(g)->filled =
boolean has_flat_edges;
unsigned char showboxes;
boolean cluster_was_collapsed;
+ boolean fontmangling; /* to override in SVG */
int nodesep, ranksep;
node_t *ln, *rn; /* left, right nodes of bounding box */
#define GD_set_type(g) (g)->u.set_type
#define GD_label_pos(g) (g)->u.label_pos
#define GD_showboxes(g) (g)->u.showboxes
+#define GD_fontmangling(g) (g)->u.fontmangling
#define GD_spring(g) (g)->u.spring
#define GD_sum_t(g) (g)->u.sum_t
#define GD_t(g) (g)->u.t
/* render defaults set from graph */
gvcolor_t bgcolor; /* background color */
+
+ /* whether to mangle font names (at least in SVG), usually false */
+ boolean fontmangling;
};
#ifdef __cplusplus
#include "const.h"
#include "gvplugin_render.h"
+#include "gvcint.h"
#include "graph.h"
typedef enum { FORMAT_SVG, FORMAT_SVGZ, } format_type;
}
core_printf(job, " x=\"%g\" y=\"%g\"", p.x, -p.y);
core_fputs(job, " style=\"");
- if (para->postscript_alias) {
+ if (para->postscript_alias && GD_fontmangling(job->gvc->g)) {
+ /* i'm disabling this as the default because mapping "Times-Roman"
+ to "Nimbus Roman No9" does no good in the rendered SVG. in SVG
+ the only universal font families are Serif, Sans-Serif, Monospace,
+ Cursive and Fantasy but according to w3c, CSS can generally handle
+ the standard Postrscript names. */
core_printf(job, "font-family:%s;", para->postscript_alias->family);
if (para->postscript_alias->weight)
core_printf(job, "font-weight:%s;", para->postscript_alias->weight);