[mdk-re] Патчи к xfig (было: Origin like progs...)

Yura Zotov =?iso-8859-1?q?yznews_=CE=C1_hotbox=2Eru?=
Чт Янв 10 19:49:54 MSK 2002


On Thu, Jan 10, 2002 at 02:50:16PM +0300, Serge Skorokhodov wrote:
> Здравствуйте!
> 
> YZ> On Wed, Jan 09, 2002 at 04:20:21PM +0300, Vyacheslav Sokolov wrote:
> >> Serge Skorokhodov wrote:
> >>
> 
> YZ> <skip>
> 
> >> А вот готовые данные изобразить, да так, чтобы не стыдно было в приличный
> >> журнал послать - здесь и нужен Origin. 
> 
> YZ> Авторитетно заявляю: в ЖЭТФ все картинки перерисовываются РУКАМИ
> YZ> МОЕЙ ЖЕНЫ + gnuplot + xfig немного пропатченный. Так что
>                           ^^^^^^^^^^^^^^^^^^^^^^^^^
> Стоп, а что значит "про-пат-чен-ный"?? В смысле кирилицу делает?
> Тогда где па-т-ч такой взять?
>

Точно сказать не могу. Патч написал один умелец из ИФП по фамилии
Завьялов, никуда его не отсылал. Какие-то исправления для работы
с LaTeX плюс некая автоматизация вызовов transfig, latex, dvips
после записи для получения готовой картинки из pstex
представления. В таком виде русские буквы пишутся LaTeX-овскими
шрифтами, нам большего и не надо.

Патчи прицепил, смотрите


--
Юрий А. Зотов
----------- следующая часть -----------
diff -uNr transfig.3.2.3d.orig1/fig2dev/dev/genepic.c transfig.3.2.3d/fig2dev/dev/genepic.c
--- transfig.3.2.3d.orig1/fig2dev/dev/genepic.c	Wed Jul 12 01:50:28 2000
+++ transfig.3.2.3d/fig2dev/dev/genepic.c	Sat Oct  6 01:49:55 2001
@@ -1302,9 +1302,9 @@
 	      }
 	    }
 	    else
-	        if (*cp >= 0xa0)	/* we escape 8-bit char */
-	    		fprintf(tfp, "%s", ISOtoTeX[(int)*cp-0xa0]);
-		else
+//	        if (*cp >= 0xa0)	/* we escape 8-bit char */
+//	    		fprintf(tfp, "%s", ISOtoTeX[(int)*cp-0xa0]);
+//		else
 			fputc(*cp, tfp);
 	  }
     fprintf(tfp, "}}}}}\n");
diff -uNr transfig.3.2.3d.orig1/fig2dev/dev/genlatex.c transfig.3.2.3d/fig2dev/dev/genlatex.c
--- transfig.3.2.3d.orig1/fig2dev/dev/genlatex.c	Thu Jul 20 03:16:38 2000
+++ transfig.3.2.3d/fig2dev/dev/genlatex.c	Sat Oct  6 01:50:04 2001
@@ -800,9 +800,9 @@
 			fputc(*cp, tfp);
 		    else
 #endif
-		    if (*cp >= 0xa0)
-			 fprintf(tfp, "%s", ISOtoTeX[(int)*cp-0xa0]);
-		else
+//		    if (*cp >= 0xa0)
+//			 fprintf(tfp, "%s", ISOtoTeX[(int)*cp-0xa0]);
+//		else
 		    fputc(*cp, tfp);
 		}
 
diff -uNr transfig.3.2.3d.orig1/fig2dev/dev/genpictex.c transfig.3.2.3d/fig2dev/dev/genpictex.c
--- transfig.3.2.3d.orig1/fig2dev/dev/genpictex.c	Thu May  4 00:47:04 2000
+++ transfig.3.2.3d/fig2dev/dev/genpictex.c	Sat Oct  6 01:49:24 2001
@@ -639,9 +639,9 @@
 	      	}
 	else 
 		for(cp = (unsigned char*)t->cstring; *cp; cp++) {
-		    if (*cp >= 0xa0)
-		         fprintf(tfp, "%s", ISOtoTeX[(int)*cp-0xa0]);
-		else
+//		    if (*cp >= 0xa0)
+//		         fprintf(tfp, "%s", ISOtoTeX[(int)*cp-0xa0]);
+//		else
 		    fputc(*cp, tfp);
 		}
 
