--- term/svg.trm.ORG	Tue Jan  8 12:03:26 2008
+++ term/svg.trm	Fri Feb 15 14:16:52 2008
@@ -41,6 +41,8 @@
  * Ethan Merritt  <merritt@u.washington.edu>
  */
 
+#define NOUSETAGOPT
+
 #include "driver.h"
 
 #ifdef TERM_REGISTER
@@ -163,6 +165,9 @@
 /* Support for dashed lines */
 #define SVG_dashtypes 5
 static TBOOLEAN SVG_dashed = FALSE;
+#ifdef NOUSETAGOPT
+static TBOOLEAN SVG_nousetag = FALSE;
+#endif
 static char *SVG_dashpattern[SVG_dashtypes] = {
     "", " 5,8", " 1,4", " 8,4,2,4", " 9,4,1,4,1,4"
     };
@@ -551,6 +556,13 @@
 	    continue;
 	}
 									
+#ifdef NOUSETAGOPT
+	if (almost_equals(c_token, "nouse$tag")) {
+	    c_token++;
+	    SVG_nousetag = TRUE;
+	    continue;
+	}
+#endif
 	int_error(c_token, "unrecognized terminal option");
     }
 
@@ -580,6 +592,12 @@
 	    "linewidth %3.1f ", SVG_linewidth_factor);
     }
 
+#ifdef NOUSETAGOPT
+    if (SVG_nousetag) {
+	sprintf(term_options + strlen(term_options),
+		"nousetag ");
+    }
+#endif
 }
 
 static void
@@ -710,6 +728,9 @@
     /* "\t<path id='gpPt3' style='stroke-width:%.3f' d='M-1,-1 h2 v2 h-2 z'/>\n" */
 
     stroke_width = 2.0 *SVG_SCALE / term->h_tic;
+#ifdef NOUSETAGOPT
+    if (!SVG_nousetag) 
+#endif
     fprintf (gpoutfile,
 	     "\n"
 	     /* dot: */
@@ -754,6 +775,10 @@
 	     , stroke_width
 	     , stroke_width
 	);
+#ifdef NOUSETAGOPT
+    else
+      fprintf (gpoutfile,"\n</defs>\n");
+#endif
 }
 
 /*------------------------------------------------------------------------------------------------------------------------------------
@@ -897,16 +922,86 @@
     SVG_PathClose ();
 
     if (number < 0) {		/* do dot */
+#ifndef NOUSETAGOPT
 	fprintf (gpoutfile, "\
 \t<use xlink:href='#gpDot' x='%.1f' y='%.1f'%s/>\n",
 		 X(x), Y(y), color_spec);
+#else
+	fprintf (gpoutfile, 
+		 (! SVG_nousetag) ? 
+		 "\t<use xlink:href='#gpDot' x='%.1f' y='%.1f'%s/>\n" :
+		 "\t<circle r='1' cx='%.1f' cy='%.1f'%s/>\n",  
+		 X(x), Y(y), color_spec);
+#endif
     } else {			/* draw a point symbol */
+#ifdef NOUSETAGOPT
+	if (! SVG_nousetag) 
+#endif
 	fprintf (gpoutfile, "\
 \t<use xlink:href='#gpPt%u' transform='translate(%.1f,%.1f) scale(%.2f)'%s/>\
 \n",
 		 number % 13, X(x), Y(y),
 		 term_pointsize * term->h_tic / (2 * SVG_SCALE),
 		 color_spec);
+#ifdef NOUSETAGOPT
+	else {
+	    char *pntformat[]={
+		/* gpPt0 */
+		"<path style='stroke-width:%.3f' d='M-1,0 h2 M0,-1 v2'",
+		/* gpPt1 */
+		"<path style='stroke-width:%.3f' d='M-1,-1 L1,1 M1,-1 L-1,1'",
+		/* gpPt2 */
+		"<path style='stroke-width:%.3f' d='M-1,0 L1,0 M0,-1 L0,1 M-1,-1 L1,1 M-1,1 L1,-1'",
+		/* gpPt3 */
+		"<rect style='stroke-width:%.3f' x='-1' y='-1' width='2' height='2'",
+		/* gpPt4 */
+		"<rect style='stroke-width:%.3f; fill:currentColor' x='-1' y='-1' width='2' height='2'",
+		/* gpPt5 */
+		"<circle style='stroke-width:%.3f' cx='0' cy='0' r='1'",
+		/* gpPt6 */
+		"<circle style='fill:currentColor; stroke:none' cx='0' cy='0' r='1'",
+		/* gpPt7 */
+		"<path style='stroke-width:%.3f' d='M0,-1.33 L-1.33,0.67 L1.33,0.67 z'",
+		/* gpPt8 */
+		"<path style='fill:currentColor; stroke:none' d='M0,-1.33 L-1.33,0.67 L1.33,0.67 z'",
+		/* gpPt9 */
+		"<path style='stroke-width:%.3f' d='M0,-1.33 L-1.33,0.67 L1.33,0.67 z'",
+		/* gpPt10 */
+		"<path style='fill:currentColor; stroke:none' d='M0,-1.33 L-1.33,0.67 L1.33,0.67 z'",
+		/* gpPt11 */
+		"<rect style='stroke-width:%.3f' x='-1' y='-1' width='2' height='2'",
+		/* gpPt12 */
+		"<rect style='fill:currentColor; stroke:none' x='-1' y='-1' width='2' height='2'"
+	    };
+	    int needstrokewidth[] = {1,1,1,1,1,1,0,1,0,1,0,1,0};
+	    int rotateangles[]   = {0,0,0,0,0,0,0,0,0,180,180,45,45};
+	    double stroke_width = 2.0 * SVG_SCALE / term->h_tic;
+	    char formatbuffer[512];
+	    int n;
+
+	    n = number % 13;
+	    if (rotateangles[n] == 0) {
+		sprintf(formatbuffer,
+	"\t%s transform='translate(%%.1f,%%.1f) scale(%%.2f)'%%s/>\n",
+			pntformat[n]);
+	    } else {
+		sprintf(formatbuffer,
+	"\t%s transform='translate(%%.1f,%%.1f) scale(%%.2f) rotate(%d)'%%s/>\n",
+			pntformat[n],rotateangles[n]);
+	    }
+	    if (needstrokewidth[n]) {
+		fprintf(gpoutfile, formatbuffer,
+			stroke_width, X(x), Y(y), 
+			term_pointsize * term->h_tic / (2 * SVG_SCALE),
+			color_spec);
+	    } else {
+		fprintf(gpoutfile, formatbuffer,
+			X(x), Y(y), 
+			term_pointsize * term->h_tic / (2 * SVG_SCALE),
+			color_spec);
+	    }
+	}
+#endif /* NOUSETAGOPT */
     }
     SVG_xLast = x;
     SVG_yLast = y;
@@ -1458,6 +1553,9 @@
 " Syntax:",
 "       set terminal svg {size <x>,<y> {|fixed|dynamic}}",
 "                        {{no}enhanced}",
+#ifdef NOUSETAGOPT
+"                        {nousetag}",
+#endif
 "                        {fname \"<font>\"} {fsize <fontsize>}",
 "                        {font \"<fontname>{,<fontsize>}\"}",
 "                        {fontfile <filename>}",
