aboutsummaryrefslogtreecommitdiffstats
path: root/print
diff options
context:
space:
mode:
authordwcjr <dwcjr@FreeBSD.org>2002-04-04 12:41:10 +0800
committerdwcjr <dwcjr@FreeBSD.org>2002-04-04 12:41:10 +0800
commitadeb00f673442eebc57a12272293926d8210ca00 (patch)
tree5be073520eefb1c53236510c6c2356b8ba0ec4f3 /print
parentcae1e19337a42c6a34c43247ecb13dcbe73fb4ff (diff)
downloadfreebsd-ports-graphics-adeb00f673442eebc57a12272293926d8210ca00.tar.gz
freebsd-ports-graphics-adeb00f673442eebc57a12272293926d8210ca00.tar.zst
freebsd-ports-graphics-adeb00f673442eebc57a12272293926d8210ca00.zip
Add patches to fix building on -current correctly
Submitted by: maintainer
Diffstat (limited to 'print')
-rw-r--r--print/pic2fig/Makefile2
-rw-r--r--print/pic2fig/files/patch-aa587
-rw-r--r--print/pic2fig/files/patch-ab510
-rw-r--r--print/pic2fig/files/patch-ac511
-rw-r--r--print/pic2fig/files/patch-ad31
-rw-r--r--print/pic2fig/files/patch-ae7
-rw-r--r--print/pic2fig/files/patch-af54
-rw-r--r--print/pic2fig/files/patch-ag19
-rw-r--r--print/pic2fig/files/patch-ah69
9 files changed, 1265 insertions, 525 deletions
diff --git a/print/pic2fig/Makefile b/print/pic2fig/Makefile
index 9aeb7e5026d..095e839f892 100644
--- a/print/pic2fig/Makefile
+++ b/print/pic2fig/Makefile
@@ -6,7 +6,7 @@
PORTNAME= pic2fig
PORTVERSION= 1.4
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= print
MASTER_SITES= ${MASTER_SITE_XCONTRIB}
MASTER_SITE_SUBDIR= utilities
diff --git a/print/pic2fig/files/patch-aa b/print/pic2fig/files/patch-aa
index 0cb342a6242..183915b5750 100644
--- a/print/pic2fig/files/patch-aa
+++ b/print/pic2fig/files/patch-aa
@@ -1,21 +1,566 @@
---- Makefile.orig Mon Apr 29 10:11:02 1991
-+++ Makefile Tue Jan 16 08:26:36 2001
-@@ -1,7 +1,7 @@
- BINDIR = /usr/local/bin
--CFLAGS = -O4 -s $(CROSS)
-+#CFLAGS = -O4 -s $(CROSS)
- #LDFLAGS= -zs
--LDFLAGS= -z $(CROSS)
-+#LDFLAGS= -z $(CROSS)
- YFLAGS = -d
-
- MOFILES = main.o boxgen.o print.o misc.o symtab.o blockgen.o circgen.o \
-@@ -29,7 +29,7 @@
- -@echo ""
-
- pic2fig: picy.o picl.o $(OFILES)
-- cc $(LDFLAGS) -o $@ picy.o picl.o $(OFILES) -lm
-+ $(CC) $(LDFLAGS) -o $@ picy.o picl.o $(OFILES) -lm
-
- # The following .o files depend of picy.c, since they really need picy.h
- picl.o: picl.c pic.h picy.c
+--- FORMAT3.2.orig Wed Apr 3 10:27:14 2002
++++ FORMAT3.2 Wed Apr 3 10:27:14 2002
+@@ -0,0 +1,563 @@
++/*
++ * FIG : Facility for Interactive Generation of figures
++ * Copyright (c) 1985 by Supoj Sutanthavibul
++ * Parts Copyright (c) 1989-1999 by Brian V. Smith
++ * Parts Copyright (c) 1991 by Paul King
++ * Parts Copyright (c) 1995 by C. Blanc and C. Schlick
++ *
++ * The X Consortium, and any party obtaining a copy of these files from
++ * the X Consortium, directly or indirectly, is granted, free of charge, a
++ * full and unrestricted irrevocable, world-wide, paid up, royalty-free,
++ * nonexclusive right and license to deal in this software and
++ * documentation files (the "Software"), including without limitation the
++ * rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons who receive
++ * copies from any such party to do so, with the only requirement being
++ * that this copyright notice remain intact. This license includes without
++ * limitation a license to do the foregoing actions under any patents of
++ * the party supplying this software to the X Consortium.
++ */
++
++The new components in protocol 3.2 are the paper size, magnification,
++single/multiple page indicator and transparent color for GIF export in the
++header.
++
++The other modification between version 3.1 and version 3.2 of the
++protocol is the mathematical model used for splines. The new version
++uses X-splines which allows the user to mix interpolation and approximation
++points in a same curve. More precisely, it means that an X-spline curve
++is neither an interpolated spline nor an approximated one, it is BOTH
++(the behaviour of each point is controlled by one single parameter
++called "shape factor"). For additional information about X-splines, see:
++
++ "X-Splines: A Spline Model Designed for the End User"
++ by C. Blanc and C. Schlick, Proceedings of SIGGRAPH'95
++
++Caveat: Because spline models of previous versions (quadratic B-splines
++and Bezier with hidden points) are no longer supported, curves that are
++present in version 3.1 and older files are automatically converted to
++X-splines. This translation is only an approximation process. It means
++that the converted curves are not exactly the same as the original ones.
++Though the translation usually provides almost identical curves, some
++hand-fitting may be needed in some pathological cases.
++
++-------------------------------------------------------------------------------
++Description of the Fig Format Follows
++-------------------------------------------------------------------------------
++
++(1) The very first line is a comment line containing the name and version:
++ #FIG 3.2
++
++ The character # at the first column of a line indicates that the line
++ is a comment line which will be preserved when the Fig file is read in.
++ The user may edit them with the popup editor.
++
++ The comment line(s) must immediately precede the object to which they
++ are associated. In the case of the "whole figure comments" mentioned
++ below, they immediately precede the (resolution,coord_system) line.
++
++(2) The first non-comment line consists of the following:
++
++ string orientation ("Landscape" or "Portrait")
++ string justification ("Center" or "Flush Left")
++ string units ("Metric" or "Inches")
++ string papersize ("Letter", "Legal", "Ledger", "Tabloid",
++ "A", "B", "C", "D", "E",
++ "A4", "A3", "A2", "A1", "A0" and "B5")
++ float magnification (export and print magnification, %)
++ string multiple-page ("Single" or "Multiple" pages)
++ int transparent color (color number for transparent color for GIF
++ export. -3=background, -2=None, -1=Default,
++ 0-31 for standard colors or 32- for user colors)
++ # optional comment (An optional set of comments may be here,
++ which are associated with the whole figure)
++ int resolution coord_system (Fig units/inch and coordinate system:
++ 1: origin at lower left corner (NOT USED)
++ 2: upper left)
++
++ Fig_resolution is the resolution of the figure in the file.
++ Xfig will always write the file with a resolution of 1200ppi so it
++ will scale the figure upon reading it in if its resolution is different
++ from 1200ppi. Pixels are assumed to be square.
++
++ Xfig will read the orientation string and change the canvas to match
++ either the Landscape or Portrait mode of the figure file.
++
++ The units specification is self-explanatory.
++
++ The coordinate_system variable is ignored - the origin is ALWAYS the
++ upper-left corner.
++
++ ** Coordinates are given in "fig_resolution" units.
++ ** Line thicknesses are given in 1/80 inch (0.3175mm) or 1 screen pixel.
++ When exporting to EPS, PostScript or any bitmap format (e.g. GIF), the
++ line thickness is reduced to 1/160 inch (0.159mm) to "lighten" the look.
++ ** dash-lengths/dot-gaps are given in 80-ths of an inch.
++
++
++(3) The rest of the file contains various objects. An object can be one
++ of six classes (or types).
++
++ 0) Color pseudo-object.
++ 1) Arc.
++ 2) Ellipse which is a generalization of circle.
++ 3) Polyline which includes polygon and box.
++ 4) Spline which includes
++ closed/open approximated/interpolated/x-spline spline.
++ 5) Text.
++ 6) Compound object which is composed of one or more objects.
++
++ In the following elaboration on object formats, every value of fig
++ output are separated by blank characters or new line ('\n'). The
++ value of the unused parameters will be -1.
++
++ Some fields are described as "enumeration type" or "bit vector"; the
++ values which these fields can take are defined in the header file object.h.
++ The pen_style field is unused.
++ These values may be defined in some future version of Fig.
++
++ The two color fields (pen and fill; pen only, for texts) are
++ defined as follows:
++
++ -1 = Default
++ 0 = Black
++ 1 = Blue
++ 2 = Green
++ 3 = Cyan
++ 4 = Red
++ 5 = Magenta
++ 6 = Yellow
++ 7 = White
++ 8-11 = four shades of blue (dark to lighter)
++ 12-14 = three shades of green (dark to lighter)
++ 15-17 = three shades of cyan (dark to lighter)
++ 18-20 = three shades of red (dark to lighter)
++ 21-23 = three shades of magenta (dark to lighter)
++ 24-26 = three shades of brown (dark to lighter)
++ 27-30 = four shades of pink (dark to lighter)
++ 31 = Gold
++
++ values from 32 to 543 (512 total) are user colors and
++ are defined in color pseudo-objects (type 0)
++
++ Your X server may limit the number of colors to something less
++ than this, especially on a 8-bit PseudoColor visual, where
++ the number of usable colors will be 256 minus the number of colors
++ xfig preallocates for itself and the 32 standard colors (about 48).
++
++ For WHITE color, the area fill field is defined as follows:
++
++ -1 = not filled
++ 0 = black
++ ... values from 1 to 19 are shades of grey, from darker to lighter
++ 20 = white
++ 21-40 not used
++ 41-56 see patterns for colors, below
++
++ For BLACK or DEFAULT color, the area fill field is defined as follows:
++
++ -1 = not filled
++ 0 = white
++ ... values from 1 to 19 are shades of grey, from lighter to darker
++ 20 = black
++ 21-40 not used
++ 41-56 see patterns for colors, below
++
++ For all other colors, the area fill field is defined as follows:
++
++ -1 = not filled
++ 0 = black
++ ... values from 1 to 19 are "shades" of the color, from darker to lighter.
++ A shade is defined as the color mixed with black
++ 20 = full saturation of the color
++ ... values from 21 to 39 are "tints" of the color from the color to white.
++ A tint is defined as the color mixed with white
++ 40 = white
++ 41 = 30 degree left diagonal pattern
++ 42 = 30 degree right diagonal pattern
++ 43 = 30 degree crosshatch
++ 44 = 45 degree left diagonal pattern
++ 45 = 45 degree right diagonal pattern
++ 46 = 45 degree crosshatch
++ 47 = horizontal bricks
++ 48 = vertical bricks
++ 49 = horizontal lines
++ 50 = vertical lines
++ 51 = crosshatch
++ 52 = horizontal "shingles" skewed to the right
++ 53 = horizontal "shingles" skewed to the left
++ 54 = vertical "shingles" skewed one way
++ 55 = vertical "shingles"skewed the other way
++ 56 = fish scales
++ 57 = small fish scales
++ 58 = circles
++ 59 = hexagons
++ 60 = octagons
++ 61 = horizontal "tire treads"
++ 62 = vertical "tire treads"
++
++ The depth field is defined as follows:
++
++ 0 ... 999 where larger value means object is deeper than (under)
++ objects with smaller depth
++
++ The line_style field is defined as follows:
++
++ -1 = Default
++ 0 = Solid
++ 1 = Dashed
++ 2 = Dotted
++ 3 = Dash-dotted
++ 4 = Dash-double-dotted
++ 5 = Dash-triple-dotted
++
++ The style_val field is defined as the length, in 1/80 inches, of the on/off
++ dashes for dashed lines, and the distance between the dots, in 1/80 inches,
++ for dotted lines.
++
++ The join_style field is defined FOR LINES only as follows:
++
++ 0 = Miter (the default in xfig 2.1 and earlier)
++ 1 = Round
++ 2 = Bevel
++
++ The cap_style field is defined FOR LINES, OPEN SPLINES and ARCS only as follows:
++
++ 0 = Butt (the default in xfig 2.1 and earlier)
++ 1 = Round
++ 2 = Projecting
++
++ The arrow_type field is defined for LINES, ARCS and OPEN SPLINES
++ only as follows:
++
++ 0 = Stick-type (the default in xfig 2.1 and earlier)
++
++ \
++ \
++ _______________\
++ /
++ /
++ /
++
++ 1 = Closed triangle:
++
++ |\
++ | \
++ ________| \
++ | /
++ | /
++ |/
++
++ 2 = Closed with "indented" butt:
++
++ |\
++ \ \
++ \ \
++ __________\ \
++ / /
++ / /
++ / /
++ |/
++
++ 3 = Closed with "pointed" butt:
++
++ /\
++ / \
++ / \
++ ________/ \
++ \ /
++ \ /
++ \ /
++ \/
++
++ The arrow_style field is defined for LINES, ARCS and OPEN SPLINES
++ only as follows:
++
++ 0 = Hollow (actually filled with white)
++ 1 = Filled with pen_color
++
++(3.0) OBJECT DEFINITION:
++
++ (3.1) Color Pseudo-objects (user-defined colors)
++ This is used to define arbitrary colors beyond the 32 standard colors.
++ The color objects must be defined before any other Fig objects.
++
++ First line:
++ type name (brief description)
++ ---- ---- -------------------
++ int object_code (always 0)
++ int color_number (color number, from 32-543 (512 total))
++ hex string rgb values (hexadecimal string describing red,
++ green and blue values (e.g. #330099) )
++
++ (3.2) ARC
++
++ First line:
++ type name (brief description)
++ ---- ---- -------------------
++ int object_code (always 5)
++ int sub_type (1: open ended arc
++ 2: pie-wedge (closed) )
++ int line_style (enumeration type)
++ int line_thickness (1/80 inch)
++ int pen_color (enumeration type, pen color)
++ int fill_color (enumeration type, fill color)
++ int depth (enumeration type)
++ int pen_style (pen style, not used)
++ int area_fill (enumeration type, -1 = no fill)
++ float style_val (1/80 inch)
++ int cap_style (enumeration type)
++ int direction (0: clockwise, 1: counterclockwise)
++ int forward_arrow (0: no forward arrow, 1: on)
++ int backward_arrow (0: no forward arrow, 1: on)
++ float center_x, center_y (center of the arc)
++ int x1, y1 (Fig units, the 1st point the user entered)
++ int x2, y2 (Fig units, the 2nd point)
++ int x3, y3 (Fig units, the last point)
++
++ Forward arrow line (Optional; absent if forward_arrow is 0):
++ type name (brief description)
++ ---- ---- -------------------
++ int arrow_type (enumeration type)
++ int arrow_style (enumeration type)
++ float arrow_thickness (1/80 inch)
++ float arrow_width (Fig units)
++ float arrow_height (Fig units)
++
++ Backward arrow line (Optional; absent if backward_arrow is 0):
++ type name (brief description)
++ ---- ---- -------------------
++ int arrow_type (enumeration type)
++ int arrow_style (enumeration type)
++ float arrow_thickness (1/80 inch)
++ float arrow_width (Fig units)
++ float arrow_height (Fig units)
++
++ (3.3) COMPOUND
++
++ A line with object code 6 signifies the start of a compound.
++ There are four more numbers on this line which indicate the
++ upper left corner and the lower right corner of the bounding
++ box of this compound. A line with object code -6 signifies
++ the end of the compound. Compound may be nested.
++
++ First line:
++ type name (brief description)
++ ---- ---- -------------------
++ int object_code (always 6)
++ int upperleft_corner_x (Fig units)
++ int upperleft_corner_y (Fig units)
++ int lowerright_corner_x (Fig units)
++ int lowerright_corner_y (Fig units)
++
++ Subsequent lines:
++ objects
++ .
++ .
++
++ Last line:
++ -6
++
++ (3.4) ELLIPSE
++
++ First line:
++ type name (brief description)
++ ---- ---- -------------------
++ int object_code (always 1)
++ int sub_type (1: ellipse defined by radii
++ 2: ellipse defined by diameters
++ 3: circle defined by radius
++ 4: circle defined by diameter)
++ int line_style (enumeration type)
++ int thickness (1/80 inch)
++ int pen_color (enumeration type, pen color)
++ int fill_color (enumeration type, fill color)
++ int depth (enumeration type)
++ int pen_style (pen style, not used)
++ int area_fill (enumeration type, -1 = no fill)
++ float style_val (1/80 inch)
++ int direction (always 1)
++ float angle (radians, the angle of the x-axis)
++ int center_x, center_y (Fig units)
++ int radius_x, radius_y (Fig units)
++ int start_x, start_y (Fig units; the 1st point entered)
++ int end_x, end_y (Fig units; the last point entered)
++
++ (3.5) POLYLINE
++
++ First line:
++ type name (brief description)
++ ---- ---- -------------------
++ int object_code (always 2)
++ int sub_type (1: polyline
++ 2: box
++ 3: polygon
++ 4: arc-box)
++ 5: imported-picture bounding-box)
++ int line_style (enumeration type)
++ int thickness (1/80 inch)
++ int pen_color (enumeration type, pen color)
++ int fill_color (enumeration type, fill color)
++ int depth (enumeration type)
++ int pen_style (pen style, not used)
++ int area_fill (enumeration type, -1 = no fill)
++ float style_val (1/80 inch)
++ int join_style (enumeration type)
++ int cap_style (enumeration type, only used for POLYLINE)
++ int radius (1/80 inch, radius of arc-boxes)
++ int forward_arrow (0: off, 1: on)
++ int backward_arrow (0: off, 1: on)
++ int npoints (number of points in line)
++
++ Forward arrow line: same as ARC object
++
++ Backward arrow line: same as ARC object
++
++ Points line:
++ type name (brief description)
++ ---- ---- -------------------
++ int x1, y1 (Fig units)
++ int x2, y2 (Fig units)
++ .
++ .
++ int xnpoints ynpoints (this will be the same as the 1st
++ point for polygon and box)
++
++ PIC line:
++ type name (brief description)
++ ---- ---- -------------------
++ boolean flipped orientation = normal (0) or flipped (1)
++ char file[] name of picture file to import
++
++ (3.6) SPLINE
++
++ First line:
++ type name (brief description)
++ ---- ---- -------------------
++ int object_code (always 3)
++ int sub_type (0: open approximated spline
++ 1: closed approximated spline
++ 2: open interpolated spline
++ 3: closed interpolated spline
++ 4: open x-spline
++ 5: closed x-spline)
++ int line_style (See the end of this section)
++ int thickness (1/80 inch)
++ int pen_color (enumeration type, pen color)
++ int fill_color (enumeration type, fill color)
++ int depth (enumeration type)
++ int pen_style (pen style, not used)
++ int area_fill (enumeration type, -1 = no fill)
++ float style_val (1/80 inch)
++ int cap_style (enumeration type, only used for open splines)
++ int forward_arrow (0: off, 1: on)
++ int backward_arrow (0: off, 1: on)
++ int npoints (number of control points in spline)
++
++ Forward arrow line: same as ARC object
++
++ Backward arrow line: same as ARC object
++
++ Points line: same as POLYLINE object
++
++ Control points line :
++
++ There is one shape factor for each point. The value of this factor
++ must be between -1 (which means that the spline is interpolated at
++ this point) and 1 (which means that the spline is approximated at
++ this point). The spline is always smooth in the neighbourhood of a
++ control point, except when the value of the factor is 0 for which
++ there is a first-order discontinuity (i.e. angular point).
++
++ (3.7) TEXT
++ type name (brief description)
++ ---- ---- -------------------
++ int object (always 4)
++ int sub_type (0: Left justified
++ 1: Center justified
++ 2: Right justified)
++ int color (enumeration type)
++ int depth (enumeration type)
++ int pen_style (enumeration , not used)
++ int font (enumeration type)
++ float font_size (font size in points)
++ float angle (radians, the angle of the text)
++ int font_flags (bit vector)
++ float height (Fig units)
++ float length (Fig units)
++ int x, y (Fig units, coordinate of the origin
++ of the string. If sub_type = 0, it is
++ the lower left corner of the string.
++ If sub_type = 1, it is the lower
++ center. Otherwise it is the lower
++ right corner of the string.)
++ char string[] (ASCII characters; starts after a blank
++ character following the last number and
++ ends before the sequence '\001'. This
++ sequence is not part of the string.
++ Characters above octal 177 are
++ represented by \xxx where xxx is the
++ octal value. This permits fig files to
++ be edited with 7-bit editors and sent
++ by e-mail without data loss.
++ Note that the string may contain '\n'.)
++
++ The font_flags field is defined as follows:
++
++ Bit Description
++
++ 0 Rigid text (text doesn't scale when scaling compound objects)
++ 1 Special text (for LaTeX)
++ 2 PostScript font (otherwise LaTeX font is used)
++ 3 Hidden text
++
++ The font field is defined as follows:
++
++ For font_flags bit 2 = 0 (LaTeX fonts):
++
++ 0 Default font
++ 1 Roman
++ 2 Bold
++ 3 Italic
++ 4 Sans Serif
++ 5 Typewriter
++
++ For font_flags bit 2 = 1 (PostScript fonts):
++
++ (.ft value)
++ -1 Default font
++ 0 Times Roman
++ 1 Times Italic
++ 2 Times Bold
++ 3 Times Bold Italic
++ 4 AvantGarde Book
++ 5 AvantGarde Book Oblique
++ 6 AvantGarde Demi
++ 7 AvantGarde Demi Oblique
++ 8 Bookman Light
++ 9 Bookman Light Italic
++ 10 Bookman Demi
++ 11 Bookman Demi Italic
++ 12 Courier
++ 13 Courier Oblique
++ 14 Courier Bold
++ 15 Courier Bold Oblique
++ 16 Helvetica
++ 17 Helvetica Oblique
++ 18 Helvetica Bold
++ 19 Helvetica Bold Oblique
++ 20 Helvetica Narrow
++ 21 Helvetica Narrow Oblique
++ 22 Helvetica Narrow Bold
++ 23 Helvetica Narrow Bold Oblique
++ 24 New Century Schoolbook Roman
++ 25 New Century Schoolbook Italic
++ 26 New Century Schoolbook Bold
++ 27 New Century Schoolbook Bold Italic
++ 28 Palatino Roman
++ 29 Palatino Italic
++ 30 Palatino Bold
++ 31 Palatino Bold Italic
++ 32 Symbol
++ 33 Zapf Chancery Medium Italic
++ 34 Zapf Dingbats
diff --git a/print/pic2fig/files/patch-ab b/print/pic2fig/files/patch-ab
index d363624bd82..99546c2eed2 100644
--- a/print/pic2fig/files/patch-ab
+++ b/print/pic2fig/files/patch-ab
@@ -1,489 +1,21 @@
---- figd.c.orig Sat Aug 6 19:52:43 1988
-+++ figd.c Wed Feb 6 15:54:17 2002
-@@ -6,13 +6,16 @@
- *
- * Modified by Micah Beck to produce Fig code
- * Modified by Micah Beck again to produce Fig 1.4 code
-+ * Modified by Patrick Powell to produce Fig 3.2 code
- */
-
- #include <stdio.h>
- #include <ctype.h>
- #include "object.h"
-
--#define DEF_PEN_SIZE 8 /* Default pen diameter */
-+/* #define DEF_PEN_SIZE 8 / * Default pen diameter */
-+#define DEF_PEN_SIZE 1 /* Default pen diameter */
-+#define DEF_FONT_SIZE 12 /* Default pen diameter */
- #define MAXPOINTS 300 /* Max number of points in a path */
-
- #define bool int
-@@ -23,6 +26,8 @@
- #define P_BLACK 15
- #define TEXTURE 3
- #define ORTEXTURE 7
-+#define FONT_HT 12
-+#define FONT_WIDTH 8
-
- extern double sqrt(), cos(), sin();
-
-@@ -31,11 +36,15 @@
- #define RES 1000.0
- #define Pix_To_In(x) (((float) x) / RES)
-
--#define FIGRES 80
-+/* #define FIGRES 80 */
-+#define FIGRES 1200
- #define FIGCANV_W (8*FIGRES)
- #define FIGCANV_H (10*FIGRES)
-+#define Points_To_Figpix(x) ((int)(FIGRES * (x)/72.0))
- #define Pix_To_Figpix(x) ((int)(FIGRES * Pix_To_In(x)))
--#define Pen_to_Figpix(x) ((x*FIGRES + 500) / 1000)
-+/* #define Pen_to_Figpix(x) ((x*FIGRES + 500) / 1000) */
-+/* pen thickness in 1/80 of inch */
-+#define Pen_to_Figpix(x) ((Pix_To_In(x) + 79) / 80)
-
-
- extern int dbg; /* Non-zero when debugging info wanted */
-@@ -44,7 +53,8 @@
- static float xslope,yslope,xbase,ybase;/* Convert Window to Viewport */
- static int arraylen; /* Number of points in current path */
- static bool pathsent; /* True if path has been defined */
--static int ipensize; /* Desired current pen size */
-+static int ipensize = DEF_PEN_SIZE; /* Desired current pen size */
-+static int ifontsize = DEF_FONT_SIZE; /* Desired current font size */
- extern FILE *TEXFILE; /* Output file */
-
-
-@@ -62,7 +72,7 @@
- yslope = RES * (hiypage-loypage) / (hiy-loy);
- ybase = RES * loypage - loy*yslope;
- if (dbg)
-- printf("Coefficients: %10.5f%10.5f%10.5f%10.5f\n",
-+ printf("Coefficients: %10.5f %10.5f %10.5f %10.5f\n",
- xslope,xbase,yslope,ybase);
- }
-
-@@ -70,14 +80,18 @@
- /*
- * Set the size of the virtual pen used in drawing
- */
-+static sendpath();
- pensize(x)
- int x;
- {
- if (x != ipensize) {
- ipensize = Pen_to_Figpix(x);
-+ ifontsize = x;
-+ if( ipensize == 0 ) ipensize = 1;
- if (!pathsent) sendpath();
- clearpath();
- }
-+ if( dbg) printf("pensize %d -> %d\n", x, ipensize );
- }
-
-
-@@ -149,24 +163,84 @@
- float x, y;
- int position; /* Indicates what part of text is at (x,y) */
- {
-- int ix, iy, offset;
-- char *cp;
-+ int ix, iy, offset, c;
-+ unsigned char *cp;
- map(x, y, &ix, &iy, 1);
-
-- for (cp = text; *cp && isspace(*text); cp++);
-+ for (cp = (unsigned char *)text; isspace(*cp); cp++);
- if (!*cp) return;
-
- #ifdef TEXT_LEFT_ONLY
-- if (position != T_LEFT_JUSTIFIED) offset = strlen(cp)*8;
-+ if (position != T_LEFT_JUSTIFIED) offset = strlen(cp)*Points_To_Figpix(ifontsize);
- if (position == T_CENTER_JUSTIFIED) offset = offset/2;
- position = T_LEFT_JUSTIFIED;
- #else
- offset = 0;
- #endif TEXT_LEFT_ONLY
-
-+/* FORMAT 1.4 CODE
- fprintf(TEXFILE, "%d %d %d %d %d %d %6.3f %d %d %d %d %d %s%c\n",
-- O_TEXT, position, -1, -1, -1, -1, 0.0, -1, 16, strlen(cp)*8,
-+ 4 justification (0,1,2)
-+ font (unused)
-+ fontsize (unused)
-+ pen (unused)
-+ color
-+ depth
-+ angle (not used)
-+ height (pixels)
-+ length (pixels)
-+
-+ 4, position, -1, -1, -1, -1, 0.0, -1, 16, strlen(cp)*Points_To_Figpix(ifontsize),
- Pix_To_Figpix(ix) - offset, Pix_To_Figpix(iy), cp, '\01');
-+Example:
-+4 1 -1 -1 -1 -1 0.000 -1 16 24 229 603 FEP^A
-+
-+FORMAT 3.2 CODE
-+ (3.7) TEXT
-+ type name (brief description)
-+ ---- ---- -------------------
-+ int object (always 4)
-+ int sub_type (0: Left justified
-+ 1: Center justified
-+ 2: Right justified)
-+ int color (enumeration type)
-+ int depth (enumeration type)
-+ int pen_style (enumeration , not used)
-+ int font (enumeration type)
-+ float font_size (font size in points)
-+ float angle (radians, the angle of the text)
-+ int font_flags (bit vector)
-+ float height (Fig units)
-+ float length (Fig units)
-+ int x, y (Fig units, coordinate of the origin
-+ of the string. If sub_type = 0, it is
-+ the lower left corner of the string.
-+ If sub_type = 1, it is the lower
-+ center. Otherwise it is the lower
-+ right corner of the string.)
-+ char string[] (ASCII characters; starts after a blank
-+ character following the last number and
-+ ends before the sequence '\001'. This
-+ sequence is not part of the string.
-+
-+
-+Example:
-+4 1 -1 0 -1 -1 12 0.0000 4 135 330 3450 9060 FEP\001
-+*/
-+ if(dbg) printf("string (%d,%d) '%s'\n", Pix_To_Figpix(ix-offset), Pix_To_Figpix(iy), cp );
-+
-+ fprintf(TEXFILE, "%d %d %d %d %d %d %d %6.3f %d %d %d %d %d ",
-+ O_TEXT, position, -1, 0,-1,-1,ifontsize,0.0, 4,Pix_To_Figpix(FONT_HT),Pix_To_Figpix(strlen(cp)*FONT_WIDTH),
-+ Pix_To_Figpix(ix-offset), Pix_To_Figpix(iy));
-+ while( (c = ((unsigned char *)(cp))[0]) ){
-+ if( c == '\\' ){
-+ fprintf(TEXFILE, "\\\\");
-+ } else if( isprint(c) || isspace(c) ){
-+ fprintf(TEXFILE, "%c", c);
-+ }
-+ ++cp;
-+ }
-+ fprintf(TEXFILE, "\\001\n");
- }
-
-
-@@ -208,16 +282,54 @@
- {
- register int i;
-
-- if (dbg) printf("Sending path ...%d\n", arraylen);
-+ if (dbg) printf("Sendpath [%d], ipensize %d\n", arraylen, ipensize);
- if (arraylen > 1) {
-
-+ /*
- fprintf(TEXFILE, "%d %d %d %d %d %d %d %d %d %d %d\n",
- O_POLYLINE, T_POLYLINE, SOLID_LINE,
- ipensize, -1, -1, -1, -1, -1, 0, 0);
-- for (i=1; i<=arraylen; i++)
-- fprintf(TEXFILE, "%d %d ",
-+
-+Example:
-+ 2 1 0 1 -1 -1 -1 -1 -1 0 0
-+ 19 149 19 9 179 9 179 149 19 149 9999 9999
-+
-+New format:
-+ 2 1 0 1 -1 -1 0 -1 -1 -1.000 0 0 -1 0 0 5
-+ code pen_color
-+ type fill_color
-+ line style
-+ depth
-+ pen_style
-+ style_value
-+ join_style
-+ cap_style
-+ radius
-+ forward_arrow
-+ count
-+ thickness (1/80 inch)
-+ -1 = Default
-+ 0 = Solid
-+ 1 = Dashed
-+ 2 = Dotted
-+ 3 = Dash-dotted
-+ 4 = Dash-double-dotted
-+ 5 = Dash-triple-dotted
-+
-+ 300 2250 300 150 2700 150 2700 2250 300 2250
-+
-+
-+ */
-+ fprintf(TEXFILE, "%d %d %d %d -1 -1 0 -1 -1 -1.000 0 0 -1 0 0 %d\n ",
-+ 2, T_POLYLINE, SOLID_LINE, ipensize, arraylen );
-+ for (i=1; i<=arraylen; i++){
-+ if (dbg) printf(" (%d,%d)", Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
-+ fprintf(TEXFILE, "%d %d ",
- Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
-- fprintf(TEXFILE, "9999 9999\n");
-+ }
-+ if (dbg) printf("\n", Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
-+ /* fprintf(TEXFILE, "9999 9999\n"); */
-+ fprintf(TEXFILE, "\n");
- }
-
- pathsent = TRUE;
-@@ -234,17 +346,23 @@
- {
- register int i;
-
-- if (dbg) printf("Sending path ...%d\n", arraylen);
-+ if (dbg) printf("Send_dashed_path ...%d\n", arraylen);
- if (arraylen < 2) return;
- else {
-+/*
- fprintf(TEXFILE, "%d %d %d %d %d %d %d %d %d %d %d\n",
- O_POLYLINE, T_POLYLINE,
- (dotted ? DOTTED_LINE : DASH_LINE), ipensize,
- -1, -1, -1, -1, -1, 0, 0);
-- for (i=1; i<=arraylen; i++)
-+ */
-+ fprintf(TEXFILE, "%d %d %d %d -1 -1 0 -1 -1 -1.000 0 0 -1 0 0 %d\n ",
-+ 2, T_POLYLINE, (dotted? DOTTED_LINE: DASH_LINE), ipensize, arraylen );
-+ for (i=1; i<=arraylen; i++){
- fprintf(TEXFILE, "%d %d ",
- Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
-- fprintf(TEXFILE, "9999 9999\n");
-+ }
-+ /* fprintf(TEXFILE, "9999 9999\n"); */
-+ fprintf(TEXFILE, "\n");
- }
-
- pathsent = TRUE;
-@@ -294,7 +412,7 @@
- fig_arc(xcenter, ycenter, xradius, yradius, start, stop)
- float xcenter, ycenter, xradius, yradius, start, stop;
- {
-- int X0, Y0, xrad, yrad, xend, yend;
-+ int X0, Y0, xrad, yrad, xend, yend, xstart, ystart;
- extern double cos(), sin();
-
- map(xcenter, ycenter, &X0, &Y0, FALSE);
-@@ -304,18 +422,85 @@
- if (is_onarc(PI/2, start, stop)) ckbounds(X0, Y0+yrad);
- if (is_onarc(PI, start, stop)) ckbounds(X0-xrad, Y0);
- if (is_onarc(1.5*PI, start, stop)) ckbounds(X0, Y0-yrad);
-- xend = X0 + xrad * cos(start) + 0.5;
-- yend = Y0 + yrad * sin(start) + 0.5;
-- ckbounds(xend, yend);
-+ xstart = X0 + xrad * cos(start) + 0.5;
-+ ystart = Y0 + yrad * sin(start) + 0.5;
-+ ckbounds(xstart, ystart);
- xend = X0 + xrad * cos(stop);
- yend = Y0 + yrad * sin(stop);
- ckbounds(xend, yend);
-+ if(dbg) printf("Ellipse: X0 %d, Y0 %d, xrad %d, yrad %d, xstart %d, ystart %d, xend %d, yend %d\n",
-+ Pix_To_Figpix(X0), Pix_To_Figpix(Y0),
-+ Pix_To_Figpix(xrad), Pix_To_Figpix(yrad),
-+ Pix_To_Figpix(xstart), Pix_To_Figpix(ystart),
-+ Pix_To_Figpix(xend), Pix_To_Figpix(yend));
-+
-+/*
-+ int object_code (always 1)
-+ int sub_type (1 : ellipse defined by radiuses
-+ 2 : ellipse defined by diameters
-+ 3 : circle defined by radius
-+ 4 : circle defined by diameter)
-+ int line_style (See the end of this section)
-+ int thickness (pixels, not used)
-+ int color (not used)
-+ int depth (not used)
-+ int pen (not used)
-+ int area_fill (not used)
-+ float style_val (pixels, not used)
-+ int direction (always 1)
-+ float angle (radian, the angle of the x-axis)
-+ int center_x, center_y (pixels)
-+ int radius_x, radius_y (pixels)
-+ int start_x, start_y (pixels; the 1st point entered)
-+ int end_x, end_y (pixels; the last point entered)
-+
-+Example:
-+ 1 1 0 1 -1, -1 -1 -1 -1 1 0 0.000 0.000 0.000 0.000 0.000 0.000
-
- 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",
- O_ELLIPSE, T_ELLIPSE_BY_RAD,
- SOLID_LINE, ipensize, -1, -1, -1, -1, -1, 1, 0.0,
- Pix_To_Figpix(X0), Pix_To_Figpix(Y0),
- Pix_To_Figpix(xrad), Pix_To_Figpix(yrad), 0.0, 0.0, 0.0, 0.0);
-+
-+
-+ int object_code (always 1)
-+ int sub_type (1: ellipse defined by radii
-+ 2: ellipse defined by diameters
-+ 3: circle defined by radius
-+ 4: circle defined by diameter)
-+ int line_style (enumeration type)
-+ int thickness (1/80 inch)
-+ --
-+ int pen_color (enumeration type, pen color)
-+ int fill_color (enumeration type, fill color)
-+ int depth (enumeration type)
-+ int pen_style (pen style, not used)
-+ int area_fill (enumeration type, -1 = no fill)
-+ float style_val (1/80 inch)
-+ int direction (always 1)
-+ float angle (radians, the angle of the x-axis)
-+ int center_x, center_y (Fig units)
-+ int radius_x, radius_y (Fig units)
-+ int start_x, start_y (Fig units; the 1st point entered)
-+ int end_x, end_y (Fig units; the last point entered)
-+
-+Example:
-+ 1 1 0 1 0 7 50 0 -1 0.000 1 0.0000 1125 975 675 375 1125 975 1800 1350
-+ pen areafill
-+ fill styleval
-+ depth
-+ pen_style
-+*/
-+
-+
-+ fprintf(TEXFILE, "%d %d %d %d", O_ELLIPSE, T_ELLIPSE_BY_RAD, SOLID_LINE, ipensize );
-+ fprintf(TEXFILE, " 0 7 50 0 -1 0.0 1 0.0" );
-+ fprintf(TEXFILE, " %d %d %d %d %d %d %d %d\n",
-+ Pix_To_Figpix(X0), Pix_To_Figpix(Y0),
-+ Pix_To_Figpix(xrad), Pix_To_Figpix(yrad),
-+ Pix_To_Figpix(xstart), Pix_To_Figpix(ystart),
-+ Pix_To_Figpix(xend), Pix_To_Figpix(yend));
- }
-
-
-@@ -347,14 +532,56 @@
- */
- fig_begin_drawing()
- {
-- fprintf(TEXFILE, "#FIG 1.4\n%d %d\n", FIGRES, 2);
-+
-+/*
-+(1) The very first line is a comment line containing the name and version:
-+ #FIG 3.2
-+(2) The first non-comment line consists of the following:
-+
-+ string orientation ("Landscape" or "Portrait")
-+ string justification ("Center" or "Flush Left")
-+ string units ("Metric" or "Inches")
-+ string papersize ("Letter", "Legal", "Ledger", "Tabloid",
-+ "A", "B", "C", "D", "E",
-+ "A4", "A3", "A2", "A1", "A0" and "B5")
-+ float magnification (export and print magnification, %)
-+ string multiple-page ("Single" or "Multiple" pages)
-+ int transparent color (color number for transparent color for GIF
-+ export. -3=background, -2=None, -1=Default,
-+ 0-31 for standard colors or 32- for user colors)
-+ # optional comment (An optional set of comments may be here,
-+ which are associated with the whole figure)
-+ int resolution coord_system (Fig units/inch and coordinate system:
-+ 1: origin at lower left corner (NOT USED)
-+ 2: upper left)
-+Example:
-+ #FIG 3.2
-+ Landscape
-+ Center
-+ Inches
-+ Letter
-+ 100.00
-+ Single
-+ -2
-+ 1200 2
-+
-+*/
-+ fprintf(TEXFILE, "#FIG 3.2\n");
-+ fprintf(TEXFILE, "Landscape\n");
-+ fprintf(TEXFILE, "Center\n");
-+ fprintf(TEXFILE, "Inches\n");
-+ fprintf(TEXFILE, "Letter\n");
-+ fprintf(TEXFILE, "100.00\n");
-+ fprintf(TEXFILE, "Single\n");
-+ fprintf(TEXFILE, "-2\n");
-+ fprintf(TEXFILE, "%d %d\n", FIGRES, 2 );
-
- fig_window(0.0, 0.0, 10.0, 10.0, 0.0, 0.0, 3.0, 3.0);
- xmin = 30000; xmax = -30000;
- ymin = 30000; ymax = -30000;
- arraylen = 0;
- pathsent = FALSE;
-- ipensize = Pen_to_Figpix(DEF_PEN_SIZE);
-+ pensize(DEF_PEN_SIZE);
- }
-
-
-@@ -392,15 +619,67 @@
- clearpath();
- }
-
-+/*
- fprintf(TEXFILE, "%d %d %d %d %d %d %d %d %d %d %d\n",
- O_SPLINE, T_OPEN_NORMAL,
- SOLID_LINE, ipensize, -1, -1, -1, -1, -1, 0, 0);
-+ fprintf(TEXFILE, "9999 9999\n");
-+
-+New format:
-+ int object_code (always 3)
-+ int sub_type (0: open approximated spline
-+ 1: closed approximated spline
-+ 2: open interpolated spline
-+ 3: closed interpolated spline
-+ 4: open x-spline
-+ 5: closed x-spline)
-+ int line_style (See the end of this section)
-+ int thickness (1/80 inch)
-+ int pen_color (enumeration type, pen color)
-+ int fill_color (enumeration type, fill color)
-+ int depth (enumeration type)
-+ int pen_style (pen style, not used)
-+ int area_fill (enumeration type, -1 = no fill)
-+ float style_val (1/80 inch)
-+ int cap_style (enumeration type, only used for open splines)
-+ int forward_arrow (0: off, 1: on)
-+ int backward_arrow (0: off, 1: on)
-+ int npoints (number of control points in spline)
-+
-+ Forward arrow line: same as ARC object
-+
-+ Backward arrow line: same as ARC object
-+
-+ Points line: same as POLYLINE object
-+
-+ Control points line :
-+
-+ There is one shape factor for each point. The value of this factor
-+ must be between -1 (which means that the spline is interpolated at
-+ this point) and 1 (which means that the spline is approximated at
-+ this point). The spline is always smooth in the neighbourhood of a
-+ control point, except when the value of the factor is 0 for which
-+ there is a first-order discontinuity (i.e. angular point).
-+
-+Example:
-+ 3 2 0 1 0 7 50 0 -1 0.000 0 0 0 3
-+ 975 1950 1875 1500 2550 1950
-+ 0.000 -1.000 0.000
-+
-+*/
-+ fprintf(TEXFILE, "%d %d %d %d", 3, 2, SOLID_LINE, ipensize );
-+ fprintf(TEXFILE, " 0 7 50 0 -1 0.000 0 0 0 %d\n ", N-1 );
- for (i=1; i<N; i++) {
-- ckbounds(xx[i], yy[i]);
-- fprintf(TEXFILE, "%d %d ",
-- Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
-- }
-- fprintf(TEXFILE, "9999 9999\n");
-+ ckbounds(xx[i], yy[i]);
-+ fprintf(TEXFILE, " %d %d",
-+ Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
-+ }
-+ fprintf(TEXFILE, "\n ");
-+ fprintf(TEXFILE, " 0.0");
-+ for (i=2; i<N-1; i++) {
-+ fprintf(TEXFILE, " -1.0");
-+ }
-+ fprintf(TEXFILE, " 0.0\n");
- }
+--- Makefile.orig Mon Apr 29 10:11:02 1991
++++ Makefile Wed Apr 3 10:27:14 2002
+@@ -1,7 +1,7 @@
+ BINDIR = /usr/local/bin
+-CFLAGS = -O4 -s $(CROSS)
++#CFLAGS = -O4 -s $(CROSS)
+ #LDFLAGS= -zs
+-LDFLAGS= -z $(CROSS)
++#LDFLAGS= -z $(CROSS)
+ YFLAGS = -d
+
+ MOFILES = main.o boxgen.o print.o misc.o symtab.o blockgen.o circgen.o \
+@@ -29,7 +29,7 @@
+ -@echo ""
+
+ pic2fig: picy.o picl.o $(OFILES)
+- cc $(LDFLAGS) -o $@ picy.o picl.o $(OFILES) -lm
++ $(CC) $(LDFLAGS) -o $@ picy.o picl.o $(OFILES) -lm
+
+ # The following .o files depend of picy.c, since they really need picy.h
+ picl.o: picl.c pic.h picy.c
diff --git a/print/pic2fig/files/patch-ac b/print/pic2fig/files/patch-ac
index 23986aa3f6b..c28747f49ae 100644
--- a/print/pic2fig/files/patch-ac
+++ b/print/pic2fig/files/patch-ac
@@ -1,14 +1,497 @@
---- main.c.orig Mon Feb 8 06:21:12 1988
-+++ main.c Tue Jan 16 08:26:39 2001
-@@ -1,10 +1,10 @@
- #include <stdio.h>
- #include <ctype.h>
-+#include <strings.h>
- #include "pic.h"
- #include "picy.h"
-
- static reset();
--extern char *sprintf(), *strcpy();
-
- struct obj *objlist[MAXOBJ]; /* store the elements here */
- int nobj = 0;
+--- figd.c.orig Sat Aug 6 19:52:43 1988
++++ figd.c Wed Apr 3 10:27:14 2002
+@@ -6,13 +6,16 @@
+ *
+ * Modified by Micah Beck to produce Fig code
+ * Modified by Micah Beck again to produce Fig 1.4 code
++ * Modified by Patrick Powell to produce Fig 3.2 code
+ */
+
+ #include <stdio.h>
+ #include <ctype.h>
+ #include "object.h"
+
+-#define DEF_PEN_SIZE 8 /* Default pen diameter */
++/* #define DEF_PEN_SIZE 8 / * Default pen diameter */
++#define DEF_PEN_SIZE 1 /* Default pen diameter */
++#define DEF_FONT_SIZE 12 /* Default pen diameter */
+ #define MAXPOINTS 300 /* Max number of points in a path */
+
+ #define bool int
+@@ -23,6 +26,8 @@
+ #define P_BLACK 15
+ #define TEXTURE 3
+ #define ORTEXTURE 7
++#define FONT_HT 12
++#define FONT_WIDTH 8
+
+ extern double sqrt(), cos(), sin();
+
+@@ -31,11 +36,15 @@
+ #define RES 1000.0
+ #define Pix_To_In(x) (((float) x) / RES)
+
+-#define FIGRES 80
++/* #define FIGRES 80 */
++#define FIGRES 1200
+ #define FIGCANV_W (8*FIGRES)
+ #define FIGCANV_H (10*FIGRES)
++#define Points_To_Figpix(x) ((int)(FIGRES * (x)/72.0))
+ #define Pix_To_Figpix(x) ((int)(FIGRES * Pix_To_In(x)))
+-#define Pen_to_Figpix(x) ((x*FIGRES + 500) / 1000)
++/* #define Pen_to_Figpix(x) ((x*FIGRES + 500) / 1000) */
++/* pen thickness in 1/80 of inch */
++#define Pen_to_Figpix(x) ((Pix_To_In(x) + 79) / 80)
+
+
+ extern int dbg; /* Non-zero when debugging info wanted */
+@@ -44,8 +53,10 @@
+ static float xslope,yslope,xbase,ybase;/* Convert Window to Viewport */
+ static int arraylen; /* Number of points in current path */
+ static bool pathsent; /* True if path has been defined */
+-static int ipensize; /* Desired current pen size */
++static int ipensize = DEF_PEN_SIZE; /* Desired current pen size */
++static int ifontsize = DEF_FONT_SIZE; /* Desired current font size */
+ extern FILE *TEXFILE; /* Output file */
++int font = -1; /* font number */
+
+
+ /*
+@@ -62,7 +73,7 @@
+ yslope = RES * (hiypage-loypage) / (hiy-loy);
+ ybase = RES * loypage - loy*yslope;
+ if (dbg)
+- printf("Coefficients: %10.5f%10.5f%10.5f%10.5f\n",
++ printf("Coefficients: %10.5f %10.5f %10.5f %10.5f\n",
+ xslope,xbase,yslope,ybase);
+ }
+
+@@ -70,14 +81,18 @@
+ /*
+ * Set the size of the virtual pen used in drawing
+ */
++static sendpath();
+ pensize(x)
+ int x;
+ {
+ if (x != ipensize) {
+ ipensize = Pen_to_Figpix(x);
++ ifontsize = x;
++ if( ipensize == 0 ) ipensize = 1;
+ if (!pathsent) sendpath();
+ clearpath();
+ }
++ if( dbg) printf("pensize %d -> %d\n", x, ipensize );
+ }
+
+
+@@ -149,24 +164,85 @@
+ float x, y;
+ int position; /* Indicates what part of text is at (x,y) */
+ {
+- int ix, iy, offset;
+- char *cp;
++ int ix, iy, offset, c;
++ unsigned char *cp;
+ map(x, y, &ix, &iy, 1);
+
+- for (cp = text; *cp && isspace(*text); cp++);
++ for (cp = (unsigned char *)text; isspace(*cp); cp++);
+ if (!*cp) return;
+
+ #ifdef TEXT_LEFT_ONLY
+- if (position != T_LEFT_JUSTIFIED) offset = strlen(cp)*8;
++ if (position != T_LEFT_JUSTIFIED) offset = strlen(cp)*Points_To_Figpix(ifontsize);
+ if (position == T_CENTER_JUSTIFIED) offset = offset/2;
+ position = T_LEFT_JUSTIFIED;
+ #else
+ offset = 0;
+ #endif TEXT_LEFT_ONLY
+
++/* FORMAT 1.4 CODE
+ fprintf(TEXFILE, "%d %d %d %d %d %d %6.3f %d %d %d %d %d %s%c\n",
+- O_TEXT, position, -1, -1, -1, -1, 0.0, -1, 16, strlen(cp)*8,
++ 4 justification (0,1,2)
++ font (unused)
++ fontsize (unused)
++ pen (unused)
++ color
++ depth
++ angle (not used)
++ height (pixels)
++ length (pixels)
++
++ 4, position, -1, -1, -1, -1, 0.0, -1, 16, strlen(cp)*Points_To_Figpix(ifontsize),
+ Pix_To_Figpix(ix) - offset, Pix_To_Figpix(iy), cp, '\01');
++Example:
++4 1 -1 -1 -1 -1 0.000 -1 16 24 229 603 FEP^A
++
++FORMAT 3.2 CODE
++Example:
++4 1 -1 0 -1 -1 12 0.0000 4 135 330 3450 9060 FEP\001
++1 2 3 4 5 6 7 8 9 10 11 12 13 14
++ (3.7) TEXT
++ type name (brief description)
++ ---- ---- -------------------
++ int object (always 4) 1
++ int sub_type (0: Left justified 2
++ 1: Center justified
++ 2: Right justified)
++ int color (enumeration type) 3
++ int depth (enumeration type) 4
++ int pen_style (enumeration , not used) 5
++ int font (enumeration type) 6
++ float font_size (font size in points) 7
++ float angle (radians, the angle of the text) 8
++ int font_flags (bit vector) 9
++ float height (Fig units) 10
++ float length (Fig units) 11
++ int x, y (Fig units, coordinate of the origin 12,13
++ of the string. If sub_type = 0, it is
++ the lower left corner of the string.
++ If sub_type = 1, it is the lower
++ center. Otherwise it is the lower
++ right corner of the string.)
++ char string[] (ASCII characters; starts after a blank 14
++ character following the last number and
++ ends before the sequence '\001'. This
++ sequence is not part of the string.
++
++
++*/
++ if(dbg) printf("string (%d,%d) '%s'\n", Pix_To_Figpix(ix-offset), Pix_To_Figpix(iy), cp );
++
++ fprintf(TEXFILE, "%d %d %d %d %d %d %d %6.3f %d %d %d %d %d ",
++ O_TEXT, position, -1, 0,-1,font,ifontsize,0.0, 4,Pix_To_Figpix(FONT_HT),Pix_To_Figpix(strlen(cp)*FONT_WIDTH),
++ Pix_To_Figpix(ix-offset), Pix_To_Figpix(iy));
++ while( (c = ((unsigned char *)(cp))[0]) ){
++ if( c == '\\' ){
++ fprintf(TEXFILE, "\\\\");
++ } else if( isprint(c) || isspace(c) ){
++ fprintf(TEXFILE, "%c", c);
++ }
++ ++cp;
++ }
++ fprintf(TEXFILE, "\\001\n");
+ }
+
+
+@@ -208,16 +284,54 @@
+ {
+ register int i;
+
+- if (dbg) printf("Sending path ...%d\n", arraylen);
++ if (dbg) printf("Sendpath [%d], ipensize %d\n", arraylen, ipensize);
+ if (arraylen > 1) {
+
++ /*
+ fprintf(TEXFILE, "%d %d %d %d %d %d %d %d %d %d %d\n",
+ O_POLYLINE, T_POLYLINE, SOLID_LINE,
+ ipensize, -1, -1, -1, -1, -1, 0, 0);
+- for (i=1; i<=arraylen; i++)
+- fprintf(TEXFILE, "%d %d ",
++
++Example:
++ 2 1 0 1 -1 -1 -1 -1 -1 0 0
++ 19 149 19 9 179 9 179 149 19 149 9999 9999
++
++New format:
++ 2 1 0 1 -1 -1 0 -1 -1 -1.000 0 0 -1 0 0 5
++ code pen_color
++ type fill_color
++ line style
++ depth
++ pen_style
++ style_value
++ join_style
++ cap_style
++ radius
++ forward_arrow
++ count
++ thickness (1/80 inch)
++ -1 = Default
++ 0 = Solid
++ 1 = Dashed
++ 2 = Dotted
++ 3 = Dash-dotted
++ 4 = Dash-double-dotted
++ 5 = Dash-triple-dotted
++
++ 300 2250 300 150 2700 150 2700 2250 300 2250
++
++
++ */
++ fprintf(TEXFILE, "%d %d %d %d -1 -1 0 -1 -1 -1.000 0 0 -1 0 0 %d\n ",
++ 2, T_POLYLINE, SOLID_LINE, ipensize, arraylen );
++ for (i=1; i<=arraylen; i++){
++ if (dbg) printf(" (%d,%d)", Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
++ fprintf(TEXFILE, "%d %d ",
+ Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
+- fprintf(TEXFILE, "9999 9999\n");
++ }
++ if (dbg) printf("\n", Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
++ /* fprintf(TEXFILE, "9999 9999\n"); */
++ fprintf(TEXFILE, "\n");
+ }
+
+ pathsent = TRUE;
+@@ -234,17 +348,26 @@
+ {
+ register int i;
+
+- if (dbg) printf("Sending path ...%d\n", arraylen);
++ if (dbg) printf("Send_dashed_path ...%d, inchesperdash %f, dotted %d\n",
++ arraylen, inchesperdash, dotted );
+ if (arraylen < 2) return;
+ else {
++/*
+ fprintf(TEXFILE, "%d %d %d %d %d %d %d %d %d %d %d\n",
+ O_POLYLINE, T_POLYLINE,
+ (dotted ? DOTTED_LINE : DASH_LINE), ipensize,
+ -1, -1, -1, -1, -1, 0, 0);
+- for (i=1; i<=arraylen; i++)
++ */
++ fprintf(TEXFILE, "%d %d %d %d -1 -1 0 -1 -1 %f 0 0 -1 0 0 %d\n ",
++ 2, T_POLYLINE, (dotted? DOTTED_LINE: DASH_LINE), ipensize,
++ inchesperdash*80,
++ arraylen );
++ for (i=1; i<=arraylen; i++){
+ fprintf(TEXFILE, "%d %d ",
+ Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
+- fprintf(TEXFILE, "9999 9999\n");
++ }
++ /* fprintf(TEXFILE, "9999 9999\n"); */
++ fprintf(TEXFILE, "\n");
+ }
+
+ pathsent = TRUE;
+@@ -294,7 +417,7 @@
+ fig_arc(xcenter, ycenter, xradius, yradius, start, stop)
+ float xcenter, ycenter, xradius, yradius, start, stop;
+ {
+- int X0, Y0, xrad, yrad, xend, yend;
++ int X0, Y0, xrad, yrad, xend, yend, xstart, ystart;
+ extern double cos(), sin();
+
+ map(xcenter, ycenter, &X0, &Y0, FALSE);
+@@ -304,18 +427,85 @@
+ if (is_onarc(PI/2, start, stop)) ckbounds(X0, Y0+yrad);
+ if (is_onarc(PI, start, stop)) ckbounds(X0-xrad, Y0);
+ if (is_onarc(1.5*PI, start, stop)) ckbounds(X0, Y0-yrad);
+- xend = X0 + xrad * cos(start) + 0.5;
+- yend = Y0 + yrad * sin(start) + 0.5;
+- ckbounds(xend, yend);
++ xstart = X0 + xrad * cos(start) + 0.5;
++ ystart = Y0 + yrad * sin(start) + 0.5;
++ ckbounds(xstart, ystart);
+ xend = X0 + xrad * cos(stop);
+ yend = Y0 + yrad * sin(stop);
+ ckbounds(xend, yend);
++ if(dbg) printf("Ellipse: X0 %d, Y0 %d, xrad %d, yrad %d, xstart %d, ystart %d, xend %d, yend %d\n",
++ Pix_To_Figpix(X0), Pix_To_Figpix(Y0),
++ Pix_To_Figpix(xrad), Pix_To_Figpix(yrad),
++ Pix_To_Figpix(xstart), Pix_To_Figpix(ystart),
++ Pix_To_Figpix(xend), Pix_To_Figpix(yend));
++
++/*
++ int object_code (always 1)
++ int sub_type (1 : ellipse defined by radiuses
++ 2 : ellipse defined by diameters
++ 3 : circle defined by radius
++ 4 : circle defined by diameter)
++ int line_style (See the end of this section)
++ int thickness (pixels, not used)
++ int color (not used)
++ int depth (not used)
++ int pen (not used)
++ int area_fill (not used)
++ float style_val (pixels, not used)
++ int direction (always 1)
++ float angle (radian, the angle of the x-axis)
++ int center_x, center_y (pixels)
++ int radius_x, radius_y (pixels)
++ int start_x, start_y (pixels; the 1st point entered)
++ int end_x, end_y (pixels; the last point entered)
++
++Example:
++ 1 1 0 1 -1, -1 -1 -1 -1 1 0 0.000 0.000 0.000 0.000 0.000 0.000
+
+ 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",
+ O_ELLIPSE, T_ELLIPSE_BY_RAD,
+ SOLID_LINE, ipensize, -1, -1, -1, -1, -1, 1, 0.0,
+ Pix_To_Figpix(X0), Pix_To_Figpix(Y0),
+ Pix_To_Figpix(xrad), Pix_To_Figpix(yrad), 0.0, 0.0, 0.0, 0.0);
++
++
++ int object_code (always 1)
++ int sub_type (1: ellipse defined by radii
++ 2: ellipse defined by diameters
++ 3: circle defined by radius
++ 4: circle defined by diameter)
++ int line_style (enumeration type)
++ int thickness (1/80 inch)
++ --
++ int pen_color (enumeration type, pen color)
++ int fill_color (enumeration type, fill color)
++ int depth (enumeration type)
++ int pen_style (pen style, not used)
++ int area_fill (enumeration type, -1 = no fill)
++ float style_val (1/80 inch)
++ int direction (always 1)
++ float angle (radians, the angle of the x-axis)
++ int center_x, center_y (Fig units)
++ int radius_x, radius_y (Fig units)
++ int start_x, start_y (Fig units; the 1st point entered)
++ int end_x, end_y (Fig units; the last point entered)
++
++Example:
++ 1 1 0 1 0 7 50 0 -1 0.000 1 0.0000 1125 975 675 375 1125 975 1800 1350
++ pen areafill
++ fill styleval
++ depth
++ pen_style
++*/
++
++
++ fprintf(TEXFILE, "%d %d %d %d", O_ELLIPSE, T_ELLIPSE_BY_RAD, SOLID_LINE, ipensize );
++ fprintf(TEXFILE, " 0 7 50 0 -1 0.0 1 0.0" );
++ fprintf(TEXFILE, " %d %d %d %d %d %d %d %d\n",
++ Pix_To_Figpix(X0), Pix_To_Figpix(Y0),
++ Pix_To_Figpix(xrad), Pix_To_Figpix(yrad),
++ Pix_To_Figpix(xstart), Pix_To_Figpix(ystart),
++ Pix_To_Figpix(xend), Pix_To_Figpix(yend));
+ }
+
+
+@@ -347,14 +537,56 @@
+ */
+ fig_begin_drawing()
+ {
+- fprintf(TEXFILE, "#FIG 1.4\n%d %d\n", FIGRES, 2);
++
++/*
++(1) The very first line is a comment line containing the name and version:
++ #FIG 3.2
++(2) The first non-comment line consists of the following:
++
++ string orientation ("Landscape" or "Portrait")
++ string justification ("Center" or "Flush Left")
++ string units ("Metric" or "Inches")
++ string papersize ("Letter", "Legal", "Ledger", "Tabloid",
++ "A", "B", "C", "D", "E",
++ "A4", "A3", "A2", "A1", "A0" and "B5")
++ float magnification (export and print magnification, %)
++ string multiple-page ("Single" or "Multiple" pages)
++ int transparent color (color number for transparent color for GIF
++ export. -3=background, -2=None, -1=Default,
++ 0-31 for standard colors or 32- for user colors)
++ # optional comment (An optional set of comments may be here,
++ which are associated with the whole figure)
++ int resolution coord_system (Fig units/inch and coordinate system:
++ 1: origin at lower left corner (NOT USED)
++ 2: upper left)
++Example:
++ #FIG 3.2
++ Landscape
++ Center
++ Inches
++ Letter
++ 100.00
++ Single
++ -2
++ 1200 2
++
++*/
++ fprintf(TEXFILE, "#FIG 3.2\n");
++ fprintf(TEXFILE, "Landscape\n");
++ fprintf(TEXFILE, "Center\n");
++ fprintf(TEXFILE, "Inches\n");
++ fprintf(TEXFILE, "Letter\n");
++ fprintf(TEXFILE, "100.00\n");
++ fprintf(TEXFILE, "Single\n");
++ fprintf(TEXFILE, "-2\n");
++ fprintf(TEXFILE, "%d %d\n", FIGRES, 2 );
+
+ fig_window(0.0, 0.0, 10.0, 10.0, 0.0, 0.0, 3.0, 3.0);
+ xmin = 30000; xmax = -30000;
+ ymin = 30000; ymax = -30000;
+ arraylen = 0;
+ pathsent = FALSE;
+- ipensize = Pen_to_Figpix(DEF_PEN_SIZE);
++ pensize(DEF_PEN_SIZE);
+ }
+
+
+@@ -392,15 +624,67 @@
+ clearpath();
+ }
+
++/*
+ fprintf(TEXFILE, "%d %d %d %d %d %d %d %d %d %d %d\n",
+ O_SPLINE, T_OPEN_NORMAL,
+ SOLID_LINE, ipensize, -1, -1, -1, -1, -1, 0, 0);
++ fprintf(TEXFILE, "9999 9999\n");
++
++New format:
++ int object_code (always 3)
++ int sub_type (0: open approximated spline
++ 1: closed approximated spline
++ 2: open interpolated spline
++ 3: closed interpolated spline
++ 4: open x-spline
++ 5: closed x-spline)
++ int line_style (See the end of this section)
++ int thickness (1/80 inch)
++ int pen_color (enumeration type, pen color)
++ int fill_color (enumeration type, fill color)
++ int depth (enumeration type)
++ int pen_style (pen style, not used)
++ int area_fill (enumeration type, -1 = no fill)
++ float style_val (1/80 inch)
++ int cap_style (enumeration type, only used for open splines)
++ int forward_arrow (0: off, 1: on)
++ int backward_arrow (0: off, 1: on)
++ int npoints (number of control points in spline)
++
++ Forward arrow line: same as ARC object
++
++ Backward arrow line: same as ARC object
++
++ Points line: same as POLYLINE object
++
++ Control points line :
++
++ There is one shape factor for each point. The value of this factor
++ must be between -1 (which means that the spline is interpolated at
++ this point) and 1 (which means that the spline is approximated at
++ this point). The spline is always smooth in the neighbourhood of a
++ control point, except when the value of the factor is 0 for which
++ there is a first-order discontinuity (i.e. angular point).
++
++Example:
++ 3 2 0 1 0 7 50 0 -1 0.000 0 0 0 3
++ 975 1950 1875 1500 2550 1950
++ 0.000 -1.000 0.000
++
++*/
++ fprintf(TEXFILE, "%d %d %d %d", 3, 2, SOLID_LINE, ipensize );
++ fprintf(TEXFILE, " 0 7 50 0 -1 0.000 0 0 0 %d\n ", N-1 );
+ for (i=1; i<N; i++) {
+- ckbounds(xx[i], yy[i]);
+- fprintf(TEXFILE, "%d %d ",
+- Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
+- }
+- fprintf(TEXFILE, "9999 9999\n");
++ ckbounds(xx[i], yy[i]);
++ fprintf(TEXFILE, " %d %d",
++ Pix_To_Figpix(xx[i]), Pix_To_Figpix(yy[i]));
++ }
++ fprintf(TEXFILE, "\n ");
++ fprintf(TEXFILE, " 0.0");
++ for (i=2; i<N-1; i++) {
++ fprintf(TEXFILE, " -1.0");
++ }
++ fprintf(TEXFILE, " 0.0\n");
+ }
+
+
diff --git a/print/pic2fig/files/patch-ad b/print/pic2fig/files/patch-ad
new file mode 100644
index 00000000000..1a44c1438d0
--- /dev/null
+++ b/print/pic2fig/files/patch-ad
@@ -0,0 +1,31 @@
+--- main.c.orig Mon Feb 8 06:21:12 1988
++++ main.c Wed Apr 3 10:28:56 2002
+@@ -1,10 +1,10 @@
+ #include <stdio.h>
+ #include <ctype.h>
++#include <strings.h>
+ #include "pic.h"
+ #include "picy.h"
+
+ static reset();
+-extern char *sprintf(), *strcpy();
+
+ struct obj *objlist[MAXOBJ]; /* store the elements here */
+ int nobj = 0;
+@@ -27,7 +27,7 @@
+ float deltx = 6; /* max x value in output, for scaling */
+ float delty = 6; /* max y value in output, for scaling */
+ int dbg = 0;
+-extern FILE *yyin; /* input file pointer */
++extern FILE *yyin, *yyout; /* input and out file pointers */
+ FILE *TEXFILE; /* Output file */
+ int lineno = 0;
+ char *filename = "-";
+@@ -51,6 +51,7 @@
+ {
+ char TEXfilename[BUFSIZ], buffer[BUFSIZ], *bp, *rindex();
+
++ yyin = stdin; yyout = stdout;
+ cmdname = argv[0];
+ while (argc > 1 && *argv[1] == '-') {
+ switch (argv[1][1]) {
diff --git a/print/pic2fig/files/patch-ae b/print/pic2fig/files/patch-ae
new file mode 100644
index 00000000000..ee66a6d9eb2
--- /dev/null
+++ b/print/pic2fig/files/patch-ae
@@ -0,0 +1,7 @@
+--- pic.h.orig Wed Apr 3 10:27:42 2002
++++ pic.h Wed Apr 3 10:29:33 2002
+@@ -128,4 +128,3 @@
+ extern struct pushstack stack[];
+ extern int nstack;
+
+-extern float atof();
diff --git a/print/pic2fig/files/patch-af b/print/pic2fig/files/patch-af
new file mode 100644
index 00000000000..15ad2196bd3
--- /dev/null
+++ b/print/pic2fig/files/patch-af
@@ -0,0 +1,54 @@
+--- pic2fig.1.orig Thu Feb 11 05:34:07 1988
++++ pic2fig.1 Wed Apr 3 10:27:14 2002
+@@ -55,6 +55,51 @@
+ must be given in the first column. Changing the drawing thickness applies
+ to solid, dashed, and dotted lines, as well as circles, arcs, and ellipses.
+ .PP
++Setting the font for text may be done using a
++.ti +.5i
++\&.ft \fIn\fR
++
++command, where \fIn\fR corresponds to the following PostScript fonts:
++.nf
++-1 Default font
++ 0 Times Roman
++ 1 Times Italic
++ 2 Times Bold
++ 3 Times Bold Italic
++ 4 AvantGarde Book
++ 5 AvantGarde Book Oblique
++ 6 AvantGarde Demi
++ 7 AvantGarde Demi Oblique
++ 8 Bookman Light
++ 9 Bookman Light Italic
++10 Bookman Demi
++11 Bookman Demi Italic
++12 Courier
++13 Courier Oblique
++14 Courier Bold
++15 Courier Bold Oblique
++16 Helvetica
++17 Helvetica Oblique
++18 Helvetica Bold
++19 Helvetica Bold Oblique
++20 Helvetica Narrow
++21 Helvetica Narrow Oblique
++22 Helvetica Narrow Bold
++23 Helvetica Narrow Bold Oblique
++24 New Century Schoolbook Roman
++25 New Century Schoolbook Italic
++26 New Century Schoolbook Bold
++27 New Century Schoolbook Bold Italic
++28 Palatino Roman
++29 Palatino Italic
++30 Palatino Bold
++31 Palatino Bold Italic
++32 Symbol
++33 Zapf Chancery Medium Italic
++34 Zapf Dingbats
++.fi
++
++.PP
+ Normally, the distance between text is 12 points. If you're using larger
+ text to label objects, this should be set to an appropriate larger value.
+ This can be done using the
diff --git a/print/pic2fig/files/patch-ag b/print/pic2fig/files/patch-ag
new file mode 100644
index 00000000000..a5de3d18338
--- /dev/null
+++ b/print/pic2fig/files/patch-ag
@@ -0,0 +1,19 @@
+--- picl.c.orig Wed Apr 3 10:27:34 2002
++++ picl.c Wed Apr 3 10:29:53 2002
+@@ -17,7 +17,7 @@
+ int yymorfg;
+ extern char *yysptr, yysbuf[];
+ int yytchar;
+-FILE *yyin = {stdin}, *yyout = {stdout};
++FILE *yyin, *yyout;
+ extern int yylineno;
+ struct yysvf {
+ struct yywork *yystoff;
+@@ -40,7 +40,6 @@
+ #include "pic.h"
+ # include "picy.h"
+
+-extern float atof();
+ extern char *filename;
+ extern int synerr;
+
diff --git a/print/pic2fig/files/patch-ah b/print/pic2fig/files/patch-ah
new file mode 100644
index 00000000000..0f790a48236
--- /dev/null
+++ b/print/pic2fig/files/patch-ah
@@ -0,0 +1,69 @@
+--- plfig.c.orig Tue Jul 5 09:21:25 1988
++++ plfig.c Wed Apr 3 10:27:15 2002
+@@ -121,7 +121,48 @@
+ htrue = vtrue = 0;
+ }
+
+-troff(s) /* handle ".ps n" to set the pen size to "n" pixels */
++/* handle ".ps n" to set the pen size to "n" pixels */
++/* handle ".ft n" to set the output font to number n
++ (.ft value)
++ -1 Default font
++ 0 Times Roman
++ 1 Times Italic
++ 2 Times Bold
++ 3 Times Bold Italic
++ 4 AvantGarde Book
++ 5 AvantGarde Book Oblique
++ 6 AvantGarde Demi
++ 7 AvantGarde Demi Oblique
++ 8 Bookman Light
++ 9 Bookman Light Italic
++ 10 Bookman Demi
++ 11 Bookman Demi Italic
++ 12 Courier
++ 13 Courier Oblique
++ 14 Courier Bold
++ 15 Courier Bold Oblique
++ 16 Helvetica
++ 17 Helvetica Oblique
++ 18 Helvetica Bold
++ 19 Helvetica Bold Oblique
++ 20 Helvetica Narrow
++ 21 Helvetica Narrow Oblique
++ 22 Helvetica Narrow Bold
++ 23 Helvetica Narrow Bold Oblique
++ 24 New Century Schoolbook Roman
++ 25 New Century Schoolbook Italic
++ 26 New Century Schoolbook Bold
++ 27 New Century Schoolbook Bold Italic
++ 28 Palatino Roman
++ 29 Palatino Italic
++ 30 Palatino Bold
++ 31 Palatino Bold Italic
++ 32 Symbol
++ 33 Zapf Chancery Medium Italic
++ 34 Zapf Dingbats
++*/
++
++troff(s)
+ char *s;
+ {
+ if (strncmp (s, ".ps", 3) == 0) {
+@@ -131,6 +172,16 @@
+ pensize (size);
+ else
+ fprintf (stderr, "Malformed .ps command: %s\n", s);
++ return;
++ }
++ if (strncmp (s, ".ft", 3) == 0) {
++ int size;
++ extern int font;
++
++ if (sscanf (s + 3, " %d ", &size) == 1)
++ font = size;
++ else
++ fprintf (stderr, "Malformed .ft command: %s\n", s);
+ return;
+ }
+