----------- следующая часть -----------
diff -uNr transfig.3.2.3d.orig/fig2dev/dev/genpstex.c transfig.3.2.3d/fig2dev/dev/genpstex.c
--- transfig.3.2.3d.orig/fig2dev/dev/genpstex.c	Wed Jul 12 01:51:27 2000
+++ transfig.3.2.3d/fig2dev/dev/genpstex.c	Mon Sep 24 17:26:18 2001
@@ -92,7 +92,8 @@
 #  if defined(EPSFIG)
 		fprintf(tfp, "\\epsfig{file=%s}%%\n",pstex_file); 
 #  else
-		fprintf(tfp, "\\includegraphics{%s}%%\n",pstex_file);
+//		fprintf(tfp, "\\includegraphics{%s}%%\n",pstex_file);
+		fprintf(tfp, "\\includegraphics*{%s}%%\n",pstex_file);
 #  endif
 #else
 		fprintf(tfp, "\\special{psfile=%s}%%\n",pstex_file);
diff -uNr transfig.3.2.3d.orig/fig2dev/dev/texfonts.c transfig.3.2.3d/fig2dev/dev/texfonts.c
--- transfig.3.2.3d.orig/fig2dev/dev/texfonts.c	Wed Nov 24 01:42:30 1999
+++ transfig.3.2.3d/fig2dev/dev/texfonts.c	Mon Sep 24 17:24:24 2001
@@ -16,12 +16,12 @@
  */
 
 static char		*texfontnames[] = {
-			"rm", "rm",		/* default */
-			"rm",			/* roman */
-			"bf",			/* bold */
-			"it",			/* italic */
-			"sf", 			/* sans serif */
-			"tt"			/* typewriter */
+                       "",                     /* default */
+                       "rmfamily",                     /* roman */
+                       "bfseries",                     /* bold */
+                       "itshape",                      /* italic */
+                       "sffamily",                     /* sans serif */
+                       "ttfamily"                      /* typewriter */
 		};
 
 /* The selection of font names may be site dependent.
----------- следующая часть -----------
diff -uNr xfig.3.2.3d.orig/f_save.c xfig.3.2.3d/f_save.c
--- xfig.3.2.3d.orig/f_save.c	Thu Oct 18 13:56:11 2001
+++ xfig.3.2.3d/f_save.c	Thu Oct 18 13:43:17 2001
@@ -400,9 +400,10 @@
 	if (c == '\\')
 	    fprintf(fp,"\\\\");	 /* escape a '\' with another one */
 //	else if (c < 0x80)
-	    putc(c,fp);  /* normal 7-bit ASCII */
+//	    putc(c,fp);  /* normal 7-bit ASCII */
 //	else
 //	    fprintf(fp, "\\%o", c);  /* 8-bit, make \xxx (octal) */
+	else putc(c,fp);
     }
     fprintf(fp,"\\001\n");	      /* finish off with '\001' string */
 }
diff -uNr xfig.3.2.3d.orig/w_drawprim.c xfig.3.2.3d/w_drawprim.c
--- xfig.3.2.3d.orig/w_drawprim.c	Fri Feb  2 00:40:36 2001
+++ xfig.3.2.3d/w_drawprim.c	Thu Oct 18 13:43:17 2001
@@ -119,10 +119,10 @@
 	    strcpy(template,x_fontinfo[0].template);  /* nope, check for font size 0 */
 	    strcat(template,"0-0-*-*-*-*-");
 	    /* add ISO8859 (if not Symbol font or ZapfDingbats) to font name */
-	    if (strstr(template,"symbol") == NULL &&
-		strstr(template,"zapf dingbats") == NULL)
-		    strcat(template,"ISO8859-*");
-	    else
+//	    if (strstr(template,"symbol") == NULL &&
+//		strstr(template,"zapf dingbats") == NULL)
+//		    strcat(template,"ISO8859-*");
+//	    else
 		strcat(template,"*-*");
 	    if ((fontlist = XListFonts(tool_d, template, 1, &count))==0)
 		appres.scalablefonts = False;	/* none, turn off request for them */
