Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2001 09:05:59 -0800 (PST)
From:      papowell@astart.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/24388: New Port: fig2ps
Message-ID:  <200101161705.f0GH5xO11786@h114.private>

next in thread | raw e-mail | index | archive | help

>Number:         24388
>Category:       ports
>Synopsis:       New Port: fig2ps
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 16 09:10:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Patrick Powell <papowell@astart.com>
>Release:        FreeBSD 4.2-RELEASE i386
>Organization:
Astart Technologies
>Environment:

FreeBSD 4.2

>Description:

Legacy/Antique/Vintage Pic to Fig Translator.  No redeeming social value.
But if you have antique/vintage/legacy figures in PIC and want to put them
out as PNG graphics or EPS files you can use:
  pic2fig f1.pic; fig2dev -L png f1.fig 
  pic2fig f1.pic; fig2dev -L eps f1.fig 

Also,  you can use eps2png instead:
  pic2fig f1.pic; fig2dev -L eps f1.fig 
  eps2png f1.eps f1.png

<aside>
Nik Clayton <nik@freebsd.org> of the FreeBSD Docmentation Project
is nauseated at this method,  but desperate people will use desperate
means.  In fact,  I am not too enthusiasitc myself.
</aside>

>How-To-Repeat:

Write lots and lots of antique/legacy/vintage documentation and try
to use the FreeBSD DocBook support.

>Fix:


# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	pic2fig
#	pic2fig/Makefile
#	pic2fig/pkg-comment
#	pic2fig/pkg-descr
#	pic2fig/pkg-plist
#	pic2fig/distinfo
#	pic2fig/patch-aa
#	pic2fig/patch-ab
#	pic2fig/patch-ac
#
echo c - pic2fig
mkdir -p pic2fig > /dev/null 2>&1
echo x - pic2fig/Makefile
sed 's/^X//' >pic2fig/Makefile << 'END-of-pic2fig/Makefile'
X# New ports collection makefile for:    pic2fig
X# Date created:         14 Jan 2001
X# Whom:                 Patrick Powell <papowell@astart.com>
X#
X#
X
XPORTNAME=	pic2fig
XPORTVERSION=	1.4
XCATEGORIES=	print
XMASTER_SITES=	ftp://ftp.x.org/contrib/utilities/
XEXTRACT_SUFX=       .tar.Z
XWRKSRC=${WRKDIR}/${PORTNAME}
XPATCHDIR=${MASTERDIR}
X
XMAINTAINER= Patrick Powell <papowell@astart.com>
X
XMAN1=		pic2fig.1
X
Xdo-install:
X	${INSTALL_PROGRAM} -m 755 ${WRKSRC}/pic2fig ${PREFIX}/bin
X	${INSTALL_MAN} ${WRKSRC}/pic2fig.1 ${PREFIX}/man/man1
X
X.include <bsd.port.mk>
END-of-pic2fig/Makefile
echo x - pic2fig/pkg-comment
sed 's/^X//' >pic2fig/pkg-comment << 'END-of-pic2fig/pkg-comment'
XPic format to fig format converter
END-of-pic2fig/pkg-comment
echo x - pic2fig/pkg-descr
sed 's/^X//' >pic2fig/pkg-descr << 'END-of-pic2fig/pkg-descr'
XPic2fig is a pic(l) preprocessor for drawing simple figures in Fig code.
XThe basic objects are box, line, arrow, circle, ellipse, arc and text.
X
XWhen  pic2fig  is  executed, it produces an output file in the
Xcurrent directory.  The name is constructed  from  the input  file's
Xname.  If the input filename ends with .pic, then that extension
Xwill be replaced by .fig.   Otherwise, .fig  is appended to the input
Xfilename.  If file does not exist, then pic2fig tries appending .pic
Xto the name.
X
XUpdated to produce FIG 3.2 format by Patrick Powell <papowell@astart.com>
X
XWeb Site: ftp://ftp.x.org/contrib/utilities/
X
XNote:  this version does not support the groff/pic 'thickness' attribute.
END-of-pic2fig/pkg-descr
echo x - pic2fig/pkg-plist
sed 's/^X//' >pic2fig/pkg-plist << 'END-of-pic2fig/pkg-plist'
Xbin/pic2fig
END-of-pic2fig/pkg-plist
echo x - pic2fig/distinfo
sed 's/^X//' >pic2fig/distinfo << 'END-of-pic2fig/distinfo'
XMD5 (pic2fig-1.4.tar.Z) = 98845b0fc9d9ad7e9484f22ef3057996
END-of-pic2fig/distinfo
echo x - pic2fig/patch-aa
sed 's/^X//' >pic2fig/patch-aa << 'END-of-pic2fig/patch-aa'
X--- Makefile.orig	Mon Apr 29 10:11:02 1991
X+++ Makefile	Tue Jan 16 08:26:36 2001
X@@ -1,7 +1,7 @@
X BINDIR	=	/usr/local/bin
X-CFLAGS	=	-O4 -s $(CROSS)
X+#CFLAGS	=	-O4 -s $(CROSS)
X #LDFLAGS=	-zs
X-LDFLAGS=	-z $(CROSS)
X+#LDFLAGS=	-z $(CROSS)
X YFLAGS	=	-d
X 
X MOFILES = main.o boxgen.o print.o misc.o symtab.o blockgen.o circgen.o  \
X@@ -29,7 +29,7 @@
X 	-@echo ""
X 
X pic2fig: picy.o picl.o $(OFILES)
X-	cc $(LDFLAGS) -o $@ picy.o picl.o $(OFILES) -lm
X+	$(CC) $(LDFLAGS) -o $@ picy.o picl.o $(OFILES) -lm
X 
X # The following .o files depend of picy.c, since they really need picy.h
X picl.o:		picl.c pic.h picy.c
END-of-pic2fig/patch-aa
echo x - pic2fig/patch-ab
sed 's/^X//' >pic2fig/patch-ab << 'END-of-pic2fig/patch-ab'
X--- figd.c.orig	Sat Aug  6 19:52:43 1988
X+++ figd.c	Tue Jan 16 08:26:38 2001
X@@ -6,13 +6,16 @@
X  *
X  * Modified by Micah Beck to produce Fig code
X  * Modified by Micah Beck again to produce Fig 1.4 code
X+ * Modified by Patrick Powell to produce Fig 3.2 code
X  */
X 
X #include <stdio.h>
X #include <ctype.h>
X #include "object.h"
X 
X-#define DEF_PEN_SIZE	8	/* Default pen diameter */
X+/* #define DEF_PEN_SIZE	8	/ * Default pen diameter */
X+#define DEF_PEN_SIZE	1	/* Default pen diameter */
X+#define DEF_FONT_SIZE	12	/* Default pen diameter */
X #define	MAXPOINTS	300	/* Max number of points in a path */
X 
X #define bool int
X@@ -23,6 +26,8 @@
X #define	P_BLACK		15
X #define	TEXTURE		3
X #define ORTEXTURE	7
X+#define FONT_HT 12
X+#define FONT_WIDTH 8
X 
X extern	double	sqrt(), cos(), sin();
X 
X@@ -31,11 +36,15 @@
X #define RES			1000.0
X #define Pix_To_In(x)		(((float) x) / RES)
X 
X-#define FIGRES			80
X+/* #define FIGRES			80 */
X+#define FIGRES			1200
X #define FIGCANV_W		(8*FIGRES)
X #define FIGCANV_H		(10*FIGRES)
X+#define Points_To_Figpix(x)	((int)(FIGRES * (x)/72.0))
X #define Pix_To_Figpix(x)	((int)(FIGRES * Pix_To_In(x)))
X-#define Pen_to_Figpix(x)	((x*FIGRES + 500) / 1000)
X+/* #define Pen_to_Figpix(x)	((x*FIGRES + 500) / 1000) */
X+/* pen thickness in 1/80 of inch */
X+#define Pen_to_Figpix(x)	((Pix_To_In(x) + 79) / 80)
X 
X 
X extern	int dbg;		/* Non-zero when debugging info wanted */
X@@ -44,7 +53,8 @@
X static	float xslope,yslope,xbase,ybase;/* Convert Window to Viewport */
X static	int arraylen;		/* Number of points in current path */
X static	bool pathsent;		/* True if path has been defined */
X-static	int ipensize;		/* Desired current pen size */
X+static	int ipensize = DEF_PEN_SIZE;		/* Desired current pen size */
X+static	int ifontsize = DEF_FONT_SIZE;		/* Desired current font size */
X extern	FILE *TEXFILE;		/* Output file */
X 
X 
X@@ -62,7 +72,7 @@
X 	yslope = RES * (hiypage-loypage) / (hiy-loy);
X 	ybase  = RES * loypage - loy*yslope;
X 	if (dbg)
X-	    printf("Coefficients: %10.5f%10.5f%10.5f%10.5f\n",
X+	    printf("Coefficients: %10.5f  %10.5f  %10.5f  %10.5f\n",
X 		xslope,xbase,yslope,ybase);
X }
X 
X@@ -70,14 +80,18 @@
X /*
X  * Set the size of the virtual pen used in drawing
X  */
X+static sendpath();
X pensize(x)
X int	x;
X {
X 	if (x != ipensize) {
X 	    ipensize = Pen_to_Figpix(x);
X+        ifontsize = x;
X+		if( ipensize == 0 ) ipensize = 1;
X 	    if (!pathsent) sendpath();
X 	    clearpath();
X 	}
X+	if( dbg) printf("pensize %d -> %d\n", x, ipensize );
X }
X 
X 
X@@ -149,24 +163,84 @@
X float	x, y;
X int	position;	/* Indicates what part of text is at (x,y) */
X {
X-    int	    ix, iy, offset;
X-    char    *cp;
X+    int	    ix, iy, offset, c;
X+    unsigned char    *cp;
X     map(x, y, &ix, &iy, 1);
X 
X-    for (cp = text; *cp && isspace(*text); cp++);
X+    for (cp = (unsigned char *)text; isspace(*cp); cp++);
X     if (!*cp) return;
X 
X #ifdef TEXT_LEFT_ONLY
X-    if (position != T_LEFT_JUSTIFIED) offset = strlen(cp)*8;
X+    if (position != T_LEFT_JUSTIFIED) offset = strlen(cp)*Points_To_Figpix(ifontsize);
X     if (position == T_CENTER_JUSTIFIED) offset = offset/2;
X     position = T_LEFT_JUSTIFIED;
X #else
X     offset = 0;
X #endif TEXT_LEFT_ONLY
X 
X+/* FORMAT 1.4 CODE
X     fprintf(TEXFILE, "%d %d %d %d %d %d %6.3f %d %d %d %d %d %s%c\n",
X-	O_TEXT, position, -1, -1, -1, -1, 0.0, -1, 16, strlen(cp)*8,
X+                   4   justification (0,1,2)
X+                            font (unused)
X+                               fontsize (unused)
X+                                  pen (unused)
X+                                     color
X+                                        depth
X+                                          angle (not used)
X+                                              height (pixels)
X+                                                 length (pixels)
X+                                                
X+	4, position, -1, -1, -1, -1, 0.0, -1, 16, strlen(cp)*Points_To_Figpix(ifontsize),
X 	Pix_To_Figpix(ix) - offset, Pix_To_Figpix(iy), cp, '\01');
X+Example:
X+4 1 -1 -1 -1 -1  0.000 -1 16 24 229 603 FEP^A
X+
X+FORMAT 3.2 CODE
X+    (3.7) TEXT
X+    type    name            (brief description)
X+    ----    ----            -------------------
X+    int object          (always 4)
X+    int sub_type        (0: Left justified
X+                         1: Center justified
X+                         2: Right justified)
X+    int color           (enumeration type)
X+    int depth           (enumeration type)
X+    int pen_style       (enumeration , not used)
X+    int font            (enumeration type)
X+    float   font_size       (font size in points)
X+    float   angle           (radians, the angle of the text)
X+    int font_flags      (bit vector)
X+    float   height          (Fig units)
X+    float   length          (Fig units)
X+    int x, y            (Fig units, coordinate of the origin
X+                     of the string.  If sub_type = 0, it is
X+                     the lower left corner of the string.
X+                     If sub_type = 1, it is the lower
X+                     center.  Otherwise it is the lower
X+                     right corner of the string.)
X+    char    string[]        (ASCII characters; starts after a blank
X+                     character following the last number and
X+                     ends before the sequence '\001'.  This
X+                     sequence is not part of the string.
X+
X+
X+Example:
X+4 1 -1 0 -1 -1 12 0.0000 4 135 330 3450 9060 FEP\001 
X+*/
X+    if(dbg) printf("string (%d,%d) '%s'\n", Pix_To_Figpix(ix-offset), Pix_To_Figpix(iy), cp );
X+		
X+    fprintf(TEXFILE, "%d %d %d %d %d %d %d %6.3f %d %d %d %d %d ",
X+	O_TEXT, position,       -1, 0,-1,-1,ifontsize,0.0,   4,Pix_To_Figpix(FONT_HT),Pix_To_Figpix(strlen(cp)*FONT_WIDTH),
X+		Pix_To_Figpix(ix-offset), Pix_To_Figpix(iy));
X+	while( (c = ((unsigned char *)(cp))[0]) ){
X+		if( c == '\\' ){
X+			fprintf(TEXFILE, "\\\\");
X+		} else if( isprint(c) || isspace(c) ){
X+			fprintf(TEXFILE, "%c", c);
X+		}
X+		++cp;
X+	}
X+	fprintf(TEXFILE, "\\001\n");
X }
X 
X 
X@@ -208,16 +282,54 @@
X {
X 	register int i;
X 
X-	if (dbg) printf("Sending path ...%d\n", arraylen);
X+	if (dbg) printf("Sendpath [%d], ipensize %d\n", arraylen, ipensize);
X 	if (arraylen > 1) {
X 
X+	/*
X 	    fprintf(TEXFILE, "%d %d %d %d %d %d %d %d %d %d %d\n",
X 		O_POLYLINE, T_POLYLINE, SOLID_LINE,
X 		ipensize, -1, -1, -1, -1, -1, 0, 0);
X-	    for (i=1; i<=arraylen; i++)
X-		fprintf(TEXFILE, "%d %d ",
X+
X+Example:
X+        2 1 0 1 -1 -1 -1 -1 -1 0 0
X+        19 149  19 9  179 9  179 149  19 149  9999 9999
X+
X+New format:
X+       2 1 0 1 -1 -1 0 -1 -1 -1.000 0 0 -1 0 0 5
X+       code     pen_color
X+         type      fill_color
X+           line style 
X+                     depth
X+                       pen_style
X+                             style_value
X+                                   join_style
X+                                      cap_style
X+                                          radius
X+                                             forward_arrow
X+                                                count
X+             thickness (1/80 inch)
X+           -1 = Default
X+            0 = Solid
X+            1 = Dashed
X+            2 = Dotted
X+            3 = Dash-dotted
X+            4 = Dash-double-dotted
X+            5 = Dash-triple-dotted
X+
X+       300 2250 300 150 2700 150 2700 2250 300 2250
X+
X+
X+	*/
X+	    fprintf(TEXFILE, "%d %d %d %d -1 -1 0 -1 -1 -1.000 0 0 -1 0 0 %d\n  ",
X+		2, T_POLYLINE, SOLID_LINE, ipensize, arraylen );
X+	    for (i=1; i<=arraylen; i++){
X+			if (dbg) printf(" (%d,%d)", Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
X+			fprintf(TEXFILE, "%d %d ",
X 			Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
X-	    fprintf(TEXFILE, "9999 9999\n");
X+		}
X+		if (dbg) printf("\n", Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
X+	    /* fprintf(TEXFILE, "9999 9999\n"); */
X+	    fprintf(TEXFILE, "\n");
X 	}
X 
X 	pathsent = TRUE;
X@@ -234,17 +346,22 @@
X {
X 	register int i;
X 
X-	if (dbg) printf("Sending path ...%d\n", arraylen);
X+	if (dbg) printf("Send_dashed_path ...%d\n", arraylen);
X 	if (arraylen < 2) return;
X 	else {
X+/*
X 	    fprintf(TEXFILE, "%d %d %d %d %d %d %d %d %d %d %d\n",
X 		O_POLYLINE, T_POLYLINE,
X 		(dotted ? DOTTED_LINE : DASH_LINE), ipensize,
X 		-1, -1, -1, -1, -1, 0, 0);
X-	    for (i=1; i<=arraylen; i++)
X+ */
X+	    fprintf(TEXFILE, "%d %d %d %d -1 -1 0 -1 -1 -1.000 0 0 -1 0 0 %d\n  ",
X+		2, T_POLYLINE, (dotted? DOTTED_LINE: DASH_LINE), ipensize, arraylen );
X+	    for (i=1; i<=arraylen; i++){
X 		fprintf(TEXFILE, "%d %d ",
X 			Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
X-	    fprintf(TEXFILE, "9999 9999\n");
X+		}
X+	    /* fprintf(TEXFILE, "9999 9999\n"); */
X 	}
X 
X 	pathsent = TRUE;
X@@ -294,7 +411,7 @@
X fig_arc(xcenter, ycenter, xradius, yradius, start, stop)
X float	xcenter, ycenter, xradius, yradius, start, stop;
X {
X-    int X0, Y0, xrad, yrad, xend, yend;
X+    int X0, Y0, xrad, yrad, xend, yend, xstart, ystart;
X     extern double cos(), sin();
X 
X     map(xcenter, ycenter, &X0, &Y0, FALSE);
X@@ -304,18 +421,85 @@
X     if (is_onarc(PI/2, start, stop)) ckbounds(X0, Y0+yrad);
X     if (is_onarc(PI, start, stop)) ckbounds(X0-xrad, Y0);
X     if (is_onarc(1.5*PI, start, stop)) ckbounds(X0, Y0-yrad);
X-    xend = X0 + xrad * cos(start) + 0.5;
X-    yend = Y0 + yrad * sin(start) + 0.5;
X-    ckbounds(xend, yend);
X+    xstart = X0 + xrad * cos(start) + 0.5;
X+    ystart = Y0 + yrad * sin(start) + 0.5;
X+    ckbounds(xstart, ystart);
X     xend = X0 + xrad * cos(stop);
X     yend = Y0 + yrad * sin(stop);
X     ckbounds(xend, yend);
X+	if(dbg) printf("Ellipse: X0 %d, Y0 %d, xrad %d, yrad %d, xstart %d, ystart %d, xend %d, yend %d\n",
X+		Pix_To_Figpix(X0), Pix_To_Figpix(Y0),
X+		Pix_To_Figpix(xrad), Pix_To_Figpix(yrad),
X+		Pix_To_Figpix(xstart), Pix_To_Figpix(ystart),
X+		Pix_To_Figpix(xend), Pix_To_Figpix(yend));
X+
X+/*
X+    int object_code     (always 1)
X+    int sub_type        (1 : ellipse defined by radiuses
X+                     2 : ellipse defined by diameters
X+                     3 : circle defined by radius
X+                     4 : circle defined by diameter)
X+    int line_style      (See the end of this section)
X+    int thickness       (pixels, not used)
X+    int color           (not used)
X+    int depth           (not used)
X+    int pen         (not used)
X+    int area_fill       (not used)
X+    float   style_val       (pixels, not used)
X+    int direction       (always 1)
X+    float   angle           (radian, the angle of the x-axis)
X+    int center_x, center_y  (pixels)
X+    int radius_x, radius_y  (pixels)
X+    int start_x, start_y    (pixels; the 1st point entered)
X+    int end_x, end_y        (pixels; the last point entered)
X+
X+Example:
X+  1 1 0 1 -1, -1 -1 -1 -1 1 0  0.000  0.000  0.000  0.000  0.000  0.000
X 
X     fprintf(TEXFILE, "%d %d %d %d %d, %d %d %d %d %d %d %6.3f %6.3f %6.3f %6.3f %6.3f %6.3f\n",
X 		O_ELLIPSE, T_ELLIPSE_BY_RAD,
X 	        SOLID_LINE, ipensize, -1, -1, -1, -1, -1, 1, 0.0,
X 		Pix_To_Figpix(X0), Pix_To_Figpix(Y0),
X 		Pix_To_Figpix(xrad), Pix_To_Figpix(yrad), 0.0, 0.0, 0.0, 0.0);
X+
X+
X+    int object_code     (always 1)
X+    int sub_type        (1: ellipse defined by radii
X+                     2: ellipse defined by diameters
X+                     3: circle defined by radius
X+                     4: circle defined by diameter)
X+    int line_style      (enumeration type)
X+    int thickness       (1/80 inch)
X+   --
X+    int pen_color       (enumeration type, pen color)
X+    int fill_color      (enumeration type, fill color)
X+    int depth           (enumeration type)
X+    int pen_style       (pen style, not used)
X+    int area_fill       (enumeration type, -1 = no fill)
X+    float   style_val       (1/80 inch)
X+    int direction       (always 1)
X+    float   angle           (radians, the angle of the x-axis)
X+    int center_x, center_y  (Fig units)
X+    int radius_x, radius_y  (Fig units)
X+    int start_x, start_y    (Fig units; the 1st point entered)
X+    int end_x, end_y        (Fig units; the last point entered)
X+
X+Example:
X+   1 1 0 1 0 7 50 0 -1 0.000 1 0.0000 1125 975 675 375 1125 975 1800 1350
X+           pen      areafill
X+             fill      styleval
X+               depth
X+                  pen_style
X+*/
X+
X+
X+    fprintf(TEXFILE, "%d %d %d %d", O_ELLIPSE, T_ELLIPSE_BY_RAD, SOLID_LINE, ipensize );
X+	fprintf(TEXFILE, " 0 7 50 0 -1 0.0 1 0.0" );
X+	fprintf(TEXFILE, " %d %d %d %d %d %d %d %d\n",
X+		Pix_To_Figpix(X0), Pix_To_Figpix(Y0),
X+		Pix_To_Figpix(xrad), Pix_To_Figpix(yrad),
X+		Pix_To_Figpix(xstart), Pix_To_Figpix(ystart),
X+		Pix_To_Figpix(xend), Pix_To_Figpix(yend));
X }
X 
X 
X@@ -347,14 +531,56 @@
X  */
X fig_begin_drawing()
X {
X-  	fprintf(TEXFILE, "#FIG 1.4\n%d %d\n", FIGRES, 2);
X+
X+/*
X+(1) The very first line is a comment line containing the name and version:
X+    #FIG 3.2
X+(2) The first non-comment line consists of the following:
X+
X+    string  orientation     ("Landscape" or "Portrait")
X+    string  justification       ("Center" or "Flush Left")
X+    string  units           ("Metric" or "Inches")
X+    string  papersize       ("Letter", "Legal", "Ledger", "Tabloid",
X+                     "A", "B", "C", "D", "E",
X+                     "A4",   "A3", "A2", "A1", "A0" and "B5")
X+    float   magnification       (export and print magnification, %)
X+    string  multiple-page       ("Single" or "Multiple" pages)
X+    int transparent color   (color number for transparent color for GIF
X+                     export. -3=background, -2=None, -1=Default,
X+                     0-31 for standard colors or 32- for user colors)
X+    # optional comment      (An optional set of comments may be here,
X+                     which are associated with the whole figure)
X+    int resolution coord_system (Fig units/inch and coordinate system:
X+                       1: origin at lower left corner (NOT USED)
X+                       2: upper left)
X+Example:
X+   #FIG 3.2
X+   Landscape
X+   Center
X+   Inches
X+   Letter
X+   100.00
X+   Single
X+   -2
X+   1200 2
X+
X+*/
X+  	fprintf(TEXFILE, "#FIG 3.2\n");
X+  	fprintf(TEXFILE, "Landscape\n");
X+  	fprintf(TEXFILE, "Center\n");
X+  	fprintf(TEXFILE, "Inches\n");
X+  	fprintf(TEXFILE, "Letter\n");
X+  	fprintf(TEXFILE, "100.00\n");
X+  	fprintf(TEXFILE, "Single\n");
X+  	fprintf(TEXFILE, "-2\n");
X+  	fprintf(TEXFILE, "%d %d\n", FIGRES, 2 );
X 
X 	fig_window(0.0, 0.0, 10.0, 10.0, 0.0, 0.0, 3.0, 3.0);
X 	xmin = 30000;	xmax = -30000;
X 	ymin = 30000;	ymax = -30000;
X 	arraylen = 0;
X 	pathsent = FALSE;
X-	ipensize = Pen_to_Figpix(DEF_PEN_SIZE);
X+	pensize(DEF_PEN_SIZE);
X }
X 
X 
X@@ -392,15 +618,67 @@
X 	clearpath();
X     }
X 
X+/*
X     fprintf(TEXFILE, "%d %d %d %d %d %d %d %d %d %d %d\n",
X 	O_SPLINE, T_OPEN_NORMAL,
X 	SOLID_LINE, ipensize, -1, -1, -1, -1, -1, 0, 0);
X+    fprintf(TEXFILE, "9999 9999\n");
X+
X+New format:
X+    int object_code     (always 3)
X+    int sub_type        (0: open approximated spline
X+                         1: closed approximated spline
X+                         2: open   interpolated spline
X+                         3: closed interpolated spline
X+                         4: open   x-spline
X+                         5: closed x-spline)
X+    int line_style      (See the end of this section)
X+    int thickness       (1/80 inch)
X+    int pen_color       (enumeration type, pen color)
X+    int fill_color      (enumeration type, fill color)
X+    int depth           (enumeration type)
X+    int pen_style       (pen style, not used)
X+    int area_fill       (enumeration type, -1 = no fill)
X+    float   style_val       (1/80 inch)
X+    int cap_style       (enumeration type, only used for open splines)
X+    int forward_arrow       (0: off, 1: on)
X+    int backward_arrow      (0: off, 1: on)
X+    int npoints         (number of control points in spline)
X+
X+    Forward arrow line: same as ARC object
X+
X+    Backward arrow line: same as ARC object
X+
X+    Points line: same as POLYLINE object
X+
X+    Control points line :
X+
X+    There is one shape factor for each point. The value of this factor
X+    must be between -1 (which means that the spline is interpolated at
X+    this point) and 1 (which means that the spline is approximated at
X+    this point). The spline is always smooth in the neighbourhood of a
X+    control point, except when the value of the factor is 0 for which
X+    there is a first-order discontinuity (i.e. angular point).
X+
X+Example:
X+    3 2 0 1 0 7 50 0 -1 0.000 0 0 0 3
X+     975 1950 1875 1500 2550 1950
X+     0.000 -1.000 0.000
X+
X+*/
X+    fprintf(TEXFILE, "%d %d %d %d", 3, 2, SOLID_LINE, ipensize );
X+	fprintf(TEXFILE, " 0 7 50 0 -1 0.000 0 0 0 %d\n  ", N-1 );
X     for (i=1; i<N; i++) {
X-	ckbounds(xx[i], yy[i]);
X-	fprintf(TEXFILE, "%d %d ",
X-		Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
X-      }
X-    fprintf(TEXFILE, "9999 9999\n");	
X+		ckbounds(xx[i], yy[i]);
X+		fprintf(TEXFILE, " %d %d",
X+			Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
X+	}
X+    fprintf(TEXFILE, "\n  ");
X+    fprintf(TEXFILE, " 0.0");
X+    for (i=2; i<N-1; i++) {
X+		fprintf(TEXFILE, " -1.0");
X+	}
X+    fprintf(TEXFILE, " 0.0\n");
X }
X 
X 
END-of-pic2fig/patch-ab
echo x - pic2fig/patch-ac
sed 's/^X//' >pic2fig/patch-ac << 'END-of-pic2fig/patch-ac'
X--- main.c.orig	Mon Feb  8 06:21:12 1988
X+++ main.c	Tue Jan 16 08:26:39 2001
X@@ -1,10 +1,10 @@
X #include	<stdio.h>
X #include	<ctype.h>
X+#include	<strings.h>
X #include	"pic.h"
X #include	"picy.h"
X 
X static reset();
X-extern char *sprintf(), *strcpy();
X 
X struct	obj	*objlist[MAXOBJ];	/* store the elements here */
X int	nobj	= 0;
END-of-pic2fig/patch-ac
exit


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200101161705.f0GH5xO11786>