summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/mplibdir/svgout.w
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/mplibdir/svgout.w')
-rw-r--r--Build/source/texk/web2c/mplibdir/svgout.w10
1 files changed, 7 insertions, 3 deletions
diff --git a/Build/source/texk/web2c/mplibdir/svgout.w b/Build/source/texk/web2c/mplibdir/svgout.w
index 22072530ac0..b2da35a0ea4 100644
--- a/Build/source/texk/web2c/mplibdir/svgout.w
+++ b/Build/source/texk/web2c/mplibdir/svgout.w
@@ -434,7 +434,6 @@ static void mp_svg_print_initial_comment(MP mp,mp_edge_object *hh);
@ @c
void mp_svg_print_initial_comment(MP mp,mp_edge_object *hh) {
scaled t, tx, ty;
- mp_svg_print(mp, "<?xml version=\"1.0\"?>");
@<Print the MetaPost version and time @>;
mp_svg_open_starttag(mp,"svg");
mp_svg_attribute(mp,"version", "1.1");
@@ -738,7 +737,6 @@ static void mp_svg_path_trans_out (MP mp, mp_knot *h, mp_pen_info *pen) {
mp_svg_trans_pair_out(mp, pen,gr_x_coord(q),gr_y_coord(q));
} else if ( q!=h ){
append_char('L');
- mp_svg_print(mp, "L ");
mp_svg_trans_pair_out(mp, pen,gr_x_coord(q),gr_y_coord(q));
}
p=q;
@@ -1203,7 +1201,13 @@ int mp_svg_gr_ship_out (mp_edge_object *hh, int qprologues, int standalone) {
mp_open_output_file(mp);
if ( (qprologues>=1) && (mp->last_ps_fnum<mp->last_fnum) )
mp_read_psname_table(mp);
- mp_svg_print_initial_comment(mp, hh);
+ /* The next seems counterintuitive, but calls from |mp_svg_ship_out|
+ * set standalone to true, and because embedded use is likely, it is
+ * better not to output the XML declaration in that case.
+ */
+ if (!standalone)
+ mp_svg_print(mp, "<?xml version=\"1.0\"?>");
+ mp_svg_print_initial_comment(mp, hh);
if (qprologues == 3) {
mp_svg_print_glyph_defs(mp, hh);
}