@@ -139,10 +139,10 @@
 	    strcpy(template,x_fontinfo[f].template);
 	    strcat(template,"*-*-*-*-*-*-");
 	    /* add ISO8859 (if not Symbol font or ZapfDingbats) to font name */
-	    if (strstr(template,"symbol") == NULL &&
-		strstr(template,"zapf dingbats") == NULL)
-		    strcat(template,"ISO8859-*");
-	    else
+//	    if (strstr(template,"symbol") == NULL &&
+//		strstr(template,"zapf dingbats") == NULL)
+//		    strcat(template,"ISO8859-*");
+//	    else
 		strcat(template,"*-*");
 	    /* don't free the Fontlist because we keep pointers into it */
 	    p = 0;
@@ -283,10 +283,10 @@
 		/* attach pointsize to font name */
 		strcat(template,"%d-*-*-*-*-*-");
 		/* add ISO8859 (if not Symbol font or ZapfDingbats) to font name */
-		if (strstr(template,"symbol") == NULL &&
-		    strstr(template,"zapf dingbats") == NULL)
-			strcat(template,"ISO8859-*");
-	        else
+//		if (strstr(template,"symbol") == NULL &&
+//		    strstr(template,"zapf dingbats") == NULL)
+//			strcat(template,"ISO8859-*");
+//	        else
 			strcat(template,"*-*");
 		/* use the pixel field instead of points in the fontname so that the
 		font scales with screen size */
@@ -295,10 +295,10 @@
 		strcpy(template,x_backup_fontinfo[fnum].template);
 		strcat(template,"%d-*-*-*-*-*-");
 		/* add ISO8859 (if not Symbol font or ZapfDingbats) to font name */
-		if (strstr(template,"symbol") == NULL &&
-		    strstr(template,"zapf dingbats") == NULL)
-			strcat(template,"ISO8859-*");
-	        else
+//		if (strstr(template,"symbol") == NULL &&
+//		    strstr(template,"zapf dingbats") == NULL)
+//			strcat(template,"ISO8859-*");
+//	        else
 			strcat(template,"*-*");
 		sprintf(back_fn, template, size);
 	    }
----------- следующая часть -----------
diff -uNr xfig.3.2.3d.orig/f_save.c xfig.3.2.3d/f_save.c
--- xfig.3.2.3d.orig/f_save.c	Tue Jul  4 01:37:21 2000
+++ xfig.3.2.3d/f_save.c	Mon Sep 17 15:59:28 2001
@@ -25,6 +25,12 @@
 #include "w_setup.h"
 #include "w_zoom.h"
 
+#include "f_util.h"
+ char *mycommand;
+ char *mycommandstring="xfig_at_save_batch";
+//-----------------------------
+
+
 static int write_tmpfile=0;
 
 init_write_tmpfile()
@@ -59,7 +65,13 @@
 	return (-1);
     }
     if (!update_figs)
-	put_msg("%d object(s) saved in \"%s\"", num_object, file_name);
+//	put_msg("%d object(s) saved in \"%s\"", num_object, file_name);
+     mycommand = build_command(mycommandstring, file_name);
+         put_msg("%d object(s) saved in \"%s\"       Launching \"xfig_at_save_batch %s\"",\
+                         num_object, file_name, file_name);
+              system(mycommand);
+               free(mycommand);
+//-------------------------------
 
     /* update the recent list if caller desires */
     if (update_recent)
@@ -387,10 +399,10 @@
 	c = t->cstring[l];
 	if (c == '\\')
 	    fprintf(fp,"\\\\");	 /* escape a '\' with another one */
-	else if (c < 0x80)
+//	else if (c < 0x80)
 	    putc(c,fp);  /* normal 7-bit ASCII */
-	else
-	    fprintf(fp, "\\%o", c);  /* 8-bit, make \xxx (octal) */
+//	else
+//	    fprintf(fp, "\\%o", c);  /* 8-bit, make \xxx (octal) */
     }
     fprintf(fp,"\\001\n");	      /* finish off with '\001' string */
 }


Подробная информация о списке рассылки community