forked from pool/transfig
348 lines
9.7 KiB
Plaintext
348 lines
9.7 KiB
Plaintext
--- Imakefile
|
|
+++ Imakefile 2006-07-31 17:14:30.000000000 +0000
|
|
@@ -1,7 +1,3 @@
|
|
-#ifndef XCOMM
|
|
-#define XCOMM #
|
|
-#endif
|
|
-
|
|
XCOMM Top level Makefile for TransFig
|
|
|
|
XCOMM TransFig: Facility for Translating Fig code
|
|
@@ -24,6 +20,7 @@ XCOMM type "xmkmf", "make Makefiles", "m
|
|
#define IHaveSubdirs
|
|
#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
|
|
|
|
+MFLAGS = XFIGLIBDIR=_DATA/xfig
|
|
DEPLIBS =
|
|
SUBDIRS = fig2dev transfig
|
|
MakeSubdirs($(SUBDIRS))
|
|
--- doc/manual/Makefile
|
|
+++ doc/manual/Makefile 2007-07-24 15:30:27.000000000 +0000
|
|
@@ -2,7 +2,7 @@
|
|
# TransFig makefile
|
|
#
|
|
|
|
-all: trans.tex
|
|
+all: trans.tex manual.pdf
|
|
|
|
# translation into latex
|
|
|
|
@@ -12,3 +12,16 @@ clean::
|
|
rm -f trans.tex
|
|
|
|
cleandir::
|
|
+
|
|
+manual.ps: manual.dvi
|
|
+ dvips -o $@ $^
|
|
+
|
|
+manual.dvi: manual.tex trans.tex
|
|
+ latex manual.tex
|
|
+ latex manual.tex
|
|
+ latex manual.tex
|
|
+
|
|
+manual.pdf: manual.tex trans.tex
|
|
+ pdflatex manual.tex
|
|
+ pdflatex manual.tex
|
|
+ pdflatex manual.tex
|
|
--- fig2dev/Imakefile
|
|
+++ fig2dev/Imakefile 2007-07-24 15:04:29.000000000 +0000
|
|
@@ -34,7 +34,7 @@ XCOMM ******
|
|
XCOMM You should point XFIGLIBDIR to the same directory you did when you compiled
|
|
XCOMM and installed xfig.
|
|
|
|
-XFIGLIBDIR = /usr/local/lib/X11/xfig
|
|
+XFIGLIBDIR = $(LIBDIR)/xfig
|
|
|
|
XCOMM ******
|
|
XCOMM If your system doesn't have the strerror() function (has sys_errlist) then
|
|
@@ -53,7 +53,7 @@ XCOMM Uncomment the following line if yo
|
|
XCOMM inline functions. With the "INLINE" keyword, you should notice that
|
|
XCOMM the display will be a bit faster in complex figures
|
|
|
|
-XCOMM USEINLINE = -DUSE_INLINE
|
|
+USEINLINE = -DUSE_INLINE
|
|
|
|
XCOMM ****************
|
|
XCOMM Change RGB if necessary, to point to your rgb.txt color database
|
|
@@ -97,11 +97,11 @@ XPMINC = -I/usr/include/X11
|
|
|
|
XCOMM ****************
|
|
XCOMM Uncomment the following to set default paper size to A4
|
|
-XCOMM DDA4 = -DA4
|
|
+DDA4 = -DA4
|
|
|
|
XCOMM ****************
|
|
XCOMM Uncomment the following to set IBM Graphics Enhancement Cartridge
|
|
-XCOMM DDIBMGEC = -DIBMGEC
|
|
+DDIBMGEC = -DIBMGEC
|
|
|
|
XCOMM ****************
|
|
XCOMM Comment out the DDNFSS = ... line if you don't want NFSS2 font selection
|
|
@@ -117,6 +117,7 @@ XCOMM probably want to include neither.
|
|
|
|
DDNFSS = -DNFSS
|
|
DDLATEX2E_GRAPHICS = -DLATEX2E_GRAPHICS
|
|
+XCOMM Use modern garphics style, not older epsfig style
|
|
XCOMM DDEPSFIG = -DEPSFIG
|
|
|
|
XCOMM ****************
|
|
@@ -141,7 +142,7 @@ XCOMM Comment out the next line if you h
|
|
|
|
#ifdef I18N
|
|
I18N_DEFS = -DI18N
|
|
-FIG2DEV_LIBDIR = /usr/local/lib/fig2dev
|
|
+FIG2DEV_LIBDIR = $(XFIGLIBDIR)/fig2dev
|
|
I18N_DEV_DEFS = $(I18N_DEFS) -DFIG2DEV_LIBDIR=$(FIG2DEV_LIBDIR) -DFIG2DEV_LIBDIR_STR=\\\"$(FIG2DEV_LIBDIR)\\\"
|
|
|
|
#endif /* I18N */
|
|
@@ -150,7 +151,7 @@ XCOMM **********************************
|
|
XCOMM *** You shouldn't have to change anything below this point ***
|
|
XCOMM **************************************************************
|
|
|
|
-DIR_DEFS= -DBITMAPDIR=\\\"$(DESTDIR)$(XFIGLIBDIR)/bitmaps\\\"
|
|
+DIR_DEFS= -DBITMAPDIR=\\\"$(XFIGLIBDIR)/bitmaps\\\"
|
|
|
|
#ifdef USEPNG
|
|
DUSEPNG = -DUSE_PNG
|
|
@@ -229,7 +230,7 @@ install::
|
|
else (set -x; $(MKDIRHIER) $(DESTDIR)$(XFIGLIBDIR)/bitmaps ); fi ; \
|
|
echo Copying bitmap files for tk to $(DESTDIR)$(XFIGLIBDIR)/bitmaps ; \
|
|
for f in * ; do \
|
|
- $(INSTALL) -c $$f $(DESTDIR)$(XFIGLIBDIR)/bitmaps ; \
|
|
+ $(INSTALL) -m644 $$f $(DESTDIR)$(XFIGLIBDIR)/bitmaps ; \
|
|
done) ;
|
|
|
|
install.all::
|
|
--- fig2dev/dev/genps.c
|
|
+++ fig2dev/dev/genps.c 2007-07-24 15:15:36.000000000 +0000
|
|
@@ -37,6 +37,8 @@
|
|
*/
|
|
|
|
#include <sys/stat.h>
|
|
+#include <locale.h>
|
|
+#include <langinfo.h>
|
|
#include "fig2dev.h"
|
|
#include "object.h"
|
|
#include "bound.h"
|
|
@@ -786,25 +788,46 @@ F_compound *objects;
|
|
fprintf(tfp, "%s\n", SPLINE_PS);
|
|
#ifdef I18N
|
|
if (support_i18n && iso_text_exist(objects)) {
|
|
- char *libdir, *locale;
|
|
+ char *libdir, *locale, *codeset;
|
|
char localefile[512], str[512];
|
|
+ size_t llen;
|
|
FILE *fp;
|
|
libdir = getenv("FIG2DEV_LIBDIR");
|
|
#ifdef FIG2DEV_LIBDIR_STR
|
|
if (libdir == NULL)
|
|
libdir = FIG2DEV_LIBDIR_STR;
|
|
#endif
|
|
- locale = getenv("LANG");
|
|
+ locale = setlocale(LC_CTYPE, NULL);
|
|
+ llen = strcspn(locale, ".@");
|
|
+ codeset = nl_langinfo(CODESET);
|
|
if (locale == NULL) {
|
|
fprintf(stderr, "fig2dev: LANG not defined; assuming C locale\n");
|
|
locale = "C";
|
|
}
|
|
- sprintf(localefile, "%s/%s.ps", libdir, locale);
|
|
+ snprintf(localefile, sizeof(localefile)-1, "%s/%s.ps", libdir, locale);
|
|
/* get filename like ``/usr/local/lib/fig2dev/japanese.ps'' */
|
|
fp = fopen(localefile, "rb");
|
|
- if (fp == NULL) {
|
|
+ if (fp == NULL)
|
|
fprintf(stderr, "fig2dev: can't open file: %s\n", localefile);
|
|
- } else {
|
|
+
|
|
+ if (fp == NULL && strlen(locale) != llen) {
|
|
+ locale[llen] = '\0';
|
|
+ /* get filename like ``/usr/local/lib/fig2dev/de_DE.ps'' */
|
|
+ snprintf(localefile, sizeof(localefile)-1, "%s/%s.ps", libdir, locale);
|
|
+ fp = fopen(localefile, "rb");
|
|
+ if (fp == NULL)
|
|
+ fprintf(stderr, "fig2dev: B can't open file: %s\n", localefile);
|
|
+ }
|
|
+
|
|
+ if (fp == NULL && codeset) {
|
|
+ /* get filename like ``/usr/local/lib/fig2dev/ISO-8859-9.ps'' */
|
|
+ snprintf(localefile, sizeof(localefile)-1, "%s/%s.ps", libdir, codeset);
|
|
+ fp = fopen(localefile, "rb");
|
|
+ if (fp == NULL)
|
|
+ fprintf(stderr, "fig2dev: C can't open file: %s\n", localefile);
|
|
+ }
|
|
+
|
|
+ if (fp) {
|
|
while (fgets(str, sizeof(str), fp)) {
|
|
if (strstr(str, "CompositeRoman")) enable_composite_font = True;
|
|
fputs(str, tfp);
|
|
--- fig2dev/dev/genpstex.c
|
|
+++ fig2dev/dev/genpstex.c 2013-02-08 12:45:41.649945157 +0000
|
|
@@ -37,6 +37,7 @@
|
|
* Jose Alberto.
|
|
*/
|
|
|
|
+#include <sys/stat.h>
|
|
#include "fig2dev.h"
|
|
#include "genps.h"
|
|
#include "genpdf.h"
|
|
@@ -64,10 +65,13 @@ extern void
|
|
genps_spline (),
|
|
genlatex_option (),
|
|
genlatex_text (),
|
|
- genps_text ();
|
|
+ genps_text (),
|
|
+ genpdf_option(),
|
|
+ genpdf_start();
|
|
extern int
|
|
genlatex_end (),
|
|
- genps_end ();
|
|
+ genps_end (),
|
|
+ genpdf_end();
|
|
|
|
static char pstex_file[1000] = "";
|
|
static int iObjectsRead = 0;
|
|
--- fig2dev/dev/gensvg.c
|
|
+++ fig2dev/dev/gensvg.c 2009-12-14 13:29:42.000000000 +0000
|
|
@@ -816,9 +816,11 @@ gensvg_text (t)
|
|
x, y, degrees (t->angle));
|
|
x = y = 0;
|
|
}
|
|
- fprintf (tfp, "<text xml:space=\"preserve\" x=\"%d\" y=\"%d\" fill=\"#%6.6x\" font-family=\"%s\" "\
|
|
- "font-style=\"%s\" font-weight=\"%s\" font-size=\"%d\" text-anchor=\"%s\">",
|
|
- x, y, rgbColorVal (t->color), family[t->font / 4],
|
|
+ fprintf (tfp,
|
|
+ "<text xml:space=\"preserve\" x=\"%d\" y=\"%d\" fill=\"#%6.6x\" font-family=\"%s\" ",
|
|
+ x, y, rgbColorVal (t->color), family[t->font / 4]);
|
|
+ fprintf (tfp,
|
|
+ "font-style=\"%s\" font-weight=\"%s\" font-size=\"%d\" text-anchor=\"%s\">",
|
|
( (t->font % 2 == 0 || t->font >31) ? "normal" : "italic"),
|
|
( (t->font % 4 < 2 || t->font >31) ? "normal" : "bold"), (int) (ceil (t->size * 12 * mag)),
|
|
anchor[t->type]);
|
|
--- fig2dev/fig2dev.c
|
|
+++ fig2dev/fig2dev.c 2007-07-24 15:08:45.000000000 +0000
|
|
@@ -24,6 +24,7 @@
|
|
#include <sys/types.h>
|
|
#endif
|
|
#include <sys/file.h>
|
|
+#include <locale.h>
|
|
#include "fig2dev.h"
|
|
#include "alloc.h"
|
|
#include "object.h"
|
|
@@ -31,9 +32,14 @@
|
|
#include "bound.h"
|
|
#include "read.h"
|
|
|
|
+#ifndef __GLIBC__
|
|
extern int fig_getopt();
|
|
extern char *optarg;
|
|
extern int optind;
|
|
+#else
|
|
+# include <unistd.h>
|
|
+# define fig_getopt getopt
|
|
+#endif
|
|
char lang[40];
|
|
int parse_gridspec();
|
|
static void grid_usage();
|
|
@@ -380,6 +386,7 @@ char *argv[];
|
|
F_compound objects;
|
|
int status;
|
|
|
|
+ setlocale(LC_CTYPE, "");
|
|
#ifdef HAVE_SETMODE
|
|
setmode(1,O_BINARY); /* stdout is binary */
|
|
#endif
|
|
--- fig2dev/fig2dev.h
|
|
+++ fig2dev/fig2dev.h 2007-07-24 15:09:55.000000000 +0000
|
|
@@ -23,6 +23,7 @@
|
|
#include <sys/file.h>
|
|
#include <signal.h>
|
|
#include <string.h>
|
|
+#include <stdarg.h>
|
|
#include <pwd.h>
|
|
#include <errno.h>
|
|
#include <time.h>
|
|
@@ -57,7 +58,7 @@ typedef char Boolean;
|
|
#ifndef X_NOT_STDC_ENV
|
|
# include <string.h>
|
|
#else
|
|
-# ifdef SYSV
|
|
+# if defined(SYSV) || defined(__GLIBC__)
|
|
# include <string.h>
|
|
# else
|
|
# include <strings.h>
|
|
--- fig2dev/fig2ps2tex.script
|
|
+++ fig2dev/fig2ps2tex.script 2006-07-31 16:26:56.000000000 +0000
|
|
@@ -3,6 +3,7 @@
|
|
# Fig2ps2tex - generate a TeX file for including a PostScript file
|
|
# involves calculating the bounding box from fig2ps output
|
|
#
|
|
+set echo_style=bsd
|
|
set bbox = `grep "^%%BoundingBox:" $1`
|
|
|
|
set xsp = `echo "3k $bbox[4] $bbox[2] - 72 / p" | dc`
|
|
--- fig2dev/getopt.c
|
|
+++ fig2dev/getopt.c 2006-07-31 16:26:56.000000000 +0000
|
|
@@ -35,6 +35,7 @@ static char sccsfid[] = "@(#) getopt.c 5
|
|
#define EMSG ""
|
|
#define ENDARGS "--"
|
|
|
|
+#ifndef __GLIBC__
|
|
/* this is included because index is not on some UNIX systems */
|
|
static char *
|
|
index (s, c)
|
|
@@ -46,7 +47,9 @@ index (s, c)
|
|
else s++;
|
|
return (NULL);
|
|
}
|
|
+#endif
|
|
|
|
+#ifndef __GLIBC__
|
|
/*
|
|
* get option letter from argument vector
|
|
*/
|
|
@@ -95,4 +98,10 @@ fig_getopt(nargc,nargv,ostr)
|
|
}
|
|
return(fig_optopt); /* dump back option letter */
|
|
}
|
|
-
|
|
+#else
|
|
+#include <unistd.h>
|
|
+fig_getopt(int nargc, char * const nargv[], const char *ostr)
|
|
+{
|
|
+ return getopt(nargc, nargv, ostr);
|
|
+}
|
|
+#endif
|
|
--- transfig/Imakefile
|
|
+++ transfig/Imakefile 2006-07-31 16:26:56.000000000 +0000
|
|
@@ -32,7 +32,7 @@ XCOMM Uncomment the USELATEX2E flag to u
|
|
XCOMM \\usepackage{} command for LaTeX2e.
|
|
XCOMM The default is to use \\documentstyle{} for LaTeX209.
|
|
|
|
-XCOMM USELATEX2E = -DLATEX2E
|
|
+USELATEX2E = -DLATEX2E
|
|
|
|
XCOMM ******* DON'T CHANGE ANYTHING BELOW THIS POINT *******
|
|
|
|
--- transfig/sys.c
|
|
+++ transfig/sys.c 2012-09-28 14:24:03.339507328 +0000
|
|
@@ -17,6 +17,7 @@
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
+#include <unistd.h>
|
|
#include "transfig.h"
|
|
|
|
#define MAXSYS 10000
|
|
--- transfig/transfig.c
|
|
+++ transfig/transfig.c 2012-09-28 14:24:24.443392989 +0000
|
|
@@ -26,6 +26,8 @@
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
+#include <string.h>
|
|
+#include <unistd.h>
|
|
#include "patchlevel.h"
|
|
#include "transfig.h"
|
|
|