This patch file should be applied (using the "patch" program) to TransFig 3.2.3 to bring it up to version 3.2.3b. Note that there is no version 3.2.3a of TransFig diff -rc transfig.3.2.3/CHANGES transfig.3.2.3b/CHANGES *** transfig.3.2.3/CHANGES Thu Jan 13 19:54:15 2000 --- transfig.3.2.3b/CHANGES Fri Jul 14 10:19:49 2000 *************** *** 3,14 **** Version 3.2 =============================================================================== Patchlevel 3 (Jan 14, 2000) [N.B. There was no transfig/fig2dev 3.2 patchlevel 2] NEW FEATURES o Adapted the transfig manual from LaTeX 2.09 to LaTeX 2e and uses ! Times/Helvetica/Courier instead of Computer Modern fonts. From Roland Rosenfeld (roland@spinnaker.de) o If DBM file for RGB databse does not exist, read "rgb.txt" instead. o If a file such as /usr/local/lib/fig2dev/A3.ps exists, insert it --- 3,85 ---- Version 3.2 =============================================================================== + Patchlevel 3b (July 19, 2000) + + N.B. There was no transfig 3.2.3a - I want to keep the release number identical + to that of the corresponding xfig. + + NEW FEATURES + o X11 Color database ASCII file (/usr/lib/X11/rgb.txt) is now used, + removing the need for the dbm_xxx functions. + o The \special code for colors in genlatex (LaTeX driver) replaced with + the \color code to be compatible with pdflatex and not require dvips + From Klaus Guntermann (guntermann@iti.informatik.tu-darmstadt.de) + o PCX image reader now handles 24-bit color which means that TIFF images + (which are converted to PCX first) may also be 24-bit + + BUGS FIXED + o Explicitely sets color to black before importing eps file in case that + file doesn't select a color + o Changed error message in epic driver from "Unknown style" to "Only + solid, dashed, and dotted line styles supported by epic(eepic)" + o Apostrophes (') in text are now escaped in CGM driver + from David Billinghurst (David.Billinghurst@riotinto.com.au) + o One of the header values for TIFF files was incorrect (was "DD", + should be "II") + o -f (font) option wasn't parsed correctly, which caused segfault + o Bug in handling imported xpm file colors in certain formats + o Multiple variables with same name in different drivers now declared + "static" + o In multi-page mode, redundant "Page: 1 1" was generated + o Unnecessary scaling in the pattern definitions removed (pdf/ps/eps + drivers) + o Total page number calculation was incorrect for multi-page PostScript + output + o Toplevel Imakefile referred to "make" instead of "$(MAKE)" + o Text object read routine had extra variable in scanf + o Error in calculation of arc arrowhead occluding underlying line; could + cause asin domain error + o Possible error in reading imported GIF colormap + o calc_arrow() didn't set nboundpts (number of points in bounding box) + if line having arrowhead had zero length + o Bug in Imakefile - jpeglib.h file couldn't be found for JPEG code if + USEXPM was not enabled. + o "Special" LaTeX text not included in bounding box anymore - this had + caused positioning problems with the LaTeX special text and figure + o "hyphen" was misspelled as "hypen" the character encoding for the + PostScript (and EPS/PDF) driver. + o One of the two TIFF file header types was incorrect + o Segfault when exporting to GIF if Fig file specified "none" for GIF + transparency + o Duplicate JPEG information in fig2dev/Imakefile + o If output from fig2dev was standard output, bitmap export formats + failed because of bad argument to ghostscript + o -P option description for PostScript removed from fig2dev man pages + o Error parsing certain color specs for XPM files + o Tightly curved, wide splines were sometimes "spikey" + o Bounding box wasn't taking arrowhead width(s) into account + o free_text now uses free() instead of less standard cfree() + o Changed last references to sys_errlist to use strerror() + o Bug in referencing imported xbm files in tk driver fixed + o Temporary file not closed before deleting in read_gif() and read_ppm() + o Formatting "%lf" in printf calls should be "%f" + o Prepended $(DESTDIR) to $(XFIGLIBDIR) and $(FIG2DEV_DIR) directory + variables in Imakefile to be portable + o Cleaned up extraneous and erroneous rules in fig2dev/Imakefile + from Pierre Humblet (Pierre.Humblet@eurecom.fr) + o Removed calls to external programs "cat" and "ps2pdf" to make more + portable to Cygwin environment + o fig2dev now uses gunzip instead of uncompress to uncompress .Z files + to be more portable for Cygwin environment + o Papersize sometimes truncated when reading Fig file + + ---------------------------- Patchlevel 3 (Jan 14, 2000) [N.B. There was no transfig/fig2dev 3.2 patchlevel 2] NEW FEATURES o Adapted the transfig manual from LaTeX 2.09 to LaTeX 2e and uses ! Times/Helvetica/Courier instead of Computer Modern fonts. From Roland Rosenfeld (roland@spinnaker.de) o If DBM file for RGB databse does not exist, read "rgb.txt" instead. o If a file such as /usr/local/lib/fig2dev/A3.ps exists, insert it *************** *** 32,38 **** o The default is now to compile for DVIPS o Arc-boxes available for LaTeX now from C. Scott Ananian ! o New import picture formats supported - TIFF and PPM BUGS FIXED o clipping and background filling incorrect for some Postscript/EPS --- 103,109 ---- o The default is now to compile for DVIPS o Arc-boxes available for LaTeX now from C. Scott Ananian ! o New import picture formats supported - TIFF and PPM BUGS FIXED o clipping and background filling incorrect for some Postscript/EPS *************** *** 70,82 **** those systems which don't have it (it is defined to use memset) o didn't include "pi.h" in dev/gentk.c for machines that don't have M_PI o Moved JPEGLIBDIR and JPEGINCDIR definition closer to the top in the ! fig2dev/Imakefile o Output to GIF, JPEG, etc. (bitmap formats) didn't work properly if the destination was stdout o "make install" changed because some systems' install program can only take one file at a time o Added a "newpath" command after the initial clip command for PostScript ! output just in case an object is drawn without a preceding newpath o M_2PI was redefined without first being #undef'd o the "-" character in Fig files should really be a hyphen, not a dash as it was encoded for PostScript output. This is fixed thanks to info --- 141,153 ---- those systems which don't have it (it is defined to use memset) o didn't include "pi.h" in dev/gentk.c for machines that don't have M_PI o Moved JPEGLIBDIR and JPEGINCDIR definition closer to the top in the ! fig2dev/Imakefile o Output to GIF, JPEG, etc. (bitmap formats) didn't work properly if the destination was stdout o "make install" changed because some systems' install program can only take one file at a time o Added a "newpath" command after the initial clip command for PostScript ! output just in case an object is drawn without a preceding newpath o M_2PI was redefined without first being #undef'd o the "-" character in Fig files should really be a hyphen, not a dash as it was encoded for PostScript output. This is fixed thanks to info *************** *** 177,183 **** several places in genepic.c draw_arrow_head is called with unconverted coordinates, which leads to totally displaced arrows. from Heiko Schroeder (heiko@linux.local.de) ! o cleanup of dictionary wrapped around imported EPS files from Franz Koch (franz.koch@zdv.uni-tuebingen.de) o pic output didn't produce dashed or dotted arc o metric flag incorrectly parsed --- 248,254 ---- several places in genepic.c draw_arrow_head is called with unconverted coordinates, which leads to totally displaced arrows. from Heiko Schroeder (heiko@linux.local.de) ! o cleanup of dictionary wrapped around imported EPS files from Franz Koch (franz.koch@zdv.uni-tuebingen.de) o pic output didn't produce dashed or dotted arc o metric flag incorrectly parsed *************** *** 205,215 **** NEW FEATURES o multi-page, paper size, magnification and transparent color stored in Fig ! file now. (transparent color is only used by xfig when exporting to GIF format) o comment that Redhat Linux users may have to change DBMLIB to -ldb in fig2dev/Imakefile ! o figures in landscape are only rotated when showpage command is NOT used (-P). This is because it doesn't need to be rotated for EPS, o previous spline models (interpolated splines and approximated splines) are replaced by one single model (x-splines) which allows the user to mix --- 276,286 ---- NEW FEATURES o multi-page, paper size, magnification and transparent color stored in Fig ! file now. (transparent color is only used by xfig when exporting to GIF format) o comment that Redhat Linux users may have to change DBMLIB to -ldb in fig2dev/Imakefile ! o figures in landscape are only rotated when showpage command is NOT used (-P). This is because it doesn't need to be rotated for EPS, o previous spline models (interpolated splines and approximated splines) are replaced by one single model (x-splines) which allows the user to mix *************** *** 244,250 **** The old restriction is not needed because the epsfig package is required to include ps_tex_t files anyway. o new line types - Dash-dot (_.) Dash-dot-dot (_..) and Dash-dot-dot-dot (_...) ! o new paper sizes: "Tabloid", "Ledger", "B", "C", "D", "E", "A0", "A1", "A2", "A3", "A4" and "B5". See man fig2dev (-z option) for sizes in inches and cm --- 315,321 ---- The old restriction is not needed because the epsfig package is required to include ps_tex_t files anyway. o new line types - Dash-dot (_.) Dash-dot-dot (_..) and Dash-dot-dot-dot (_...) ! o new paper sizes: "Tabloid", "Ledger", "B", "C", "D", "E", "A0", "A1", "A2", "A3", "A4" and "B5". See man fig2dev (-z option) for sizes in inches and cm *************** *** 320,326 **** o recursion bug fixed where run-time would increase exponentially with nesting of compound objects o %%BeginDocument:/EndDocument now surrounds imported EPS files ! o open arrowheads on arcs were overwritten by arc lines o bug in pattern fill code which made patterns appear solid black when using dvips Thanks to Tomas Rokicki (rokicki@CS.Stanford.EDU) for finding the fix --- 391,397 ---- o recursion bug fixed where run-time would increase exponentially with nesting of compound objects o %%BeginDocument:/EndDocument now surrounds imported EPS files ! o open arrowheads on arcs were overwritten by arc lines o bug in pattern fill code which made patterns appear solid black when using dvips Thanks to Tomas Rokicki (rokicki@CS.Stanford.EDU) for finding the fix *************** *** 340,346 **** Add -DNFSS to DEFINES list to use NFSS2 font selection for LaTeX texts Add -DEPSF to DEFINES list to use epsfig macros as distributed w/ LaTeX2e ! Hint: Users of LaTeX2e will probably want to include both of these options; users of LaTeX 2.09 will probably want to include neither. --- 411,417 ---- Add -DNFSS to DEFINES list to use NFSS2 font selection for LaTeX texts Add -DEPSF to DEFINES list to use epsfig macros as distributed w/ LaTeX2e ! Hint: Users of LaTeX2e will probably want to include both of these options; users of LaTeX 2.09 will probably want to include neither. *************** *** 392,398 **** o NOTE: An error in xfig version 3.0.0 incorrectly positioned objects on the canvas when reading older fig files. New objects entered with 3.0 are ! correctly positioned. I apologize for the inconvenience. ***** This is the only reason why the file protocol number has changed. --- 463,469 ---- o NOTE: An error in xfig version 3.0.0 incorrectly positioned objects on the canvas when reading older fig files. New objects entered with 3.0 are ! correctly positioned. I apologize for the inconvenience. ***** This is the only reason why the file protocol number has changed. *************** *** 509,517 **** o specifing nonexistant font with -f caused coredump from Gordon W. Ross (gwr@jericho.mc.com) o newpath command given before EPS object for PostScript output ! o moved definition of SetFigFont to better place from Bernd Raichle (raichle@isr.uni-stuttgart.de) ! o #included sys/types for BSD4_3 systems in genps.c o bug in eepic output - SetFigFont was being defined inside a \put from Vivek Khera (khera@cs.duke.edu) o BoundingBox for EPS objects can be floating values --- 580,588 ---- o specifing nonexistant font with -f caused coredump from Gordon W. Ross (gwr@jericho.mc.com) o newpath command given before EPS object for PostScript output ! o moved definition of SetFigFont to better place from Bernd Raichle (raichle@isr.uni-stuttgart.de) ! o #included sys/types for BSD4_3 systems in genps.c o bug in eepic output - SetFigFont was being defined inside a \put from Vivek Khera (khera@cs.duke.edu) o BoundingBox for EPS objects can be floating values *************** *** 519,525 **** o distribution version of fig2dev/dev/Makefile had (def_)setfigfont.c instead of (def_)setfigfont.o in LIBOBJS definition o SUBDIR fig2dev/dev was missing from top-level Imakefile caused problems ! where make would say something like "No rule to make target dev/libtransfig.a" --------------------------------------------------------------------------- --- 590,596 ---- o distribution version of fig2dev/dev/Makefile had (def_)setfigfont.c instead of (def_)setfigfont.o in LIBOBJS definition o SUBDIR fig2dev/dev was missing from top-level Imakefile caused problems ! where make would say something like "No rule to make target dev/libtransfig.a" --------------------------------------------------------------------------- *************** *** 536,546 **** to "%!PS-Adobe-2.0 EPSF-2.0" which allows FrameMaker and ghostview to read them properly. from Vivek Khera (khera@cs.duke.edu) ! o check for #ifdef SYSV to include string.h instead of strings.h in fig2dev/dev/genibmgl.c ! o changed EXTRA_LIBRARIES to SYS_LIBRARIES in fig2dev/Imakefile so wouldn't clobber system-dependent flags in EXTRA_LIBRARIES ! o fprintf and 'else' missing from genepic which caused incorrect information to be generated when drawing arcs using epic output o removed dependencies on the X libraries (Imakefiles and Makefiles) o SGI machines had trouble with hypot() which caused arrow heads to mess up --- 607,617 ---- to "%!PS-Adobe-2.0 EPSF-2.0" which allows FrameMaker and ghostview to read them properly. from Vivek Khera (khera@cs.duke.edu) ! o check for #ifdef SYSV to include string.h instead of strings.h in fig2dev/dev/genibmgl.c ! o changed EXTRA_LIBRARIES to SYS_LIBRARIES in fig2dev/Imakefile so wouldn't clobber system-dependent flags in EXTRA_LIBRARIES ! o fprintf and 'else' missing from genepic which caused incorrect information to be generated when drawing arcs using epic output o removed dependencies on the X libraries (Imakefiles and Makefiles) o SGI machines had trouble with hypot() which caused arrow heads to mess up *************** *** 547,560 **** from Malcolm Davis (davis@nod.bms.com) o Flipped EPS objects were incorrectly flipped on output from Brian Boyter (boyter@pyrdc.va.pyramid.com) ! o POLYLINES were being drawn in sections (10 points per section) which ! resulted in incorrect dashed line lengths and only one section filled if area fill was on from Peter Egelberg (egel@neural.se) o added Sequent machines and Suns with SunOs < 4.1 to list of machines that don't have strstr() from Scott Erikson (sources@ics.uci.edu) ! o removed PATCHLEVEL from patchlevel.h file - version number is complete with three parts (e.g. 2.1.6) o removed "extern coord_system" from fig2dev.h (wasn't used by fig2dev) o SPECIAL_CHAR split into three strings for systems which can't handle one --- 618,631 ---- from Malcolm Davis (davis@nod.bms.com) o Flipped EPS objects were incorrectly flipped on output from Brian Boyter (boyter@pyrdc.va.pyramid.com) ! o POLYLINES were being drawn in sections (10 points per section) which ! resulted in incorrect dashed line lengths and only one section filled if area fill was on from Peter Egelberg (egel@neural.se) o added Sequent machines and Suns with SunOs < 4.1 to list of machines that don't have strstr() from Scott Erikson (sources@ics.uci.edu) ! o removed PATCHLEVEL from patchlevel.h file - version number is complete with three parts (e.g. 2.1.6) o removed "extern coord_system" from fig2dev.h (wasn't used by fig2dev) o SPECIAL_CHAR split into three strings for systems which can't handle one *************** *** 570,574 **** o changed header for postscript files from "%!" to "%!PS-Adobe-2.0" when using -P (showpage) option and "%!PS-Adobe-2.0 EPSF" otherwise (Encapsulated) o corrupt transfig/Imakefile and typo (SCRS instead of SRCS) ! o some variables (cur_thickness and coord_system) were multiply defined in various drivers in fig2dev/dev - made those static --- 641,645 ---- o changed header for postscript files from "%!" to "%!PS-Adobe-2.0" when using -P (showpage) option and "%!PS-Adobe-2.0 EPSF" otherwise (Encapsulated) o corrupt transfig/Imakefile and typo (SCRS instead of SRCS) ! o some variables (cur_thickness and coord_system) were multiply defined in various drivers in fig2dev/dev - made those static diff -rc transfig.3.2.3/Imakefile transfig.3.2.3b/Imakefile *** transfig.3.2.3/Imakefile Mon Jan 3 10:33:52 2000 --- transfig.3.2.3b/Imakefile Wed Apr 12 09:15:18 2000 *************** *** 40,46 **** transfig.man:: doc/transfig.1 -ln -s ../doc/transfig.1 transfig.man ! cd doc/manual; make; latex manual; latex manual clean:: ! cd doc/manual; make clean --- 40,46 ---- transfig.man:: doc/transfig.1 -ln -s ../doc/transfig.1 transfig.man ! cd doc/manual; $(MAKE); latex manual; latex manual clean:: ! cd doc/manual; $(MAKE) clean diff -rc transfig.3.2.3/README transfig.3.2.3b/README *** transfig.3.2.3/README Thu Jan 13 19:56:09 2000 --- transfig.3.2.3b/README Fri Jul 14 10:37:08 2000 *************** *** 1,5 **** - Announcing the release of TransFig version 3.2.3 January 14, 2000 - TransFig is a set of tools for creating TeX documents with graphics which are portable, in the sense that they can be printed in a wide variety of environments. --- 1,3 ---- *************** *** 47,131 **** 5. Do a "make install" to install them in the system 6. Do a "make install.man" to put the manual pages in the proper directories ! Uncomment the USELATEX2E flag in the transfig/Imakefile file to use the ! \\usepackage{} command for LaTeX2e. ! The default is to use \\documentstyle{} for LaTeX209. ! ! In fig2dev/Imakefile for the described features: ! Comment out the DDNFSS = ... line if you don't want NFSS2 font selection ! for LaTeX texts. ! Comment out the DDLATEX2E_GRAPHICS = ... line if you don't want to use the ! standard graphics package distributed w/ LaTeX2e. ! UNcomment the DDEPSFIG = ... line if you want to use the deprecated epsfig macros ! distributed w/ LaTeX2e (DDLATEX2E_GRAPHICS must also be defined). Hint: Users of LaTeX2e will probably want to include both of these options; users of LaTeX 2.09 will probably want to include neither. ! If your system doesn't have strcasecmp() and/or strncasecmp(), uncomment the ! lines in the Imakefile with HAVE_NO_STRCASECMP and HAVE_NO_STRNCASECMP. ! If your system doesn't have strstr(3) uncomment the "#define NOSTRSTR" ! ---------------------------------------------------------------------------- *************** IMPORTANT NOTE: ! As of version 3.2.0 (final), fig2dev has taken over the translating of Fig ! to the bitmap formats (ACAD, GIF, JPEG, XPM, XBM, PCX, TIFF). ! In the past, xfig itself rendered the bitmap formats. This change was made ! to have a more consistent look and better fonts. First, the Fig file is ! translated to PostScript, then ghostscript is used to render the image to ! the final format in the case of JPEG, PCX and TIFF, or to PPM (portable ! pixmap) after which the appropriate ppmtoXXX filter is used to get ACAD, GIF, ! XPM and XBM. If smoothing is done (-S option) when jpeg output is used, the ! "cjpeg" program must be installed from the jpeg package. This is done ! automatically when you "make" TransFig or fig2dev. ! ! You need the netpbm package of March 1994 (or later), which you can find on ! ftp.x.org in /contrib/utilities or on ftp.cdrom.com in ! /pub/X11/contrib/utilities. ! ! You will also need ghostscript, which can be found on ftp.cs.wisc.edu in ! /ghost/aladdin, *AND* it must be compiled with the pcx256, jpeg, png256, ppmraw ! and tiff24nc drivers. ! *************** ! ---------------------------------------------------------------------------- ! Make sure that you point XFIGLIBDIR to the same directory that xfig uses ! (usually /usr/local/lib/xfig). This will be used to hold the bitmaps directory ! for the tk fill patterns. ! ---------------------------------------------------------------------------- ! If you have NOT installed the JPEG library in your system library area, comment ! out the USEINSTALLEDJPEG in fig2dev/Imakefile variable, change the JPEGLIBDIR ! variable to the directory where your JPEG library resides and change the ! JPEGINCDIR to the directory where your JPEG header files (include) reside. ! You must have version 5b or newer of the JPEG library. ! ! The JPEG library is available from several places. The official archive site ! is ftp.uu.net in /graphics/jpeg. ! Another site is ftp.x.org in /contrib/libraries. ! ! If you don't want to be able to import JPEG images in your Fig files at all ! then comment out the "#define USEJPEG" line in the fig2dev/Imakefile. ! ---------------------------------------------------------------------------- ! If you want to be able to translate Fig files that have imported XPM files ! (color pixmaps) uncomment the "#define USEXPM" line in fig2dev/Imakefile. ! You need version 3.4c or newer of the XPM package. ! This is available from ftp.x.org in /contrib/libraries. ! ---------------------------------------------------------------------------- ! Uncomment the "DBMLIB = -lgdbm" in fig2dev/Imakefile if your dbm routines are ! in their own library. ! For the Redhat distributions of Linux you may have to change DBMLIB to -ldb. ! For some Linuxes you may need to change it to "DBMLIB = -ldbm". ! Slackware Linuxes use -lgdbm. ! ---------------------------------------------------------------------------- ! If your system has the strerror() function (doesn't have sys_errlist) then ! comment out NEED_STRERROR with an XCOMM comment. ! ---------------------------------------------------------------------------- ! Look in the Imakefiles to see if any options are relevant to your system. ! ---------------------------------------------------------------------------- ! ** If you use epic, eepic or tpic you must have compiled your dvips and xvdi ! ** with the tpic support (-DTPIC for dvips). ************************************************************************* Please send email about any questions/bug fixes/contributions etc. about --- 45,126 ---- 5. Do a "make install" to install them in the system 6. Do a "make install.man" to put the manual pages in the proper directories ! o Uncomment the USELATEX2E flag in the transfig/Imakefile file to use the ! \\usepackage{} command for LaTeX2e. ! The default is to use \\documentstyle{} for LaTeX209. ! ! o In fig2dev/Imakefile for the described features: ! ! o Comment out the DDNFSS = ... line if you don't want NFSS2 font selection ! for LaTeX texts. ! o Comment out the DDLATEX2E_GRAPHICS = ... line if you don't want to use the ! standard graphics package distributed w/ LaTeX2e. ! o UNcomment the DDEPSFIG = ... line if you want to use the deprecated epsfig macros ! distributed w/ LaTeX2e (DDLATEX2E_GRAPHICS must also be defined). Hint: Users of LaTeX2e will probably want to include both of these options; users of LaTeX 2.09 will probably want to include neither. ! o If your system doesn't have strcasecmp() and/or strncasecmp(), uncomment the ! lines in the Imakefile with HAVE_NO_STRCASECMP and HAVE_NO_STRNCASECMP. ! ! o If your system doesn't have strstr(3) uncomment the "#define NOSTRSTR" ! ! o Make sure that you point XFIGLIBDIR to the same directory that xfig uses ! (usually /usr/local/lib/xfig). This will be used to hold the bitmaps ! directory for the tk fill patterns. ! ! o If you have NOT installed the JPEG library in your system library area, ! comment out the USEINSTALLEDJPEG in fig2dev/Imakefile variable, change the ! JPEGLIBDIR variable to the directory where your JPEG library resides and ! change the JPEGINC to the directory where your JPEG header files (include) ! reside. You must have version 5b or newer of the JPEG library. ! ! The JPEG library is available from several places. The official archive site ! is ftp.uu.net in /graphics/jpeg. ! Another site is ftp.x.org in /contrib/libraries. ! ! o If you don't want to be able to import JPEG images in your Fig files at all ! then comment out the "#define USEJPEG" line in the fig2dev/Imakefile. ! o If you want to be able to translate Fig files that have imported XPM files ! (color pixmaps) uncomment the "#define USEXPM" line in fig2dev/Imakefile. ! You need version 3.4c or newer of the XPM package. ! This is available from ftp.x.org in /contrib/libraries. ! o If your system has the strerror() function (doesn't have sys_errlist) then ! comment out NEED_STRERROR with an XCOMM comment. ! ! o If your system can open files in text and binary modes and has the setmode() ! function, uncomment HAVE_SETMODE. This probably only applies to Windows 9x/NT ! systems. ! ! o Look in the Imakefiles to see if any options are relevant to your system. ! ! o If you use epic, eepic or tpic you must have compiled your dvips and xvdi ! with the tpic support (-DTPIC for dvips). ! *************** IMPORTANT NOTE: ! o As of version 3.2.0 (final), fig2dev has taken over the translating of Fig ! to the bitmap formats (ACAD, GIF, JPEG, XPM, XBM, PCX, TIFF). ! In the past, xfig itself rendered the bitmap formats. This change was made ! to have a more consistent look and better fonts. First, the Fig file is ! translated to PostScript, then ghostscript is used to render the image to ! the final format in the case of JPEG, PCX and TIFF, or to PPM (portable ! pixmap) after which the appropriate ppmtoXXX filter is used to get ACAD, GIF, ! XPM and XBM. If smoothing is done (-S option) when jpeg output is used, the ! "cjpeg" program must be installed from the jpeg package. This is done ! automatically when you "make" TransFig or fig2dev. ! ! o You need the netpbm package of March 1994 (or later), which you can find ! at ftp://ftp.x.org/contrib/utilities or ! at ftp://ftp.cdrom.com/pub/X11/contrib/utilities. ! ! o You will also need ghostscript, which can be found on ftp.cs.wisc.edu in ! /ghost/aladdin, *AND* it must be compiled with the pcx256, jpeg, png256, ! ppmraw and tiff24nc drivers. ************************************************************************* Please send email about any questions/bug fixes/contributions etc. about diff -rc transfig.3.2.3/doc/fig2dev.1 transfig.3.2.3b/doc/fig2dev.1 *** transfig.3.2.3/doc/fig2dev.1 Thu Jan 13 19:51:10 2000 --- transfig.3.2.3b/doc/fig2dev.1 Fri Jul 14 10:20:10 2000 *************** *** 1,4 **** ! .TH FIG2DEV 1 "Version 3.2.3 Jan 14, 2000" .SH NAME fig2dev \- translates Fig code to various graphics languages --- 1,4 ---- ! .TH FIG2DEV 1 "Version 3.2.3b July 19, 2000" .SH NAME fig2dev \- translates Fig code to various graphics languages *************** *** 10,16 **** .B \-m .I mag ] [ ! .B \-f .I font ] [ .B \-s --- 10,16 ---- .B \-m .I mag ] [ ! .B \-f .I font ] [ .B \-s *************** *** 24,30 **** .I Fig2dev translates fig code in the named .I fig-file ! into the specified graphics .I language and puts them in .I out-file. --- 24,30 ---- .I Fig2dev translates fig code in the named .I fig-file ! into the specified graphics .I language and puts them in .I out-file. *************** *** 35,43 **** are standard input and standard output, respectively .LP Xfig (Facility for Interactive Generation of figures) is a screen-oriented ! tool which runs under the X Window System, and allows the user to draw and manipulate objects interactively. ! This version of fig2dev is compatible with xfig versions 1.3, 1.4, 2.0, 2.1, 3.0, 3.1 and 3.2. .LP Xfig version 3.2.3 and later saves and allows the user to edit comments --- 35,43 ---- are standard input and standard output, respectively .LP Xfig (Facility for Interactive Generation of figures) is a screen-oriented ! tool which runs under the X Window System, and allows the user to draw and manipulate objects interactively. ! This version of fig2dev is compatible with xfig versions 1.3, 1.4, 2.0, 2.1, 3.0, 3.1 and 3.2. .LP Xfig version 3.2.3 and later saves and allows the user to edit comments *************** *** 50,56 **** .B \-L Set the output graphics language. Valid languages are ! \fBbox, cgm, epic, eepic, eepicemu, eps, gif, ibmgl, jpeg, latex, map (HTML image map), mf (METAFONT), pcx, pdf, pic, pictex, png, ppm, ps, pstex, pstex_t, sld (AutoCad slide format), textyl, \fR tiff, tk (tcl/tk), tpic, xbm and --- 50,56 ---- .B \-L Set the output graphics language. Valid languages are ! \fBbox, cgm, epic, eepic, eepicemu, eps, gif, ibmgl, jpeg, latex, map (HTML image map), mf (METAFONT), pcx, pdf, pic, pictex, png, ppm, ps, pstex, pstex_t, sld (AutoCad slide format), textyl, \fR tiff, tk (tcl/tk), tpic, xbm and *************** *** 70,82 **** .TP .B \-h Print help message with all options for all output languages. .TP ! .B \-m Set the magnification at which the figure is rendered to .I mag. The default is 1.0. .TP ! .B \-f Set the default font used for text objects to .I font. The default is Roman; the format of this option depends on the graphics --- 70,84 ---- .TP .B \-h Print help message with all options for all output languages. + .TP ! .B "\-m mag" Set the magnification at which the figure is rendered to .I mag. The default is 1.0. + .TP ! .B "\-f font" Set the default font used for text objects to .I font. The default is Roman; the format of this option depends on the graphics *************** *** 85,99 **** In TeX-based languages, the font is the base of the name given in lfonts.tex, for instance "cmr" for Roman, or "tt" for teletype. In PostScript, it is any font name known to the printer or interpreter. .TP ! .B \-s Set the default font size (in points) for text objects to .I fsize. The default is 11*mag, and thus is scaled by the \fB-m\fR option. If there is no scaling, the default font is eleven point Roman." .TP .B \-V Print the program version number only. .TP .I other options The other options are specific to the choice of graphics --- 87,104 ---- In TeX-based languages, the font is the base of the name given in lfonts.tex, for instance "cmr" for Roman, or "tt" for teletype. In PostScript, it is any font name known to the printer or interpreter. + .TP ! .B "\-s size" Set the default font size (in points) for text objects to .I fsize. The default is 11*mag, and thus is scaled by the \fB-m\fR option. If there is no scaling, the default font is eleven point Roman." + .TP .B \-V Print the program version number only. + .TP .I other options The other options are specific to the choice of graphics *************** *** 106,120 **** other products can import this format .I and display it on the screen, something that they won't do with EPS files that have an ASCII preview. .TP .B \-r Position arrowheads for CGM viewers that display rounded arrowheads. Normally, arrowheads are pointed, so fig2dev compensates for this by ! moving the endpoint of the line back so the tip of the arrowhead ends where the original endpoint of the line was. If the \fB-r\fR option is used, the position of arrows will \fINOT\fR be corrected for compensating line width effects, ! because the rounded arrowhead doesn't extend beyond the endpoint of the line. .SH EPIC OPTIONS EPIC is an enhancement to LaTeX picture drawing environment. It was developed by Sunil Podar of Department of Computer Science --- 111,126 ---- other products can import this format .I and display it on the screen, something that they won't do with EPS files that have an ASCII preview. + .TP .B \-r Position arrowheads for CGM viewers that display rounded arrowheads. Normally, arrowheads are pointed, so fig2dev compensates for this by ! moving the endpoint of the line back so the tip of the arrowhead ends where the original endpoint of the line was. If the \fB-r\fR option is used, the position of arrows will \fINOT\fR be corrected for compensating line width effects, ! because the rounded arrowhead doesn't extend beyond the endpoint of the line. .SH EPIC OPTIONS EPIC is an enhancement to LaTeX picture drawing environment. It was developed by Sunil Podar of Department of Computer Science *************** *** 126,131 **** --- 132,138 ---- Computer Science at University of California, Davis. .LP EEPIC-EMU is an EEPIC emulation package which does not use tpic specials. + .TP .B \-A Scale arrowheads by *************** *** 138,151 **** double the size of .I TeX arrowheads. .TP .B \-l ! Use "\fB\\thicklines\fR" when width of the line is wider than .I lwidth. The default is 2. .TP .B \-v Include comments in the output file. .TP .B \-P Generate a complete LaTeX file. In other words, the output file can be --- 145,161 ---- double the size of .I TeX arrowheads. + .TP .B \-l ! Use "\fB\\thicklines\fR" when width of the line is wider than .I lwidth. The default is 2. + .TP .B \-v Include comments in the output file. + .TP .B \-P Generate a complete LaTeX file. In other words, the output file can be *************** *** 152,172 **** formatted without requiring any changes. The additional text inserted in the beginning and at the end of the file is controlled by the configuration parameter "Preamble" and "Postamble". .TP .B \-S Set the scale to which the figure is rendered. ! This option automatically sets the .I magnification and size to .I scale ! / 12 and .I scale respectively. .TP .B \-W Enable variable line width. By default, only two line widths are available: The normal line width (\thinlines), and thick ! lines (\thicklines), if a line width of more than one is selected in xfig. .TP .B \-w Disable variable line width. Only "\fB\\thicklines\fR" and/or --- 162,185 ---- formatted without requiring any changes. The additional text inserted in the beginning and at the end of the file is controlled by the configuration parameter "Preamble" and "Postamble". + .TP .B \-S Set the scale to which the figure is rendered. ! This option automatically sets the .I magnification and size to .I scale ! / 12 and .I scale respectively. + .TP .B \-W Enable variable line width. By default, only two line widths are available: The normal line width (\thinlines), and thick ! lines (\thicklines), if a line width of more than one is selected in xfig. ! .TP .B \-w Disable variable line width. Only "\fB\\thicklines\fR" and/or *************** *** 188,200 **** --- 201,216 ---- .SH IBM-GL OPTIONS IBM-GL (International Business Machines Graphics Language) is compatible with HP-GL (Hewlett-Packard Graphics Language). + .TP .B \-a Select ISO A4 (ANSI A) paper size if the default is ANSI A (ISO A4) paper size. + .TP .B \-c Generate instructions for an IBM 6180 Color Plotter with (without) an IBM Graphics Enhancement Cartridge (IBM-GEC). + .TP .B \-d Restrict plotting to a rectangular area of the plotter paper which has *************** *** 205,210 **** --- 221,227 ---- All four numbers are in inches and follow \fB-d\fR in a comma-sparated list - .I xll,yll,xur,yur - with no spaces between them. + .TP .B \-f Load text character specifications from the table in the *************** *** 218,223 **** --- 235,241 ---- 3.) character slant angle (degrees), 4.) character width scale factor and 5.) character height scale factor. + .TP .B \-l Load area fill line patterns from the table in the *************** *** 230,240 **** --- 248,260 ---- 3.) fill type (1 - 5), 4.) fill spacing (inches) and 5.) fill angle (degrees). + .TP .B \-m The magnification may appear as the first element in a comma separated list - .I mag,x0,y0 - where the second and third parameters specify an offset in inches. + .TP .B \-p Load plotter pen specifications from the table in the *************** *** 244,257 **** --- 264,280 ---- Each entry consists of 2 numbers which specify the 1.) pen number (1 - 8) and 2.) pen thickness (millimeters). + .TP .B \-P Rotate the figure to portrait mode. The default is landscape mode. + .TP .B \-S Set the pen speed to .I speed (centimeters/second). + .TP .B \-v Plot the figure upside-down in portrait mode or backwards in landscape mode. *************** *** 266,280 **** The \fB-c\fR option selects the alternate instruction set. .SH OPTIONS COMMON TO ALL BITMAP FORMATS .TP .B -b borderwidth ! Make blank border around figure of width .I borderwidth. .TP .B -g color Use .I color for the background. .TP .B -S smoothfactor This will smooth the output by scaling the figure by the --- 289,306 ---- The \fB-c\fR option selects the alternate instruction set. .SH OPTIONS COMMON TO ALL BITMAP FORMATS + .TP .B -b borderwidth ! Make blank border around figure of width .I borderwidth. + .TP .B -g color Use .I color for the background. + .TP .B -S smoothfactor This will smooth the output by scaling the figure by the *************** *** 282,303 **** factor, which forces ghostscript to render the figure at the higher scale to improve font rendering, then passing through pnmscale to reduce to original size, which also smooths the image by averaging colors of adjacent pixels. ! A value of 2 or 3 for .I smoothfactor is reasonable. xfig uses 2 when the "smooth" option is used in the export panel. .SH GIF OPTIONS .TP .B -t color Use .I color for the transparent color in the GIF file. This must be specified ! as a six-digit hexadecimal RGBvalue with the # sign, e.g. #ff0000 (Red). .SH JPEG OPTIONS .TP .B -q image_quality ! use the integer value .I image_quality for the JPEG "Quality" factor. Valid values are 0-100. --- 308,332 ---- factor, which forces ghostscript to render the figure at the higher scale to improve font rendering, then passing through pnmscale to reduce to original size, which also smooths the image by averaging colors of adjacent pixels. ! A value of 2 or 3 for .I smoothfactor is reasonable. xfig uses 2 when the "smooth" option is used in the export panel. .SH GIF OPTIONS + .TP .B -t color Use .I color for the transparent color in the GIF file. This must be specified ! in the same format that ppmmake(1) allows. ! It may allow an X11 color name, but at least you may use ! a six-digit hexadecimal RGBvalue using the # sign, e.g. #ff0000 (Red). .SH JPEG OPTIONS .TP .B -q image_quality ! use the integer value .I image_quality for the JPEG "Quality" factor. Valid values are 0-100. *************** *** 305,311 **** .SH LATEX OPTIONS .TP .B \-l ! Sets the threshold between LaTeX thin and thick lines to .I lwidth pixels. LaTeX supports only two different line width: \\thinlines and \\thicklines. --- 334,340 ---- .SH LATEX OPTIONS .TP .B \-l ! Sets the threshold between LaTeX thin and thick lines to .I lwidth pixels. LaTeX supports only two different line width: \\thinlines and \\thicklines. *************** *** 335,356 **** The fig2dev map output language will produce an HTML image map using Fig objects that have href="some_html_reference" in their comments. Any Fig object except compound objects may used for this. ! Usually, besides generating the map file, you would also generate a GIF file, which is the image to which the map refers. .sp ! For example, you may have an xfig drawing with an imported image that has the comment href="go_here.html" and a box object with a comment href="go_away.html". This will produce an image map file such the user ! may click on the image and the browser will load the "go_here.html" page, or click on the box and the browser will load the "go_away.html" page. .sp ! After the map file is generated by .I fig2dev you will need to edit it to fill out any additional information it may need. .TP .B -b borderwidth ! Make blank border around figure of width .I borderwidth. --- 364,385 ---- The fig2dev map output language will produce an HTML image map using Fig objects that have href="some_html_reference" in their comments. Any Fig object except compound objects may used for this. ! Usually, besides generating the map file, you would also generate a GIF file, which is the image to which the map refers. .sp ! For example, you may have an xfig drawing with an imported image that has the comment href="go_here.html" and a box object with a comment href="go_away.html". This will produce an image map file such the user ! may click on the image and the browser will load the "go_here.html" page, or click on the box and the browser will load the "go_away.html" page. .sp ! After the map file is generated by .I fig2dev you will need to edit it to fill out any additional information it may need. .TP .B -b borderwidth ! Make blank border around figure of width .I borderwidth. *************** *** 359,365 **** scales the figure by 1/8 before generating METAFONT code. The magnification can be further changed with the .B -m ! option or by giving magnification options to .B mf. .LP In order to process the generated METAFONT code, the mfpic macros --- 388,394 ---- scales the figure by 1/8 before generating METAFONT code. The magnification can be further changed with the .B -m ! option or by giving magnification options to .B mf. .LP In order to process the generated METAFONT code, the mfpic macros *************** *** 380,386 **** original figure. The default is 1. .TP .B -t top ! specifies the top of the whole coordinate system. The default is .B ypos. .TP .B -x xneg --- 409,415 ---- original figure. The default is 1. .TP .B -t top ! specifies the top of the whole coordinate system. The default is .B ypos. .TP .B -x xneg *************** *** 389,395 **** .TP .B -y yneg specifies the minumum y coordinate value of the figure (inches). The ! default is 0. .TP .B -X xpos specifies the maximum x coordinate value of the figure (inches). The --- 418,424 ---- .TP .B -y yneg specifies the minumum y coordinate value of the figure (inches). The ! default is 0. .TP .B -X xpos specifies the maximum x coordinate value of the figure (inches). The *************** *** 417,423 **** .br \fBall\fR Use all of the above .br ! \fBpsfont\fR Don't convert Postscript fonts generic type (useful for files going to be Ditroff'ed for and printed on PS printer). DWB-compatible. .br --- 446,452 ---- .br \fBall\fR Use all of the above .br ! \fBpsfont\fR Don't convert Postscript fonts generic type (useful for files going to be Ditroff'ed for and printed on PS printer). DWB-compatible. .br *************** *** 456,464 **** o The centering option is ignored .br o The multiple-page option is ignored ! .br o The paper size option is ignored ! .br o The x/y offset options are ignored .LP The PDF driver uses all the PostScript options. --- 485,493 ---- o The centering option is ignored .br o The multiple-page option is ignored ! .br o The paper size option is ignored ! .br o The x/y offset options are ignored .LP The PDF driver uses all the PostScript options. *************** *** 480,490 **** Filled objects are printed using the given area fill and color. There are 21 "shades" going from black to full saturation of the fill color, and 21 more "tints" from full saturation + 1 to white. ! In addition, there are 16 patterns such as bricks, diagonal lines, crosshatch, etc. .TP .B -b borderwidth ! Make blank border around figure of width .I borderwidth. .TP .B -c --- 509,519 ---- Filled objects are printed using the given area fill and color. There are 21 "shades" going from black to full saturation of the fill color, and 21 more "tints" from full saturation + 1 to white. ! In addition, there are 16 patterns such as bricks, diagonal lines, crosshatch, etc. .TP .B -b borderwidth ! Make blank border around figure of width .I borderwidth. .TP .B -c *************** *** 507,515 **** This option will override the orientation specification in the file (for file versions 3.0 and higher). .br ! This option is only honored when not using the -P option (add showpage). ! This is because the figure doesn't need to be rotated when generating ! Encapsulated PostScript (EPS). .TP .B -M Generate multiple pages if figure exceeds paper size. --- 536,545 ---- This option will override the orientation specification in the file (for file versions 3.0 and higher). .br ! This and the -p (portrait) option are only honored only for PostScript output, ! not Encapsulated PostScript (EPS). ! This is because the figure doesn't need to be rotated when generating (EPS); ! it may be rotated by the program importing the EPS. .TP .B -M Generate multiple pages if figure exceeds paper size. *************** *** 521,533 **** file (for file versions 3.0 and higher). This is the default for Fig files of version 2.1 or lower. .TP - .B -P - indicates that the figure describes a full page which will not - necessarily be inserted into a document, but can be sent directly - to a PS printer. - This ensures that a showpage command is inserted at the end of - the figure. - .TP .B -n name Set the Title part of the PostScript output to .I name. --- 551,556 ---- *************** *** 659,666 **** documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting ! documentation. The authors make no representations about the suitability ! of this software for any purpose. It is provided "as is" without express or implied warranty. .LP THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, --- 682,689 ---- documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting ! documentation. The authors make no representations about the suitability ! of this software for any purpose. It is provided "as is" without express or implied warranty. .LP THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, *************** *** 695,701 **** .br Supoj Sutanthavibul (supoj@sally.utexas.edu) .br ! University of Texas at Austin. .sp MetaFont driver by .br --- 718,724 ---- .br Supoj Sutanthavibul (supoj@sally.utexas.edu) .br ! University of Texas at Austin. .sp MetaFont driver by .br *************** *** 717,722 **** .br Mike Markowski (mm@udel.edu) with a little touch-up by Brian Smith .sp ! The CGM driver (Computer Graphics Metafile) was written by .br Philippe Bekaert (Philippe.Bekaert@cs.kuleuven.ac.be) --- 740,745 ---- .br Mike Markowski (mm@udel.edu) with a little touch-up by Brian Smith .sp ! The CGM driver (Computer Graphics Metafile) was written by .br Philippe Bekaert (Philippe.Bekaert@cs.kuleuven.ac.be) diff -rc transfig.3.2.3/doc/manual/README transfig.3.2.3b/doc/manual/README *** transfig.3.2.3/doc/manual/README Thu Apr 27 16:21:43 1995 --- transfig.3.2.3b/doc/manual/README Fri Jul 14 10:26:13 2000 *************** *** 1,6 **** ! PLEASE NOTE: This guide has not been updated to the current 3.1 file ! protocol. Please refer to the xfig document FORMAT3.1 for a complete ! description. This directory contains a manual which describes TransFig and how to use it. The manual includes TransFig figures, which have been translated into --- 1,4 ---- ! PLEASE NOTE: This guide is hopelessly out of date. This directory contains a manual which describes TransFig and how to use it. The manual includes TransFig figures, which have been translated into diff -rc transfig.3.2.3/doc/transfig.1 transfig.3.2.3b/doc/transfig.1 *** transfig.3.2.3/doc/transfig.1 Thu Jan 13 19:51:33 2000 --- transfig.3.2.3b/doc/transfig.1 Fri Jul 14 10:20:28 2000 *************** *** 1,4 **** ! .TH TRANSFIG 1 "Version 3.2.3 Jan 14, 2000" .SH NAME transfig \- creates a makefile for portable LaTeX figures .SH SYNOPSIS --- 1,4 ---- ! .TH TRANSFIG 1 "Version 3.2.3b July 19, 2000" .SH NAME transfig \- creates a makefile for portable LaTeX figures .SH SYNOPSIS diff -rc transfig.3.2.3/fig2dev/Imakefile transfig.3.2.3b/fig2dev/Imakefile *** transfig.3.2.3/fig2dev/Imakefile Fri Apr 7 10:29:10 2000 --- transfig.3.2.3b/fig2dev/Imakefile Tue Jul 11 15:23:44 2000 *************** *** 24,51 **** XCOMM copies from any such party to do so, with the only requirement being XCOMM that this copyright notice remain intact. XCOMM You should point XFIGLIBDIR to the same directory you did when you compiled XCOMM and installed xfig. This will be made automatic in the future. XFIGLIBDIR = /usr/local/lib/X11/xfig XCOMM If your system has the strerror() function (doesn't have sys_errlist) then XCOMM comment out NEED_STRERROR with an XCOMM comment. NEED_STRERROR = -DNEED_STRERROR ! XCOMM uncomment the following line if your compiler supports 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 XCOMM Change RGB if necessary, to point to your rgb.txt color database XCOMM file (for X11). This is needed for the -g (background color) option. XCOMM ! RGB = $(LIBDIR)/rgb XCOMM Unomment the #define for USEXPM if you want to use the XPM XCOMM (color pixmap) package. XCOMM You need version 3.4c or newer of the XPM package. --- 24,64 ---- XCOMM copies from any such party to do so, with the only requirement being XCOMM that this copyright notice remain intact. + XCOMM ****** XCOMM You should point XFIGLIBDIR to the same directory you did when you compiled XCOMM and installed xfig. This will be made automatic in the future. XFIGLIBDIR = /usr/local/lib/X11/xfig + XCOMM ****** XCOMM If your system has the strerror() function (doesn't have sys_errlist) then XCOMM comment out NEED_STRERROR with an XCOMM comment. NEED_STRERROR = -DNEED_STRERROR ! XCOMM The following probably only applies to Windows 9x/NT: ! XCOMM If your system can open files in text and binary modes and has the ! XCOMM setmode() function, uncomment HAVE_SETMODE ! ! XCOMM HAVE_SETMODE = -DHAVE_SETMODE ! ! XCOMM **************** ! XCOMM Uncomment the following line if your compiler supports 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 + XCOMM **************** XCOMM Change RGB if necessary, to point to your rgb.txt color database XCOMM file (for X11). This is needed for the -g (background color) option. + XCOMM Note that this changed slightly from the previous versions - you need + XCOMM the full name (rgb.txt) now. XCOMM ! RGB = $(LIBDIR)/rgb.txt + XCOMM **************** XCOMM Unomment the #define for USEXPM if you want to use the XPM XCOMM (color pixmap) package. XCOMM You need version 3.4c or newer of the XPM package. *************** *** 61,86 **** XPMINC = -I/usr/include/X11 #endif ! XCOMM For Linux machines or any machines that have a separate library for ! XCOMM the database management routines, uncomment the following line. ! XCOMM For the Redhat distributions of Linux you may have to change DBMLIB to -ldb. ! XCOMM For other Linux versions you may need -ldbm instead of -lgdbm. ! XCOMM Slackware and RedHat Linuxes use -lgdbm. ! ! XCOMM DBMLIB = -lgdbm ! ! XCOMM If your system doesn't have ndbm ("New" database manager) comment the following ! USE_NDBM = -DNDBM ! XCOMM If don't want to use JPEG, comment out the following line #define USEJPEG ! XCOMM If you don't have the jpeg library in your system library area, comment ! XCOMM out the USEINSTALLEDJPEG variable (using XCOMM), change the JPEGLIBDIR ! XCOMM variable to the directory where your jpeg library resides. Do not change ! XCOMM JPEGINCDIR in this case because it must be defined relative to the ! XCOMM fig2dev/dev subdirectory. XCOMM You must have version 5b or newer of the jpeg library. #define USEINSTALLEDJPEG --- 74,90 ---- XPMINC = -I/usr/include/X11 #endif ! XCOMM **************** XCOMM If don't want to use JPEG, comment out the following line #define USEJPEG ! XCOMM **************** ! XCOMM If you don't have the jpeg library in your system library area (meaning ! XCOMM that it must be compiled first), comment out the USEINSTALLEDJPEG variable ! XCOMM (using XCOMM), change the JPEGLIBDIR variable to the directory where your ! XCOMM jpeg library resides and change the JPEGINCDIR to the directory where your ! XCOMM jpeg header files (include) reside. XCOMM You must have version 5b or newer of the jpeg library. #define USEINSTALLEDJPEG *************** *** 95,109 **** #endif #endif /* USEJPEG */ ! XCOMM uncomment the following to set paper size to A4 XCOMM DDA4 = -DA4 ! XCOMM uncomment the following to set IBM Graphics Enhancement Cartridge XCOMM DDIBMGEC = -DIBMGEC ! XCOMM comment out the DDNFSS = ... line if you don't want NFSS2 font selection XCOMM for LaTeX texts ! XCOMM comment out the DDLATEX2E_GRAPHICS = ... line if you don't want to use the XCOMM standard graphics package distributed w/ LaTeX2e XCOMM UNcomment the DDEPSFIG = ... line if you want to use the deprecated epsfig macros XCOMM distributed w/ LaTeX2e (DDLATEX2E_GRAPHICS must also be defined) --- 99,116 ---- #endif #endif /* USEJPEG */ ! XCOMM **************** ! XCOMM Uncomment the following to set paper size to A4 XCOMM DDA4 = -DA4 ! XCOMM **************** ! XCOMM Uncomment the following to set IBM Graphics Enhancement Cartridge XCOMM DDIBMGEC = -DIBMGEC ! XCOMM **************** ! XCOMM Comment out the DDNFSS = ... line if you don't want NFSS2 font selection XCOMM for LaTeX texts ! XCOMM Comment out the DDLATEX2E_GRAPHICS = ... line if you don't want to use the XCOMM standard graphics package distributed w/ LaTeX2e XCOMM UNcomment the DDEPSFIG = ... line if you want to use the deprecated epsfig macros XCOMM distributed w/ LaTeX2e (DDLATEX2E_GRAPHICS must also be defined) *************** *** 116,130 **** DDLATEX2E_GRAPHICS = -DLATEX2E_GRAPHICS XCOMM DDEPSFIG = -DEPSFIG ! XCOMM comment out the DDDVIPS to NOT use dvips for the DVI-to-PostScript driver DDDVIPS = -DDVIPS XCOMM If your system doesn't have strcasecmp and/or strncasecmp ! XCOMM undefine the following two definitions XCOMM HAVE_NO_STRCASECMP = -DHAVE_NO_STRCASECMP XCOMM HAVE_NO_STRNCASECMP = -DHAVE_NO_STRNCASECMP XCOMM Uncomment the next line if you want use Japanese (i18n) on xfig. XCOMM #define I18N --- 123,144 ---- DDLATEX2E_GRAPHICS = -DLATEX2E_GRAPHICS XCOMM DDEPSFIG = -DEPSFIG ! XCOMM **************** ! XCOMM Comment out the DDDVIPS to NOT use dvips for the DVI-to-PostScript driver DDDVIPS = -DDVIPS + XCOMM **************** XCOMM If your system doesn't have strcasecmp and/or strncasecmp ! XCOMM uncomment the following two definitions XCOMM HAVE_NO_STRCASECMP = -DHAVE_NO_STRCASECMP XCOMM HAVE_NO_STRNCASECMP = -DHAVE_NO_STRNCASECMP + XCOMM **************** + XCOMM If your system doesn't have strstr() then uncomment the following line + XCOMM #define NOSTRSTR + + XCOMM **************** XCOMM Uncomment the next line if you want use Japanese (i18n) on xfig. XCOMM #define I18N *************** *** 132,149 **** #ifdef I18N I18N_DEFS = -DI18N FIG2DEV_LIBDIR = /usr/local/lib/fig2dev ! I18N_DEV_DEFS = $(I18N_DEFS) -DFIG2DEV_LIBDIR='\"/usr/local/lib/fig2dev\"' install:: ! [ -d $(FIG2DEV_LIBDIR) ] || mkdir $(FIG2DEV_LIBDIR) ! $(INSTALL) -c dev/japanese.ps $(FIG2DEV_LIBDIR) ! ( cd $(FIG2DEV_LIBDIR); \ rm -f ja.ps ja_JP.ps ja_JP.ujis.ps ja_JP.eucJP.ps ja_JP.EUC.ps; \ ln -s japanese.ps ja.ps; ln -s japanese.ps ja_JP.ps; \ ln -s japanese.ps ja_JP.ujis.ps; ln -s japanese.ps ja_JP.eucJP.ps; \ ln -s japanese.ps ja_JP.EUC.ps ) ! $(INSTALL) -c dev/korean.ps $(FIG2DEV_LIBDIR) ! ( cd $(FIG2DEV_LIBDIR); \ rm -f ko.ps ko_KR.ps ko_KR.ujis.ps ko_KR.eucKR.ps ko_KR.EUC.ps; \ ln -s korean.ps ko.ps; ln -s korean.ps ko_KR.ps; \ ln -s korean.ps ko_KR.ujis.ps; ln -s korean.ps ko_KR.eucKR.ps; \ --- 146,163 ---- #ifdef I18N I18N_DEFS = -DI18N FIG2DEV_LIBDIR = /usr/local/lib/fig2dev ! I18N_DEV_DEFS = $(I18N_DEFS) -DFIG2DEV_LIBDIR=\\\"$(DESTDIR)$(FIG2DEV_LIBDIR)\\\" install:: ! [ -d $(DESTDIR)$(FIG2DEV_LIBDIR) ] || mkdir $(DESTDIR)$(FIG2DEV_LIBDIR) ! $(INSTALL) -c dev/japanese.ps $(DESTDIR)$(FIG2DEV_LIBDIR) ! ( cd $(DESTDIR)$(FIG2DEV_LIBDIR); \ rm -f ja.ps ja_JP.ps ja_JP.ujis.ps ja_JP.eucJP.ps ja_JP.EUC.ps; \ ln -s japanese.ps ja.ps; ln -s japanese.ps ja_JP.ps; \ ln -s japanese.ps ja_JP.ujis.ps; ln -s japanese.ps ja_JP.eucJP.ps; \ ln -s japanese.ps ja_JP.EUC.ps ) ! $(INSTALL) -c dev/korean.ps $(DESTDIR)$(FIG2DEV_LIBDIR) ! ( cd $(DESTDIR)$(FIG2DEV_LIBDIR); \ rm -f ko.ps ko_KR.ps ko_KR.ujis.ps ko_KR.eucKR.ps ko_KR.EUC.ps; \ ln -s korean.ps ko.ps; ln -s korean.ps ko_KR.ps; \ ln -s korean.ps ko_KR.ujis.ps; ln -s korean.ps ko_KR.eucKR.ps; \ *************** *** 151,166 **** #endif DEFINES = $(NEED_STRERROR) $(HAVE_NO_STRCASECMP) $(HAVE_NO_STRNCASECMP) $(USEINLINE) \ ! $(I18N_DEFS) - XCOMM If your system doesn't have strstr() then uncomment the following line - XCOMM #define NOSTRSTR XCOMM ************************************************************** XCOMM *** You shouldn't have to change anything below this point *** XCOMM ************************************************************** ! DIR_DEFS= -DBITMAPDIR=\\\"$(XFIGLIBDIR)/bitmaps\\\" #ifdef USEXPM DUSEXPM = -DUSE_XPM --- 165,178 ---- #endif DEFINES = $(NEED_STRERROR) $(HAVE_NO_STRCASECMP) $(HAVE_NO_STRNCASECMP) $(USEINLINE) \ ! $(I18N_DEFS) $(HAVE_SETMODE) XCOMM ************************************************************** XCOMM *** You shouldn't have to change anything below this point *** XCOMM ************************************************************** ! DIR_DEFS= -DBITMAPDIR=\\\"$(DESTDIR)$(XFIGLIBDIR)/bitmaps\\\" #ifdef USEXPM DUSEXPM = -DUSE_XPM *************** *** 173,197 **** #endif #ifdef USEJPEG - DUSEJPEG = -DUSE_JPEG #ifdef USEINSTALLEDJPEG - JPEGLIBDIR = /usr/local/lib JPEGLIB = -L$(JPEGLIBDIR) -ljpeg #else - XCOMM this is relative to this directory (transfig/fig2dev) - JPEGLIBDIR = ../../jpeg-6a JPEGCONF = configure JPEGLIB = $(JPEGLIBDIR)/libjpeg.a DEPLIBJPEG = $(JPEGLIBDIR)/libjpeg.a ! #endif /* USEINSTALLEDJPEG */ #endif /* USEJPEG */ IMAKE_DEFINES = $(DUSEJPEG) $(DUSEXPM) ! DEVDEFINES = $(DUSEJPEG) $(DUSEXPM) $(XPMINC) $(DDNFSS) $(DDA4) \ $(DDLATEX2E_GRAPHICS) $(DDEPSFIG) $(DDIBMGEC) $(DDDVIPS) $(I18N_DEV_DEFS) #define IHaveSubdirs --- 185,206 ---- #endif #ifdef USEJPEG DUSEJPEG = -DUSE_JPEG + JPEGINC = -I$(JPEGINCDIR) #ifdef USEINSTALLEDJPEG JPEGLIB = -L$(JPEGLIBDIR) -ljpeg #else JPEGCONF = configure JPEGLIB = $(JPEGLIBDIR)/libjpeg.a DEPLIBJPEG = $(JPEGLIBDIR)/libjpeg.a ! #endif /* USEINSTALLEDJPEG */ #endif /* USEJPEG */ IMAKE_DEFINES = $(DUSEJPEG) $(DUSEXPM) ! DEVDEFINES = $(DUSEJPEG) $(DUSEXPM) $(XPMINC) $(JPEGINC) $(DDNFSS) $(DDA4) \ $(DDLATEX2E_GRAPHICS) $(DDEPSFIG) $(DDIBMGEC) $(DDDVIPS) $(I18N_DEV_DEFS) #define IHaveSubdirs *************** *** 207,215 **** LOCAL_LIBRARIES = $(LIBTRANSFIG) $(JPEGLIB) #if defined(NetBSDArchitecture) || defined(FreeBSDArchitecture) ! SYS_LIBRARIES = $(XPMLIBS) $(DBMLIB) -lm -lcompat #else ! SYS_LIBRARIES = $(XPMLIBS) $(DBMLIB) -lm #endif DEPLIBS = $(LIBTRANSFIG) --- 216,224 ---- LOCAL_LIBRARIES = $(LIBTRANSFIG) $(JPEGLIB) #if defined(NetBSDArchitecture) || defined(FreeBSDArchitecture) ! SYS_LIBRARIES = $(XPMLIBS) -lm -lcompat #else ! SYS_LIBRARIES = $(XPMLIBS) -lm #endif DEPLIBS = $(LIBTRANSFIG) *************** *** 225,234 **** fig2dev: $(DEPLIBJPEG) $(DEPLIBS) - RGBDBM = $(USE_NDBM) RGBFILE = -DRGB_FILE=\"$(RGB)\" ! SpecialObjectRule(colors.o, , $(RGBFILE) $(RGBDBM)) ! SpecialObjectRule(fig2dev.o, fig2dev.c ../patchlevel.h, ) XCOMM only compile our jpeg if the use doesn't have one installed --- 234,242 ---- fig2dev: $(DEPLIBJPEG) $(DEPLIBS) RGBFILE = -DRGB_FILE=\"$(RGB)\" ! SpecialObjectRule(colors.o, Imakefile , $(RGBFILE)) ! SpecialObjectRule(fig2dev.o, fig2dev.c drivers.h ../patchlevel.h, ) XCOMM only compile our jpeg if the use doesn't have one installed *************** *** 243,254 **** #endif $(LIBTRANSFIG):: ! cd $(DEVDIR); $(MAKE) JPEGINCDIR=$(JPEGINCDIR) \ ! DEFINES="$(DEVDEFINES) $(DIR_DEFS)" libtransfig.a - PROGRAM = fig2dev - AllTarget(fig2dev) - MakeSubdirs($(SUBDIRS)) DependSubdirs($(SUBDIRS)) ComplexProgramTarget(fig2dev) --- 251,258 ---- #endif $(LIBTRANSFIG):: ! cd $(DEVDIR); $(MAKE) DEFINES="$(DEVDEFINES) $(DIR_DEFS)" libtransfig.a DependSubdirs($(SUBDIRS)) ComplexProgramTarget(fig2dev) *************** *** 258,268 **** XCOMM Install the tk bitmaps here install:: @(cd bitmaps ; \ ! if [ -d $(XFIGLIBDIR)/bitmaps ]; then set +x; \ ! else (set -x; $(MKDIRHIER) $(XFIGLIBDIR)/bitmaps ); fi ; \ ! echo Copying bitmap files for tk to $(XFIGLIBDIR)/bitmaps ; \ for f in * ; do \ ! $(INSTALL) -c $$f $(XFIGLIBDIR)/bitmaps ; \ done) ; InstallScript(fig2ps2tex,$(BINDIR)) --- 262,272 ---- XCOMM Install the tk bitmaps here install:: @(cd bitmaps ; \ ! if [ -d $(DESTDIR)$(XFIGLIBDIR)/bitmaps ]; then set +x; \ ! 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 ; \ done) ; InstallScript(fig2ps2tex,$(BINDIR)) *************** *** 273,283 **** --- 277,290 ---- InstallManPage(pic2tpic,$(MANDIR)) fig2dev.man:: ../doc/fig2dev.1 + $(RM) fig2dev.man -ln -s ../doc/fig2dev.1 fig2dev.man fig2ps2tex.man:: ../doc/fig2ps2tex.1 + $(RM) fig2ps2tex.man -ln -s ../doc/fig2ps2tex.1 fig2ps2tex.man pic2tpic.man:: ../doc/pic2tpic.1 + $(RM) pic2tpic.man -ln -s ../doc/pic2tpic.1 pic2tpic.man diff -rc transfig.3.2.3/fig2dev/bound.c transfig.3.2.3b/fig2dev/bound.c *** transfig.3.2.3/fig2dev/bound.c Thu Dec 9 10:53:03 1999 --- transfig.3.2.3b/fig2dev/bound.c Mon May 1 14:16:39 2000 *************** *** 26,31 **** --- 26,32 ---- */ #include "fig2dev.h" + #include "figure.h" #include "object.h" #define Ninety_deg M_PI_2 *************** *** 36,41 **** --- 37,104 ---- #define max(a, b) (((a) > (b)) ? (a) : (b)) #define min(a, b) (((a) < (b)) ? (a) : (b)) + static double compute_angle(); + + /************** ARRAY FOR ARROW SHAPES **************/ + + struct _fpnt { + double x,y; + }; + + struct _arrow_shape { + int numpts; + int tipno; + double tipmv; + struct _fpnt points[6]; + }; + + #define NUM_ARROW_TYPES 21 + static struct _arrow_shape arrow_shapes[NUM_ARROW_TYPES+1] = { + /* number of points, index of tip, {datapairs} */ + /* first point must be upper-left point of tail, then tip */ + + /* type 0 */ + { 3, 1, 2.15, {{-1,0.5}, {0,0}, {-1,-0.5}}}, + /* place holder for what would be type 0 filled */ + { 0 }, + /* type 1 simple triangle */ + { 4, 1, 2.1, {{-1.0,0.5}, {0,0}, {-1.0,-0.5}, {-1.0,0.5}}}, + /* type 1 filled simple triangle*/ + { 4, 1, 2.1, {{-1.0,0.5}, {0,0}, {-1.0,-0.5}, {-1.0,0.5}}}, + /* type 2 concave spearhead */ + { 5, 1, 2.6, {{-1.25,0.5},{0,0},{-1.25,-0.5},{-1.0,0},{-1.25,0.5}}}, + /* type 2 filled concave spearhead */ + { 5, 1, 2.6, {{-1.25,0.5},{0,0},{-1.25,-0.5},{-1.0,0},{-1.25,0.5}}}, + /* type 3 convex spearhead */ + { 5, 1, 1.5, {{-0.75,0.5},{0,0},{-0.75,-0.5},{-1.0,0},{-0.75,0.5}}}, + /* type 3 filled convex spearhead */ + { 5, 1, 1.5, {{-0.75,0.5},{0,0},{-0.75,-0.5},{-1.0,0},{-0.75,0.5}}}, + /* type 4 diamond */ + { 5, 1, 1.15, {{-0.5,0.5},{0,0},{-0.5,-0.5},{-1.0,0},{-0.5,0.5}}}, + /* type 4 filled diamond */ + { 5, 1, 1.15, {{-0.5,0.5},{0,0},{-0.5,-0.5},{-1.0,0},{-0.5,0.5}}}, + /* type 5 circle - handled in code */ + { 0, 0, 0.0 }, { 0, 0, 0.0 }, + /* type 6 half circle - handled in code */ + { 0, 0, -1.0 }, { 0, 0, -1.0 }, + /* type 7 square */ + { 5, 1, 0.0, {{-1.0,0.5},{0,0.5},{0,-0.5},{-1.0,-0.5},{-1.0,0.5}}}, + /* type 7 filled square */ + { 5, 1, 0.0, {{-1.0,0.5},{0,0.5},{0,-0.5},{-1.0,-0.5},{-1.0,0.5}}}, + /* type 8 reverse triangle */ + { 4, 1, 0.0, {{-1.0,0},{0,0.5},{0,-0.5},{-1.0,0}}}, + /* type 8 filled reverse triangle */ + { 4, 1, 0.0, {{-1.0,0},{0,0.5},{0,-0.5},{-1.0,0}}}, + /* type 9a "wye" */ + { 3, 0, -1.0, {{0,0.5},{-1.0,0},{0,-0.5}}}, + /* type 9b bar */ + { 2, 1, 0.0, {{0,0.5},{0,-0.5}}}, + /* type 10a two-prong fork */ + { 4, 0, -1.0, {{0,0.5},{-1.0,0.5},{-1.0,-0.5},{0,-0.5}}}, + /* type 10b backward two-prong fork */ + { 4, 1, 0.0, {{-1.0,0.5,},{0,0.5},{0,-0.5},{-1.0,-0.5}}}, + }; + arc_bound(arc, xmin, ymin, xmax, ymax) F_arc *arc; int *xmin, *ymin, *xmax, *ymax; *************** *** 122,143 **** *ymin = sy; *xmax = bx; *ymax = by; } compound_bound(compound, xmin, ymin, xmax, ymax, include) ! F_compound *compound; ! int *xmin, *ymin, *xmax, *ymax; ! int include; ! { ! F_arc *a; ! F_ellipse *e; ! F_compound *c; ! F_spline *s; ! F_line *l; ! F_text *t; ! int bx, by, sx, sy, first = 1; ! int llx, lly, urx, ury; ! int half_wd; llx = lly = 1000000; urx = ury = -1000000; --- 185,209 ---- *ymin = sy; *xmax = bx; *ymax = by; + + /* now add in the arrow (if any) boundaries */ + arrow_bound(O_ARC, (F_line *)arc, xmin, ymin, xmax, ymax); } compound_bound(compound, xmin, ymin, xmax, ymax, include) ! F_compound *compound; ! int *xmin, *ymin, *xmax, *ymax; ! int include; ! { ! F_arc *a; ! F_ellipse *e; ! F_compound *c; ! F_spline *s; ! F_line *l; ! F_text *t; ! int bx, by, sx, sy, first = 1; ! int llx, lly, urx, ury; ! int half_wd; llx = lly = 1000000; urx = ury = -1000000; *************** *** 315,321 **** int *xmin, *ymin, *xmax, *ymax; { points_bound(l->points, xmin, ymin, xmax, ymax); ! } spline_bound(s, xmin, ymin, xmax, ymax) F_spline *s; --- 381,391 ---- int *xmin, *ymin, *xmax, *ymax; { points_bound(l->points, xmin, ymin, xmax, ymax); ! /* now add in the arrow (if any) boundaries but ! only if the line has two or more points */ ! if (l->points->next) ! arrow_bound(O_POLYLINE, l, xmin, ymin, xmax, ymax); ! } spline_bound(s, xmin, ymin, xmax, ymax) F_spline *s; *************** *** 327,333 **** else { normal_spline_bound(s, xmin, ymin, xmax, ymax); } ! } int_spline_bound(s, xmin, ymin, xmax, ymax) F_spline *s; --- 397,405 ---- else { normal_spline_bound(s, xmin, ymin, xmax, ymax); } ! /* now do any arrows */ ! arrow_bound(O_SPLINE, s, xmin, ymin, xmax, ymax); ! } int_spline_bound(s, xmin, ymin, xmax, ymax) F_spline *s; *************** *** 373,379 **** *ymin = round(sy); *xmax = round(bx); *ymax = round(by); ! } normal_spline_bound(s, xmin, ymin, xmax, ymax) F_spline *s; --- 445,451 ---- *ymin = round(sy); *xmax = round(bx); *ymax = round(by); ! } normal_spline_bound(s, xmin, ymin, xmax, ymax) F_spline *s; *************** *** 422,469 **** *xmax = ceil (max(bx, x2) ); *ymax = ceil (max(by, y2) ); } ! } double rot_x(x,y,angle) ! double x,y,angle; { return(x*cos(-angle)-y*sin(-angle)); } double rot_y(x,y,angle) ! double x,y,angle; { ! return(x*sin(-angle)+y*cos(-angle)); } ! text_bound(t, xmin, ymin, xmax, ymax, include) ! F_text *t; ! int *xmin, *ymin, *xmax, *ymax; ! int include; { ! double dx1, dx2, dx3, dx4, dy1, dy2, dy3, dy4; ! int descend; ! descend = (strchr(t->cstring,'g') || strchr(t->cstring,'j') || strchr(t->cstring,'p') || strchr(t->cstring,'q') || strchr(t->cstring,'y')); ! /* characters have some extent downside */ ! if (t->type == T_CENTER_JUSTIFIED) { ! dx1 = (include? (t->length/1.95) : 0.0); dy1 = 0.0; ! dx2 = (include? -(t->length/1.95) : 0.0); dy2 = 0.0; ! dx3 = (include? (t->length/1.95) : 0.0); dy3 = -t->height; ! dx4 = (include? -(t->length/1.95) : 0.0); dy4 = -t->height; ! } else if (t->type == T_RIGHT_JUSTIFIED) { ! dx1 = 0.0; dy1 = 0.0; ! dx2 = (include? -t->length*1.0256 : 0.0); dy2 = 0.0; ! dx3 = 0.0; dy3 = -t->height; ! dx4 = (include? -t->length*1.0256 : 0.0); dy4 = -t->height; ! } else { ! dx1 = (include ? t->length*1.0256 : 0.0); dy1 = 0.0; ! dx2 = 0.0; dy2 = 0.0; ! dx3 = (include ? t->length*1.0256 : 0.0); dy3 = -t->height; ! dx4 = 0.0; dy4 = -t->height; ! } if (descend) { dy1 = 0.3*t->height; dy2 = 0.3*t->height; --- 494,543 ---- *xmax = ceil (max(bx, x2) ); *ymax = ceil (max(by, y2) ); } ! } double rot_x(x,y,angle) ! double x,y,angle; { return(x*cos(-angle)-y*sin(-angle)); } double rot_y(x,y,angle) ! double x,y,angle; { ! return(x*sin(-angle)+y*cos(-angle)); } ! text_bound(t, xmin, ymin, xmax, ymax, inc_text) ! F_text *t; ! int *xmin, *ymin, *xmax, *ymax; ! int inc_text; { ! double dx1, dx2, dx3, dx4, dy1, dy2, dy3, dy4; ! int descend; ! ! Boolean include = (inc_text && ((t->flags & SPECIAL_TEXT)==0)); ! descend = (strchr(t->cstring,'g') || strchr(t->cstring,'j') || strchr(t->cstring,'p') || strchr(t->cstring,'q') || strchr(t->cstring,'y')); ! /* characters have some extent downside */ ! if (t->type == T_CENTER_JUSTIFIED) { ! dx1 = (include? (t->length/1.95) : 0.0); dy1 = 0.0; ! dx2 = (include? -(t->length/1.95) : 0.0); dy2 = 0.0; ! dx3 = (include? (t->length/1.95) : 0.0); dy3 = -t->height; ! dx4 = (include? -(t->length/1.95) : 0.0); dy4 = -t->height; ! } else if (t->type == T_RIGHT_JUSTIFIED) { ! dx1 = 0.0; dy1 = 0.0; ! dx2 = (include? -t->length*1.0256 : 0.0); dy2 = 0.0; ! dx3 = 0.0; dy3 = -t->height; ! dx4 = (include? -t->length*1.0256 : 0.0); dy4 = -t->height; ! } else { ! dx1 = (include ? t->length*1.0256 : 0.0); dy1 = 0.0; ! dx2 = 0.0; dy2 = 0.0; ! dx3 = (include ? t->length*1.0256 : 0.0); dy3 = -t->height; ! dx4 = 0.0; dy4 = -t->height; ! } if (descend) { dy1 = 0.3*t->height; dy2 = 0.3*t->height; *************** *** 484,494 **** *ymin= t->base_y + min( min( rot_y(dx1,dy1,t->angle), rot_y(dx2,dy2,t->angle) ), min( rot_y(dx3,dy3,t->angle), rot_y(dx4,dy4,t->angle) ) ); ! } points_bound(points, xmin, ymin, xmax, ymax) ! F_point *points; ! int *xmin, *ymin, *xmax, *ymax; { int bx, by, sx, sy; F_point *p; --- 558,568 ---- *ymin= t->base_y + min( min( rot_y(dx1,dy1,t->angle), rot_y(dx2,dy2,t->angle) ), min( rot_y(dx3,dy3,t->angle), rot_y(dx4,dy4,t->angle) ) ); ! } points_bound(points, xmin, ymin, xmax, ymax) ! F_point *points; ! int *xmin, *ymin, *xmax, *ymax; { int bx, by, sx, sy; F_point *p; *************** *** 500,510 **** } *xmin = sx; *ymin = sy; *xmax = bx; *ymax = by; ! } control_points_bound(cps, xmin, ymin, xmax, ymax) ! F_control *cps; ! int *xmin, *ymin, *xmax, *ymax; { F_control *c; double bx, by, sx, sy; --- 574,584 ---- } *xmin = sx; *ymin = sy; *xmax = bx; *ymax = by; ! } control_points_bound(cps, xmin, ymin, xmax, ymax) ! F_control *cps; ! int *xmin, *ymin, *xmax, *ymax; { F_control *c; double bx, by, sx, sy; *************** *** 521,524 **** } *xmin = round(sx); *ymin = round(sy); *xmax = round(bx); *ymax = round(by); ! } --- 595,954 ---- } *xmin = round(sx); *ymin = round(sy); *xmax = round(bx); *ymax = round(by); ! } ! ! /* extend xmin, ymin xmax, ymax by the arrow boundaries of obj (if any) */ ! ! arrow_bound(objtype, obj, xmin, ymin, xmax, ymax) ! int objtype; ! F_line *obj; ! int *xmin, *ymin, *xmax, *ymax; ! { ! int fxmin, fymin, fxmax, fymax; ! int bxmin, bymin, bxmax, bymax; ! F_point *p, *q; ! F_arc *a; ! int p1x, p1y, p2x, p2y; ! int dum; ! int npts, i; ! Point arrowpts[50]; ! ! if (obj->for_arrow) { ! if (objtype == O_ARC) { ! a = (F_arc *) obj; ! compute_arcarrow_angle(a->center.x, a->center.y, ! (double)a->point[2].x, (double)a->point[2].y, ! a->direction, a->for_arrow, &p1x, &p1y); ! p2x = a->point[2].x; /* forward tip */ ! p2y = a->point[2].y; ! } else { ! /* this doesn't work very well for a spline with few points ! and lots of curvature */ ! /* locate last point (forward tip) and next-to-last point */ ! for (p = obj->points; p->next; p = p->next) ! q = p; ! p1x = q->x; ! p1y = q->y; ! p2x = p->x; ! p2y = p->y; ! } ! calc_arrow(p1x, p1y, p2x, p2y, &dum, &dum, &dum, &dum, ! obj->for_arrow, arrowpts, &npts, &dum); ! fxmin=fymin=100000; ! fxmax=fymax=-100000; ! for (i=0; iback_arrow) { ! if (objtype == O_ARC) { ! a = (F_arc *) obj; ! compute_arcarrow_angle(a->center.x, a->center.y, ! (double) a->point[0].x, (double) a->point[0].y, ! a->direction ^ 1, a->back_arrow, &p1x, &p1y); ! p2x = a->point[0].x; /* backward tip */ ! p2y = a->point[0].y; ! } else { ! p1x = obj->points->next->x; /* second point */ ! p1y = obj->points->next->y; ! p2x = obj->points->x; /* first point (forward tip) */ ! p2y = obj->points->y; ! } ! calc_arrow(p1x, p1y, p2x, p2y, &dum, &dum, &dum, &dum, ! obj->back_arrow, arrowpts, &npts, &dum); ! bxmin=bymin=100000; ! bxmax=bymax=-100000; ! for (i=0; iwid; ! float ht = arrow->ht; ! int type, style, indx; ! int i, np; ! ! /* types = 0...10 */ ! type = arrow->type; ! /* style = 0 (unfilled) or 1 (filled) */ ! style = arrow->style; ! /* index into shape array */ ! indx = 2*type + style; ! ! *npoints = 0; ! *nboundpts = 0; ! dx = x2 - x1; ! dy = y1 - y2; ! if (dx==0 && dy==0) ! return; ! ! /* lpt is the amount the arrowhead extends beyond the end of the ! line because of the sharp point (miter join) */ ! ! tipmv = arrow_shapes[indx].tipmv; ! lpt = 0.0; ! /* lines are made a little thinner in set_linewidth */ ! thick = (arrow->thickness <= THICK_SCALE) ? ! 0.5* arrow->thickness : ! arrow->thickness - THICK_SCALE; ! if (tipmv > 0.0) ! lpt = thick / (2.0 * sin(atan(wd / (tipmv * ht)))); ! else if (tipmv == 0.0) ! lpt = thick / 3.0; /* types which have blunt end */ ! /* (Don't adjust those with tipmv < 0) */ ! ! /* alpha is the angle the line is relative to horizontal */ ! alpha = atan2(dy,-dx); ! ! /* ddx, ddy is amount to move end of line back so that arrowhead point ! ends where line used to */ ! ddx = lpt * cos(alpha); ! ddy = lpt * sin(alpha); ! ! /* move endpoint of line back */ ! mx = x2 + ddx; ! my = y2 + ddy; ! ! l = sqrt(dx * dx + dy * dy); ! sina = dy / l; ! cosa = dx / l; ! xb = mx * cosa - my * sina; ! yb = mx * sina + my * cosa; ! ! /* (xa,ya) is the rotated endpoint */ ! xa = xb * cosa + yb * sina + 0.5; ! ya = -xb * sina + yb * cosa + 0.5; ! ! /* ! * We approximate circles with an octagon since, at small sizes, ! * this is sufficient. I haven't bothered to alter the bounding ! * box calculations. ! */ ! miny = 100000.0; ! maxy = -100000.0; ! if (type == 5 || type == 6) { /* also include half circle */ ! double rmag; ! double angle, init_angle, rads; ! double fix_x, fix_y; ! ! /* get angle of line */ ! init_angle = compute_angle(dx,dy); ! ! /* (xs,ys) is a point the length (height) of the arrowhead BACK from ! the end of the shaft */ ! /* for the half circle, use 0.0 */ ! xs = (xb-(type==5? ht: 0.0)) * cosa + yb * sina + 0.5; ! ys = -(xb-(type==5? ht: 0.0)) * sina + yb * cosa + 0.5; ! ! /* calc new (dx, dy) from moved endpoint to (xs, ys) */ ! dx = mx - xs; ! dy = my - ys; ! /* radius */ ! rmag = ht/2.0; ! fix_x = xs + (dx / (double) 2.0); ! fix_y = ys + (dy / (double) 2.0); ! /* choose number of points for circle - 20+mag/4 points */ ! np = round(mag/4.0) + 20; ! /* full or half circle? */ ! rads = (type==5? M_2PI: M_PI); ! ! if (type == 5) { ! init_angle = 5.0*M_PI_2 - init_angle; ! /* np/2 points in the forward part of the circle for the line clip area */ ! *nboundpts = np/2; ! /* full circle */ ! rads = M_2PI; ! } else { ! init_angle = 3.0*M_PI_2 - init_angle; ! /* no points in the line clip area */ ! *nboundpts = 0; ! /* half circle */ ! rads = M_PI; ! } ! /* draw the half or full circle */ ! for (i = 0; i < np; i++) { ! if (type == 5) ! angle = init_angle - (rads * (double) i / (double) np); ! else ! angle = init_angle - (rads * (double) i / (double) (np-1)); ! x = fix_x + round(rmag * cos(angle)); ! points[*npoints].x = x; ! y = fix_y + round(rmag * sin(angle)); ! points[*npoints].y = y; ! miny = min2(y, miny); ! maxy = max2(y, maxy); ! (*npoints)++; ! } ! x = 2.0*THICK_SCALE; ! y = rmag; ! xt = x*cosa + y*sina + x2; ! yt = -x*sina + y*cosa + y2; ! *c1x = xt; ! *c1y = yt; ! y = -rmag; ! xt = x*cosa + y*sina + x2; ! yt = -x*sina + y*cosa + y2; ! *c2x = xt; ! *c2y = yt; ! } else { ! /* 3 points in the arrowhead that define the line clip part */ ! *nboundpts = 3; ! np = arrow_shapes[indx].numpts; ! for (i=0; i 0) ! alpha = M_PI_2; ! else ! alpha = 3 * M_PI_2; ! } else if (dy == 0) { ! if (dx > 0) ! alpha = 0; ! else ! alpha = M_PI; ! } else { ! alpha = atan(dy / dx); /* range = -PI/2 to PI/2 */ ! if (dx < 0) ! alpha += M_PI; ! else if (dy < 0) ! alpha += M_2PI; ! } ! return (alpha); ! } ! ! /* Computes a point on a line which is a chord to the arc specified by */ ! /* center (x1,y1) and endpoint (x2,y2), where the chord intersects the */ ! /* arc arrow->ht from the endpoint. */ ! /* May give strange values if the arrow.ht is larger than about 1/4 of */ ! /* the circumference of a circle on which the arc lies. */ ! ! compute_arcarrow_angle(x1, y1, x2, y2, direction, arrow, x, y) ! double x1, y1; ! double x2, y2; ! int direction; ! F_arrow *arrow; ! int *x, *y; ! { ! double r, alpha, beta, dy, dx; ! double lpt,h; ! double thick; ! ! dy=y2-y1; ! dx=x2-x1; ! r=sqrt(dx*dx+dy*dy); ! h = (double) arrow->ht; ! /* lines are made a little thinner in set_linewidth */ ! thick = (arrow->thickness <= THICK_SCALE) ? ! 0.5* arrow->thickness : ! arrow->thickness - THICK_SCALE; ! /* lpt is the amount the arrowhead extends beyond the end of the line */ ! lpt = thick/2.0/(arrow->wid/h/2.0); ! /* add this to the length */ ! h += lpt; ! ! /* radius too small for this method, use normal method */ ! if (h > 2.0*r) { ! arc_tangent(x1,y1,x2,y2,direction,x,y); ! return; ! } ! ! beta=atan2(dy,dx); ! if (direction) { ! alpha = 2*asin(h/2.0/r); ! } else { ! alpha = -2*asin(h/2.0/r); ! } ! ! *x=round(x1+r*cos(beta+alpha)); ! *y=round(y1+r*sin(beta+alpha)); ! } ! diff -rc transfig.3.2.3/fig2dev/colors.c transfig.3.2.3b/fig2dev/colors.c *** transfig.3.2.3/fig2dev/colors.c Wed Nov 24 14:29:25 1999 --- transfig.3.2.3b/fig2dev/colors.c Tue May 30 11:30:59 2000 *************** *** 17,64 **** #include "fig2dev.h" ! #ifdef NDBM ! #include ! #else ! #ifdef SVR4 ! #include ! #else ! #include ! #endif ! #endif ! ! #ifdef NDBM ! DBM *rgb_dbm = (DBM *)NULL; ! #else ! int rgb_dbm = 0; ! #endif - - /* initialize the X11 RGB color database file */ - - init_colordb() - { - - #ifdef NDBM - rgb_dbm = dbm_open(RGB_FILE, 0, 0); - #else - if (dbminit(RGB_FILE) == 0) - rgb_dbm = 1; - #endif - return 0; - } - int ! lookup_db_color(name, rgb) char *name; RGB *rgb; { ! datum dbent; ! int j, n; ! int r,g,b; ! char rgb_txt[PATH_MAX]; ! char s[100], s1[100]; ! FILE *fp; if (name[0] == '#') { /* hex color parse it now */ if (strlen(name) == 4) { /* #rgb */ --- 17,49 ---- #include "fig2dev.h" ! struct color_db { ! char *name; ! int red, green, blue; ! }; ! ! struct color_db *Xcolors; ! int numXcolors, maxcolors; ! Boolean have_read_X_colors = False; int ! lookup_X_color(name, rgb) char *name; RGB *rgb; { ! int i, n; ! int r, g, b; ! struct color_db *col; ! ! /* read the X color database file if we haven't done that yet */ ! if (!have_read_X_colors) { ! if (read_colordb() != 0) { ! /* error reading color database, return black */ ! rgb->red = rgb->green = rgb->blue = 0; ! return -1; ! } ! have_read_X_colors = True; ! } if (name[0] == '#') { /* hex color parse it now */ if (strlen(name) == 4) { /* #rgb */ *************** *** 82,135 **** rgb->green = g; rgb->blue = b; } ! if (n != 3) { ! rgb->red=rgb->green=rgb->blue=0; ! return -1; } } else { ! /* make colorname all lower case */ ! for (j=strlen(name); j>=0; j--) { ! if (isupper(name[j])) ! name[j]=tolower(name[j]); ! } ! if (rgb_dbm) { ! dbent.dptr = name; ! dbent.dsize = strlen(name); ! /* look it up to get the rgb values */ ! #ifdef NDBM ! dbent = dbm_fetch(rgb_dbm, dbent); ! #else ! dbent = fetch (dbent); ! #endif ! if(dbent.dptr) { ! memcpy((char *) rgb, dbent.dptr, sizeof (RGB)); ! } else { ! rgb->red=rgb->green=rgb->blue=0; ! return -1; } ! } else { /* no DBM file; try to read rgb.txt */ ! sprintf(rgb_txt, "%s.txt", RGB_FILE); ! fp = fopen(rgb_txt, "r"); ! if (fp == NULL) { ! fprintf(stderr,"Couldn't open the RGB database file '%s'\n", rgb_txt); return -1; ! } else { ! while (fgets(s, sizeof(s), fp)) { ! if (sscanf(s, "%d %d %d %s", &r, &g, &b, s1) == 4) { ! if (strcasecmp(name, s1) == 0) { ! rgb->red = r << 8; ! rgb->green = g << 8; ! rgb->blue = b << 8; ! fclose(fp); ! return 0; ! } } - } - fclose(fp); - rgb->red=rgb->green=rgb->blue=0; - return -1; } } } return 0; } --- 67,141 ---- rgb->green = g; rgb->blue = b; } ! if (n == 3) { ! /* ok */ ! return 0; } } else { ! /* named color, look in the database we read in */ ! for (col = Xcolors, i=0; iname, name) == 0) { ! /* found it */ ! rgb->red = col->red; ! rgb->green = col->green; ! rgb->blue = col->blue; ! return 0; } ! } ! } ! /* not found or bad #rgb spec, set to black */ ! rgb->red = rgb->green = rgb->blue = 0; ! return -1; ! } ! ! /* read the X11 RGB color database (ASCII .txt) file */ ! ! read_colordb() ! { ! FILE *fp; ! char s[100], s1[100], *c1, *c2; ! int r,g,b; ! struct color_db *col; ! ! fp = fopen(RGB_FILE, "r"); ! if (fp == NULL) { ! fprintf(stderr,"Couldn't open the RGB database file '%s'\n", RGB_FILE); ! return -1; ! } ! numXcolors = 0; ! maxcolors = 400; ! if ((Xcolors = (struct color_db*) malloc(maxcolors*sizeof(struct color_db))) == NULL) { ! fprintf(stderr,"Couldn't allocate space for the RGB database file\n"); ! return -1; ! } ! ! while (fgets(s, sizeof(s), fp)) { ! if (numXcolors >= maxcolors) { ! maxcolors += 500; ! if ((Xcolors = (struct color_db*) realloc(Xcolors, maxcolors*sizeof(struct color_db))) == NULL) { ! fprintf(stderr,"Couldn't allocate space for the RGB database file\n"); return -1; ! } ! } ! if (sscanf(s, "%d %d %d %[^\n]", &r, &g, &b, s1) == 4) { ! /* remove any white space from the color name */ ! for (c1=s1, c2=s1; *c2; c2++) { ! if (*c2 != ' ' && *c2 != '\t') { ! *c1 = *c2; ! c1++; } } + *c1 = '\0'; + col = (Xcolors+numXcolors); + col->red = r << 8; + col->green = g << 8; + col->blue = b << 8; + col->name = malloc(strlen(s1)+1); + strcpy(col->name, s1); + numXcolors++; } } + fclose(fp); return 0; } + diff -rc transfig.3.2.3/fig2dev/dev/Imakefile transfig.3.2.3b/fig2dev/dev/Imakefile *** transfig.3.2.3/fig2dev/dev/Imakefile Wed Jan 5 10:30:09 2000 --- transfig.3.2.3b/fig2dev/dev/Imakefile Tue Jul 11 14:47:31 2000 *************** *** 22,32 **** XCOMM the party supplying this software to the X Consortium. INCLUDES = -I.. -I../.. - #ifdef JPEGINCDIR - JPEGINC = -I$(JPEGINCDIR) - #endif - - EXTRA_INCLUDES = $(JPEGINC) #ifdef USE_XPM READXPMS=readxpm.c --- 22,27 ---- diff -rc transfig.3.2.3/fig2dev/dev/genbitmaps.c transfig.3.2.3b/fig2dev/dev/genbitmaps.c *** transfig.3.2.3/fig2dev/dev/genbitmaps.c Mon Jan 3 09:50:47 2000 --- transfig.3.2.3b/fig2dev/dev/genbitmaps.c Tue Jul 11 15:16:14 2000 *************** *** 35,66 **** #include "object.h" #include "texfonts.h" ! extern void ! genps_arc(), ! genps_ellipse(), ! genps_line(), ! genps_spline(), ! genps_text(); ! ! static char gscom[1000],*gsdev,tmpname[PATH_MAX]; ! Boolean direct; ! FILE *saveofile; ! char *ofile; ! int width,height; ! int jpeg_quality=75; ! static int border_margin = 0; ! static int smooth = 1; ! static int debug = 0; void - gs_broken_pipe(int sig) - { - fprintf(stderr,"fig2dev: broken pipe (GhostScript aborted?)\n"); - fprintf(stderr,"command was: %s\n", gscom); - exit(1); - } - - void genbitmaps_option(opt, optarg) char opt; char *optarg; --- 35,50 ---- #include "object.h" #include "texfonts.h" ! static char *gsdev,tmpname[PATH_MAX]; ! static Boolean direct; ! static FILE *saveofile; ! static char *ofile; ! static int width,height; ! static int jpeg_quality=75; ! static int border_margin = 0; ! static int smooth = 0; void genbitmaps_option(opt, optarg) char opt; char *optarg; *************** *** 72,78 **** break; case 'g': /* background color (handled in postscript gen) */ ! if (lookup_db_color(optarg,&background) >= 0) { bgspec = True; } else { fprintf(stderr,"Can't parse color '%s', ignoring background option\n", --- 56,62 ---- break; case 'g': /* background color (handled in postscript gen) */ ! if (lookup_X_color(optarg,&background) >= 0) { bgspec = True; } else { fprintf(stderr,"Can't parse color '%s', ignoring background option\n", *************** *** 95,102 **** case 'S': /* smoothing factor */ sscanf(optarg,"%d",&smooth); ! if (smooth < 1) { ! fprintf(stderr,"fig2dev: bad value for -S option: %s\n", optarg); exit(1); } break; --- 79,88 ---- case 'S': /* smoothing factor */ sscanf(optarg,"%d",&smooth); ! if (smooth != 0 && smooth != 1 && smooth != 2 && smooth != 4) { ! fprintf(stderr, ! "fig2dev: bad value for -S option: %s, should be 0, 2 or 4\n", ! optarg); exit(1); } break; *************** *** 128,152 **** ury += bd; /* make command for ghostscript */ ! width=round(mag*smooth*(urx-llx)/THICK_SCALE); ! height=round(mag*smooth*(ury-lly)/THICK_SCALE); /* Add conditionals here if gs has a driver built-in */ /* gs has a driver for png, ppm, pcx, jpeg and tiff */ direct = True; ! ofile = to; extra_options[0]='\0'; gsdev = NULL; /* if we're smoothing, we'll generate magnified ppm then convert it later */ ! if (smooth == 1) { ! if (strcmp(lang,"png")==0) { ! gsdev="png16m"; ! } else if (strcmp(lang,"pcx")==0) { gsdev="pcx256"; } else if (strcmp(lang,"ppm")==0) { gsdev="ppmraw"; } else if (strcmp(lang,"tiff")==0) { /* use the 24-bit - unfortunately, it doesn't use compression */ gsdev="tiff24nc"; --- 114,138 ---- ury += bd; /* make command for ghostscript */ ! ! width=round(mag*(urx-llx)/THICK_SCALE); ! height=round(mag*(ury-lly)/THICK_SCALE); /* Add conditionals here if gs has a driver built-in */ /* gs has a driver for png, ppm, pcx, jpeg and tiff */ direct = True; ! ofile = (to == NULL? "-": to); extra_options[0]='\0'; gsdev = NULL; /* if we're smoothing, we'll generate magnified ppm then convert it later */ ! if (strcmp(lang,"pcx")==0) { gsdev="pcx256"; } else if (strcmp(lang,"ppm")==0) { gsdev="ppmraw"; + } else if (strcmp(lang,"png")==0) { + gsdev="png16m"; } else if (strcmp(lang,"tiff")==0) { /* use the 24-bit - unfortunately, it doesn't use compression */ gsdev="tiff24nc"; *************** *** 153,172 **** } else if (strcmp(lang,"jpeg")==0) { gsdev="jpeg"; /* set quality for JPEG */ ! sprintf(extra_options,"-dJPEGQ=%d",jpeg_quality); } } /* no driver in gs or we're smoothing, use ppm output then use ppmtoxxx later */ if (gsdev == NULL) { gsdev="ppmraw"; ! /* make a unique name for the temporary ppm file */ ! sprintf(tmpname,"%s/f2d%d.ppm",TMPDIR,getpid()); ! ofile = tmpname; ! direct = False; } /* make up the command for gs */ ! sprintf(gscom, "gs -q -dSAFER -sDEVICE=%s -r%d -g%dx%d -sOutputFile=%s %s -", ! gsdev, 80 * smooth, width, height, ofile, extra_options); /* divert output from ps driver to the pipe into ghostscript */ /* but first close the output file that main() opened */ saveofile = tfp; --- 139,163 ---- } else if (strcmp(lang,"jpeg")==0) { gsdev="jpeg"; /* set quality for JPEG */ ! sprintf(extra_options," -dJPEGQ=%d",jpeg_quality); } + if (smooth > 1) { + sprintf(extra_options+strlen(extra_options), + " -dTextAlphaBits=%d -dGraphicsAlphaBits=%d",smooth,smooth); } /* no driver in gs or we're smoothing, use ppm output then use ppmtoxxx later */ if (gsdev == NULL) { gsdev="ppmraw"; ! if (smooth > 1 || strcmp(lang,"ppm")) { ! /* make a unique name for the temporary ppm file */ ! sprintf(tmpname,"%s/f2d%d.ppm",TMPDIR,getpid()); ! ofile = tmpname; ! direct = False; ! } } /* make up the command for gs */ ! sprintf(gscom, "gs -q -dSAFER -sDEVICE=%s -r%d -g%dx%d -sOutputFile=%s%s -", ! gsdev, 80, width, height, ofile, extra_options); /* divert output from ps driver to the pipe into ghostscript */ /* but first close the output file that main() opened */ saveofile = tfp; *************** *** 213,224 **** /* and pipe through the ppm converter for that format */ if (!direct) { tmpname1 = tmpname; ! if (smooth == 1) { ! strcpy(com, "("); ! } else { ! sprintf(com, "(pnmscale %f %s | ", 1.0 / smooth, tmpname); ! tmpname1 = ""; ! } if (strcmp(lang, "gif")==0) { if (gif_transparent[0]) { /* escape the first char of the transparent color (#) for the shell */ --- 204,210 ---- /* and pipe through the ppm converter for that format */ if (!direct) { tmpname1 = tmpname; ! strcpy(com, "("); if (strcmp(lang, "gif")==0) { if (gif_transparent[0]) { /* escape the first char of the transparent color (#) for the shell */ *************** *** 228,234 **** sprintf(com1,"ppmquant 256 %s | ppmtogif",tmpname1); } } else if (strcmp(lang, "jpeg")==0) { ! sprintf(com1, "cjpeg -quality %d %s", jpeg_quality, tmpname1); } else if (strcmp(lang, "xbm")==0) { sprintf(com1,"ppmtopgm %s | pgmtopbm | pbmtoxbm",tmpname1); } else if (strcmp(lang, "xpm")==0) { --- 214,221 ---- sprintf(com1,"ppmquant 256 %s | ppmtogif",tmpname1); } } else if (strcmp(lang, "jpeg")==0) { ! /*sprintf(com1, "cjpeg -quality %d %s", jpeg_quality, tmpname1);*/ ! sprintf(com1, "ppmtojpeg --quality=%d %s", jpeg_quality, tmpname1); } else if (strcmp(lang, "xbm")==0) { sprintf(com1,"ppmtopgm %s | pgmtopbm | pbmtoxbm",tmpname1); } else if (strcmp(lang, "xpm")==0) { *************** *** 237,246 **** sprintf(com1,"ppmtoacad %s",tmpname1); } else if (strcmp(lang, "pcx")==0) { sprintf(com1, "ppmtopcx %s", tmpname1); } else if (strcmp(lang, "png")==0) { sprintf(com1, "pnmtopng %s", tmpname1); - } else if (strcmp(lang, "ppm")==0) { - sprintf(com1, "cat %s", tmpname1); } else if (strcmp(lang, "tiff")==0) { sprintf(com1, "pnmtotiff %s", tmpname1); } else { --- 224,233 ---- sprintf(com1,"ppmtoacad %s",tmpname1); } else if (strcmp(lang, "pcx")==0) { sprintf(com1, "ppmtopcx %s", tmpname1); + } else if (strcmp(lang, "ppm")==0) { + com1[0] = '\0'; /* nothing to do for ppm */ } else if (strcmp(lang, "png")==0) { sprintf(com1, "pnmtopng %s", tmpname1); } else if (strcmp(lang, "tiff")==0) { sprintf(com1, "pnmtotiff %s", tmpname1); } else { *************** *** 261,268 **** /* make a unique name for an error file */ sprintf(errfname,"%s/f2d%d.err",TMPDIR,getpid()); - if (debug) - fprintf(stderr,"Calling: %s\n",com); /* send all messages to error file */ strcat(com," 2> "); strcat(com,errfname); --- 248,253 ---- *************** *** 282,288 **** fprintf(stderr,"Command used:\n %s\n",com); fprintf(stderr,"Messages resulting:\n"); if (errfile == 0) ! fprintf(stderr,"can't opern error file %s\n",errfname); else { while (!feof(errfile)) { if (fgets(com, sizeof(com)-1, errfile) == NULL) --- 267,273 ---- fprintf(stderr,"Command used:\n %s\n",com); fprintf(stderr,"Messages resulting:\n"); if (errfile == 0) ! fprintf(stderr,"can't open error file %s\n",errfname); else { while (!feof(errfile)) { if (fgets(com, sizeof(com)-1, errfile) == NULL) diff -rc transfig.3.2.3/fig2dev/dev/genbox.c transfig.3.2.3b/fig2dev/dev/genbox.c *** transfig.3.2.3/fig2dev/dev/genbox.c Wed Nov 24 14:30:43 1999 --- transfig.3.2.3b/fig2dev/dev/genbox.c Tue Jul 11 14:49:51 2000 *************** *** 42,54 **** void genbox_start(objects) F_compound *objects; { - double ppi; - - if (0 == (ppi = (double)objects->nwcorner.x)) { - fprintf(stderr, "Resolution is zero!! default to 80 ppi\n"); - ppi = 80.0; - } - /* draw box */ fprintf(tfp, "\\makebox[%.3fin]{\\rule{0in}{%.3fin}}\n", (urx-llx)*mag/ppi, (ury-lly)*mag/ppi); --- 42,47 ---- diff -rc transfig.3.2.3/fig2dev/dev/gencgm.c transfig.3.2.3b/fig2dev/dev/gencgm.c *** transfig.3.2.3/fig2dev/dev/gencgm.c Wed Dec 22 13:02:54 1999 --- transfig.3.2.3b/fig2dev/dev/gencgm.c Tue Jul 11 14:50:22 2000 *************** *** 74,80 **** * see fillshade() and conv_color(). */ #define EPSILON 1e-4 /* small floating point value */ - static int Ypointsdown; /* True for Y axis pointing downward */ static int rounded_arrows; /* If rounded_arrows is False, the position * of arrows will be corrected for * compensating line width effects. This --- 74,79 ---- *************** *** 82,89 **** * rounded with the used CGM viewer. * See -r driver command line option. */ - static float scale; /* scale factor for fonts */ - static struct _rgb { float r, g, b; } --- 81,86 ---- *************** *** 137,144 **** int i; char *p, *figname = malloc(strlen(from)+1); - scale = (double) objects->nwcorner.x; - sprintf(figname, from); p = strrchr(figname, '/'); if (p) --- 134,139 ---- *************** *** 147,154 **** if (p) *p = '\0'; /* discard extension */ - Ypointsdown = (objects->nwcorner.y == 2); - fprintf(tfp, "BEGMF '%s';\n", figname); fprintf(tfp, "mfversion 1;\n"); fprintf(tfp, "mfdesc 'Converted from %s using fig2dev -Lcgm';\n", from); --- 142,147 ---- *************** *** 266,275 **** int x; int y; { - if (Ypointsdown) fprintf(tfp, "(%d,%d)", x-llx, ury-y); - else - fprintf(tfp, "(%d,%d)", x-llx, y-lly); } /* only reverses y if Y axis points down (relative position) */ --- 259,265 ---- *************** *** 278,287 **** int x; int y; { - if (Ypointsdown) fprintf(tfp, "(%d,%d)", x, -y); - else - fprintf(tfp, "(%d,%d)", x, y); } static void --- 268,274 ---- *************** *** 962,977 **** fprintf(tfp, "arcctr "); _pos(cx, cy); fprintf(tfp, " "); ! if (Ypointsdown) { ! /* reverse direction */ ! _relpos(x2, y2); ! fprintf(tfp, " "); ! _relpos(x1, y1); ! } else { ! _relpos(x1, y1); ! fprintf(tfp, " "); ! _relpos(x2, y2); ! } fprintf(tfp, " %d;\n", r); } --- 949,957 ---- fprintf(tfp, "arcctr "); _pos(cx, cy); fprintf(tfp, " "); ! _relpos(x2, y2); ! fprintf(tfp, " "); ! _relpos(x1, y1); fprintf(tfp, " %d;\n", r); } *************** *** 1211,1217 **** x2 = a->point[2].x - a->point[1].x, y2 = a->point[2].y - a->point[1].y; ! return Ypointsdown ? (icprod(x1,y1,x2,y2) > 0) : (icprod(x1,y1,x2,y2) < 0); } /* reverses arc direction by swapping endpoints and arrows */ --- 1191,1197 ---- x2 = a->point[2].x - a->point[1].x, y2 = a->point[2].y - a->point[1].y; ! return (icprod(x1,y1,x2,y2) > 0); } /* reverses arc direction by swapping endpoints and arrows */ *************** *** 1480,1486 **** { static double oldsize = UNDEFVALUE; chkcache(size, oldsize); ! fprintf(tfp, "charheight %d;\n", round(/*scale*/ 10 * size /*/ 80.*/)); } static void --- 1460,1466 ---- { static double oldsize = UNDEFVALUE; chkcache(size, oldsize); ! fprintf(tfp, "charheight %d;\n", round( 10 * size )); } static void *************** *** 1501,1507 **** { fprintf(tfp, "text "); _pos(x, y); ! fprintf(tfp, " final '%s';\n", text); } void --- 1481,1495 ---- { fprintf(tfp, "text "); _pos(x, y); ! fprintf(tfp, " final '"); ! /* if text contains a "'", must escape it(them) */ ! while ( *text ) { ! fputc(*text,tfp); ! if ( *text == '\'' ) ! fputc('\'',tfp); ! text++; ! } ! fprintf(tfp,"';\n"); } void diff -rc transfig.3.2.3/fig2dev/dev/genepic.c transfig.3.2.3b/fig2dev/dev/genepic.c *** transfig.3.2.3/fig2dev/dev/genepic.c Sun Jan 2 12:33:48 2000 --- transfig.3.2.3b/fig2dev/dev/genepic.c Tue Jul 11 14:50:28 2000 *************** *** 124,134 **** typedef struct fp_struct FPoint; /* Local to the file only */ - static int coord_system; - static int CoordSys = 2; static double Threshold; static Boolean linew_spec; - static int DPI; static int CurWidth = 0; static int LineStyle = SOLID_LINE; static int LLX = 0, LLY = 0; --- 124,131 ---- *************** *** 221,227 **** break; case 'a': ! fprintf(stderr, "warning: genepic option -a obsolete"); break; case 'f': --- 218,224 ---- break; case 'a': ! fprintf(stderr, "warning: genepic option -a obsolete\n"); break; case 'f': *************** *** 228,247 **** for ( i = 1; i <= MAX_FONT; i++ ) if ( !strcmp(optarg, texfontnames[i]) ) break; ! if ( i > MAX_FONT) ! { ! fprintf(stderr, ! "warning: non-standard font name %s ignored\n", optarg); ! } ! else ! { ! texfontnames[0] = texfontnames[i]; #ifdef NFSS ! texfontfamily[0] = texfontfamily[i]; ! texfontseries[0] = texfontseries[i]; ! texfontshape[0] = texfontshape[i]; #endif ! } break; case 'l': --- 225,240 ---- for ( i = 1; i <= MAX_FONT; i++ ) if ( !strcmp(optarg, texfontnames[i]) ) break; ! if ( i > MAX_FONT) { ! fprintf(stderr, "warning: non-standard font name %s ignored\n", optarg); ! } else { ! texfontnames[0] = texfontnames[i]; #ifdef NFSS ! texfontfamily[0] = texfontfamily[i]; ! texfontseries[0] = texfontseries[i]; ! texfontshape[0] = texfontshape[i]; #endif ! } break; case 'l': *************** *** 301,309 **** fconvertCS(fpt) FPoint *fpt; { ! if (CoordSys) { ! fpt->y = TopCoord - fpt->y; ! } fpt->x -= LLX; fpt->y -= LLY; } --- 294,300 ---- fconvertCS(fpt) FPoint *fpt; { ! fpt->y = TopCoord - fpt->y; fpt->x -= LLX; fpt->y -= LLY; } *************** *** 311,319 **** convertCS(pt) F_point *pt; { ! if (CoordSys) { ! pt->y = TopCoord - pt->y; ! } pt->x -= LLX; pt->y -= LLY; } --- 302,308 ---- convertCS(pt) F_point *pt; { ! pt->y = TopCoord - pt->y; pt->x -= LLX; pt->y -= LLY; } *************** *** 358,386 **** fputs(Preamble, stdout); } - DPI = objects->nwcorner.x; - if (DPI <= 0) { - put_msg("Resolution has to be positive. Default to 80!\n"); - DPI = 80; - } - /* now that we have DPI defined we can use the -l option */ if (linew_spec) ! LineThick = LineThick * DPI/80; if (LineThick == 0) ! LineThick = 2*DPI/80; ! DashScale = (double)DPI/80.0; ! coord_system = objects->nwcorner.y; ! switch (coord_system) { ! case 1: ! CoordSys = 0; ! break; ! case 2: ! CoordSys = 1; ! break; ! default: ! put_msg("Unknown Coordinate system -- %d\n", coord_system); ! exit(1); ! } pt1.x = llx; pt1.y = lly; pt2.x = urx; --- 347,357 ---- fputs(Preamble, stdout); } if (linew_spec) ! LineThick = LineThick * ppi/80.0; if (LineThick == 0) ! LineThick = 2.0*ppi/80.0; ! DashScale = ppi/80.0; pt1.x = llx; pt1.y = lly; pt2.x = urx; *************** *** 402,408 **** if (Verbose) { fprintf(tfp, "%%\n%% Language in use is %s\n%%\n", Tlangkw[TeXLang]); } ! Threshold = 1.0 / DPI * mag; fprintf(tfp, "\\setlength{\\unitlength}{%.8fin}\n", Threshold); MaxCircleRadius = (int) (40 / 72.27 / Threshold); Threshold = SegLen / Threshold; --- 373,379 ---- if (Verbose) { fprintf(tfp, "%%\n%% Language in use is %s\n%%\n", Tlangkw[TeXLang]); } ! Threshold = 1.0 / ppi * mag; fprintf(tfp, "\\setlength{\\unitlength}{%.8fin}\n", Threshold); MaxCircleRadius = (int) (40 / 72.27 / Threshold); Threshold = SegLen / Threshold; *************** *** 440,446 **** if (CurWidth==ThinLines) { fprintf(tfp, "\\thinlines\n"); } else if (VarWidth) { ! fprintf(tfp, "\\allinethickness{%4.3fpt}%%\n",w*80.0/DPI); } else { fprintf(tfp, "\\thicklines\n"); } --- 411,417 ---- if (CurWidth==ThinLines) { fprintf(tfp, "\\thinlines\n"); } else if (VarWidth) { ! fprintf(tfp, "\\allinethickness{%4.3fpt}%%\n",w*80.0/ppi); } else { fprintf(tfp, "\\thicklines\n"); } *************** *** 823,829 **** fprintf(tfp, "\\dottedline{%d}", DotDist); break; default: ! fprintf(stderr,"Unknown Style\n"); exit(1); } fprintf(tfp, "(%d,%d)", p->x, p->y); --- 794,800 ---- fprintf(tfp, "\\dottedline{%d}", DotDist); break; default: ! fprintf(stderr,"Only solid, dashed, and dotted line styles supported by epic(eepic)\n"); exit(1); } fprintf(tfp, "(%d,%d)", p->x, p->y); *************** *** 1374,1380 **** set_linewidth(arc->thickness); if (TeXLang == EEpic) { set_pattern(arc->fill_style, arc->fill_color); ! fprintf(tfp, "\\put(%4.3lf,%4.3lf){", ctr.x, ctr.y); } else { fprintf(tfp, "\\drawline"); } --- 1345,1351 ---- set_linewidth(arc->thickness); if (TeXLang == EEpic) { set_pattern(arc->fill_style, arc->fill_color); ! fprintf(tfp, "\\put(%4.3f,%4.3f){", ctr.x, ctr.y); } else { fprintf(tfp, "\\drawline"); } *************** *** 1396,1402 **** #ifdef DrawOutLine if (OutLine==1) { OutLine=0; ! fprintf(tfp, "\\put(%4.3lf,%4.3lf){", ctr.x, ctr.y); fprintf(tfp, "\\arc{%4.3f}{%2.4f}{%2.4f}}\n", 2*r1, th2, th2+theta); } #endif --- 1367,1373 ---- #ifdef DrawOutLine if (OutLine==1) { OutLine=0; ! fprintf(tfp, "\\put(%4.3f,%4.3f){", ctr.x, ctr.y); fprintf(tfp, "\\arc{%4.3f}{%2.4f}{%2.4f}}\n", 2*r1, th2, th2+theta); } #endif *************** *** 1412,1418 **** #ifdef DrawOutLine if (OutLine==1) { OutLine=0; ! fprintf(tfp, "\\put(%4.3lf,%4.3lf){", ctr.x, ctr.y); fprintf(tfp, "\\arc{%4.3f}{%2.4f}{%2.4f}}\n", 2*r2, th1, th1+theta); } #endif --- 1383,1389 ---- #ifdef DrawOutLine if (OutLine==1) { OutLine=0; ! fprintf(tfp, "\\put(%4.3f,%4.3f){", ctr.x, ctr.y); fprintf(tfp, "\\arc{%4.3f}{%2.4f}{%2.4f}}\n", 2*r2, th1, th1+theta); } #endif *************** *** 1463,1469 **** fprintf(tfp, "\n\t"); pt_count = 1; } ! fprintf(tfp, "(%.3lf,%.3lf)", ctr->x + cos(th1) * r, ctr->y + sin(th1) * r); th1 += delta; } --- 1434,1440 ---- fprintf(tfp, "\n\t"); pt_count = 1; } ! fprintf(tfp, "(%.3f,%.3f)", ctr->x + cos(th1) * r, ctr->y + sin(th1) * r); th1 += delta; } diff -rc transfig.3.2.3/fig2dev/dev/genge.c transfig.3.2.3b/fig2dev/dev/genge.c *** transfig.3.2.3/fig2dev/dev/genge.c Wed Dec 22 13:03:25 1999 --- transfig.3.2.3b/fig2dev/dev/genge.c Tue Jul 11 14:50:31 2000 *************** *** 30,37 **** #define SCALE(v) (round((v)*scale)) #define min(a, b) (((a) < (b)) ? (a) : (b)) - static int coord_system; - static int resolution; static float scale; static set_color(); --- 30,35 ---- *************** *** 101,110 **** int itmp; int clipx, clipy; - resolution = objects->nwcorner.x; - coord_system = objects->nwcorner.y; /* convert dpi to 0.1mm per point */ ! scale = 254.0 / resolution; /* print any whole-figure comments prefixed with "#" */ print_comments("# ",objects->comments, ""); --- 99,106 ---- int itmp; int clipx, clipy; /* convert dpi to 0.1mm per point */ ! scale = 254.0 / ppi; /* print any whole-figure comments prefixed with "#" */ print_comments("# ",objects->comments, ""); diff -rc transfig.3.2.3/fig2dev/dev/genibmgl.c transfig.3.2.3b/fig2dev/dev/genibmgl.c *** transfig.3.2.3/fig2dev/dev/genibmgl.c Wed Dec 22 13:02:31 1999 --- transfig.3.2.3b/fig2dev/dev/genibmgl.c Tue Jul 11 14:50:34 2000 *************** *** 211,222 **** } } - static double ppi; /* pixels/inch */ static double cpi; /* cent/inch */ static double cpp; /* cent/pixel */ static double wcmpp = CMPP; /* centimeter/point */ static double hcmpp = CMPP; /* centimeter/point */ - static int flipped = False; /* flip Y coordinate */ void genibmgl_start(objects) F_compound *objects; --- 211,220 ---- *************** *** 272,279 **** ppi = objects->nwcorner.x; cpi = mag*100.0/sqrt((xu-xl)*(xu-xl) + (yu-yl)*(yu-yl)); cpp = cpi/ppi; - if (objects->nwcorner.y == 2) - flipped = True; /* IBMGL start */ fprintf(tfp, "IN;\n"); /* initialize plotter */ --- 270,275 ---- *************** *** 290,305 **** P2x = Xur; if (reflected) /* upside-down text */ hcmpp = -hcmpp; ! if (reflected^flipped) { /* reflected or flipped */ ! P1y = Yur; /* but not both */ ! P2y = Yll; ! } ! else { /* normal */ P1y = Yll; P2y = Yur; ! } } ! else { /* landscape mode */ Xll = xl*UNITS_PER_INCH; Yll = yl*UNITS_PER_INCH; Yur = yu*UNITS_PER_INCH; --- 286,299 ---- P2x = Xur; if (reflected) /* upside-down text */ hcmpp = -hcmpp; ! if (reflected) { /* reflected */ P1y = Yll; P2y = Yur; ! } else { ! P1y = Yur; ! P2y = Yll; } ! } else { /* landscape mode */ Xll = xl*UNITS_PER_INCH; Yll = yl*UNITS_PER_INCH; Yur = yu*UNITS_PER_INCH; *************** *** 310,329 **** wcmpp = -wcmpp; /* backward text */ P1x = Xur; P2x = Xll; ! } ! else { /* normal */ P1x = Xll; P2x = Xur; - } - if (flipped) { /* reflected or not */ - P1y = Yur; - P2y = Yll; - } - else { - P1y = Yll; - P2y = Yur; - } } Xmin = xz; Ymin = yz; --- 304,316 ---- wcmpp = -wcmpp; /* backward text */ P1x = Xur; P2x = Xll; ! } else { /* normal */ P1x = Xll; P2x = Xur; } + P1y = Yur; + P2y = Yll; + } Xmin = xz; Ymin = yz; *************** *** 558,574 **** dy2 = ey - cy; theta = atan2(dy2, dx2) - atan2(dy1, dx1); ! if (a->direction^flipped) { ! if (theta < 0.0) ! theta += 2.0*M_PI; ! } ! else { if (theta > 0.0) theta -= 2.0*M_PI; ! } if (a->type == T_OPEN_ARC && a->thickness != 0 && a->back_arrow) { ! arc_tangent(cx, cy, sx, sy, a->direction^flipped, &x, &y); draw_arrow_head(x, y, sx, sy, a->back_arrow->ht/ppi, a->back_arrow->wid/ppi); } --- 545,560 ---- dy2 = ey - cy; theta = atan2(dy2, dx2) - atan2(dy1, dx1); ! if (a->direction) { if (theta > 0.0) theta -= 2.0*M_PI; ! } else { ! if (theta < 0.0) ! theta += 2.0*M_PI; ! } if (a->type == T_OPEN_ARC && a->thickness != 0 && a->back_arrow) { ! arc_tangent(cx, cy, sx, sy, !a->direction, &x, &y); draw_arrow_head(x, y, sx, sy, a->back_arrow->ht/ppi, a->back_arrow->wid/ppi); } *************** *** 581,587 **** fprintf(tfp, "EP;\n"); if (a->type == T_OPEN_ARC && a->thickness != 0 && a->for_arrow) { ! arc_tangent(cx, cy, ex, ey, !a->direction^flipped, &x, &y); draw_arrow_head(x, y, ex, ey, a->for_arrow->ht/ppi, a->for_arrow->wid/ppi); } --- 567,573 ---- fprintf(tfp, "EP;\n"); if (a->type == T_OPEN_ARC && a->thickness != 0 && a->for_arrow) { ! arc_tangent(cx, cy, ex, ey, a->direction, &x, &y); draw_arrow_head(x, y, ex, ey, a->for_arrow->ht/ppi, a->for_arrow->wid/ppi); } *************** *** 612,619 **** b = e->radiuses.y/ppi; x0 = e->center.x/ppi; y0 = e->center.y/ppi; ! angle = (flipped ? -e->angle: e->angle); ! delta = (flipped ? -DELTA: DELTA); x = x0 + cos(angle)*a; y = y0 + sin(angle)*a; --- 598,605 ---- b = e->radiuses.y/ppi; x0 = e->center.x/ppi; y0 = e->center.y/ppi; ! angle = -e->angle; ! delta = -DELTA; x = x0 + cos(angle)*a; y = y0 + sin(angle)*a; *************** *** 714,731 **** x0 = llx/ppi; x1 = urx/ppi; dx = l->radius/ppi; ! if (flipped) { ! y0 = ury/ppi; ! y1 = lly/ppi; ! dy = -dx; ! angle = -M_PI/2.0; ! } ! else { ! y0 = lly/ppi; ! y1 = ury/ppi; ! dy = dx; ! angle = M_PI/2.0; ! } fprintf(tfp, "PA%.4f,%.4f;PM;PD;\n", x0, y0 + dy); arc(x0, y0 + dy, x0 + dx, y0 + dy, angle, DELTA); --- 700,709 ---- x0 = llx/ppi; x1 = urx/ppi; dx = l->radius/ppi; ! y0 = ury/ppi; ! y1 = lly/ppi; ! dy = -dx; ! angle = -M_PI/2.0; fprintf(tfp, "PA%.4f,%.4f;PM;PD;\n", x0, y0 + dy); arc(x0, y0 + dy, x0 + dx, y0 + dy, angle, DELTA); diff -rc transfig.3.2.3/fig2dev/dev/genlatex.c transfig.3.2.3b/fig2dev/dev/genlatex.c *** transfig.3.2.3/fig2dev/dev/genlatex.c Wed Nov 24 14:31:00 1999 --- transfig.3.2.3b/fig2dev/dev/genlatex.c Tue Jul 11 14:50:39 2000 *************** *** 110,116 **** char thin_ldot [] = THIN_LDOT; char thick_ldot[] = THICK_LDOT; - static int coord_system; static int verbose = 0; double dash_mag = 1.0; int thick_width = 2; --- 110,115 ---- *************** *** 226,248 **** texfontsizes[0] = texfontsizes[1] = TEXFONTSIZE(font_size?font_size:DEFAULT_FONT_SIZE); - coord_system = objects->nwcorner.y; unitlength = mag/objects->nwcorner.x; dash_mag /= unitlength*80.0; ! switch (coord_system) { ! case 1: ! translate_coordinates = translate1; ! translate_coordinates_d = translate1_d; ! break; ! case 2: ! translate_coordinates = translate2; ! translate_coordinates_d = translate2_d; ! break; ! default: ! fprintf(stderr, "Wrong coordinate system; cannot continue\n"); ! return; ! } TRANS2(llx, lly, urx, ury); if (llx > urx) SWAP(llx, urx) --- 225,235 ---- texfontsizes[0] = texfontsizes[1] = TEXFONTSIZE(font_size?font_size:DEFAULT_FONT_SIZE); unitlength = mag/objects->nwcorner.x; dash_mag /= unitlength*80.0; ! translate_coordinates = translate2; ! translate_coordinates_d = translate2_d; TRANS2(llx, lly, urx, ury); if (llx > urx) SWAP(llx, urx) *************** *** 331,336 **** --- 318,324 ---- TRANS(x, y); fprintf(tfp, "\\put(%3d,%3d){\\makebox(%.4f,%.4f){%s}}\n", x, y, dot_xoffset, dot_yoffset, dot_cmd); + reset_color(l->pen_color); return; } *************** *** 353,358 **** --- 341,347 ---- put_arc_box (llx, lly, urx, ury, l->radius, l->style, l->style_val); else put_box (llx, lly, urx, ury, l->style, l->style_val); + reset_color(l->pen_color); return; } *************** *** 583,589 **** } if (2*dl >= l || (sx && sy && (l/cosine)*unitlength < MIN_LEN)) { fprintf(stderr, "Dashed line too short; drawing solid line\n"); ! put_solidline (x, y, sx, sy, l, arrow, 0); return; } dg = (l - (n/2+1)*dl) / (double)(n/2); --- 572,578 ---- } if (2*dl >= l || (sx && sy && (l/cosine)*unitlength < MIN_LEN)) { fprintf(stderr, "Dashed line too short; drawing solid line\n"); ! put_solidline (x, y, sx, sy, l, arrow, (double) 0.0); return; } dg = (l - (n/2+1)*dl) / (double)(n/2); *************** *** 683,688 **** --- 672,679 ---- /* print any comments prefixed with "%" */ print_comments("% ",e->comments, ""); + set_color(e->pen_color); + set_linewidth(e->thickness); switch (e->style) { case SOLID_LINE: *************** *** 717,722 **** --- 708,715 ---- if (e->fill_style != UNFILLED) fprintf(stderr, "Ellipse area fill not implemented\n"); } + reset_color(e->pen_color); + } void *************** *** 980,1033 **** #define MAXCOLORS 32 set_color(col) int col; { static char *colors[] = { ! "0 0 0", /* black */ ! "0 0 1", /* blue */ ! "0 1 0", /* green */ ! "0 1 1", /* cyan */ ! "1 0 0", /* red */ ! "1 0 1", /* magenta */ ! "1 1 0", /* yellow */ ! "1 1 1", /* white */ ! "1 .84 0", /* gold */ ! "0 0 .56", /* dk blue */ ! "0 0 .69", /* md blue */ ! "0 0 .82", /* lt blue */ ! "0 .56 0", /* dk green */ ! "0 .69 0", /* md green */ ! "0 .82 0", /* lt green */ ! "0 .56 .56", /* dk cyan */ ! "0 .69 .69", /* md cyan */ ! "0 .82 .82", /* lt cyan */ ! ".56 0 0", /* dk red */ ! ".69 0 0", /* md red */ ! ".82 0 0", /* lt red */ ! ".56 0 .56", /* dk magenta */ ! ".69 0 .69", /* md magenta */ ! ".82 0 .82", /* lt magenta */ ! ".5 .17 0", /* dk brown */ ! ".63 .25 0", /* md brown1 */ ! ".75 .38 0", /* md brown1 */ ! ".88 .44 0", /* lt brown */ ! "1 .5 .5", /* dk pink */ ! "1 .63 .63", /* md pink1 */ ! "1 .75 .75", /* md pink2 */ ! "1 .88 .88", /* lt pink */ }; #ifdef DVIPS if (col != -1) { if (col < NUM_STD_COLS) ! fprintf(tfp, "\\special{ps: gsave %s setrgbcolor}", ! colors[col]); else ! fprintf(tfp, "\\special{ps: gsave %.3f %.3f %.3f setrgbcolor}", user_colors[col-NUM_STD_COLS].r/256.0, user_colors[col-NUM_STD_COLS].g/256.0, user_colors[col-NUM_STD_COLS].b/256.0); } #endif return; --- 973,1034 ---- #define MAXCOLORS 32 + /* need this for communication between color routines. Sorry */ + static int lastcolor=-1; + set_color(col) int col; { static char *colors[] = { ! "0,0,0", /* black */ ! "0,0,1", /* blue */ ! "0,1,0", /* green */ ! "0,1,1", /* cyan */ ! "1,0,0", /* red */ ! "1,0,1", /* magenta */ ! "1,1,0", /* yellow */ ! "1,1,1", /* white */ ! "1,.84,0", /* gold */ ! "0,0,.56", /* dk blue */ ! "0,0,.69", /* md blue */ ! "0,0,.82", /* lt blue */ ! "0,.56,0", /* dk green */ ! "0,.69,0", /* md green */ ! "0,.82,0", /* lt green */ ! "0,.56,.56", /* dk cyan */ ! "0,.69,.69", /* md cyan */ ! "0,.82,.82", /* lt cyan */ ! ".56,0,0", /* dk red */ ! ".69,0,0", /* md red */ ! ".82,0,0", /* lt red */ ! ".56,0,.56", /* dk magenta */ ! ".69,0,.69", /* md magenta */ ! ".82,0,.82", /* lt magenta */ ! ".5,.17,0", /* dk brown */ ! ".63,.25,0", /* md brown1 */ ! ".75,.38,0", /* md brown1 */ ! ".88,.44,0", /* lt brown */ ! "1,.5,.5", /* dk pink */ ! "1,.63,.63", /* md pink1 */ ! "1,.75,.75", /* md pink2 */ ! "1,.88,.88", /* lt pink */ }; + #ifdef DVIPS if (col != -1) { + /* we do not support nested colors, although LaTeX would */ + if (lastcolor == -1) + fprintf(tfp, "{"); + /* switch to (other) color */ if (col < NUM_STD_COLS) ! fprintf(tfp, "\\color[rgb]{%s}",colors[col]); else ! fprintf(tfp, "\\color[rgb]{%.3f,%.3f,%.3f}", user_colors[col-NUM_STD_COLS].r/256.0, user_colors[col-NUM_STD_COLS].g/256.0, user_colors[col-NUM_STD_COLS].b/256.0); + lastcolor = col; } #endif return; *************** *** 1037,1044 **** int col; { #ifdef DVIPS ! if (col != -1 && col < NUM_STD_COLS + MAX_USR_COLS) ! fprintf(tfp, "\\special{ps: grestore}"); #endif return; } --- 1038,1049 ---- int col; { #ifdef DVIPS ! if (col != -1 && col < NUM_STD_COLS + MAX_USR_COLS) { ! /* end using the last color */ ! fprintf(tfp, "}%%\n"); ! } ! /* make sure the color indicator is reset */ ! lastcolor = -1; #endif return; } diff -rc transfig.3.2.3/fig2dev/dev/genmap.c transfig.3.2.3b/fig2dev/dev/genmap.c *** transfig.3.2.3/fig2dev/dev/genmap.c Tue Dec 21 09:51:18 1999 --- transfig.3.2.3b/fig2dev/dev/genmap.c Tue Jul 11 14:50:43 2000 *************** *** 380,387 **** } } ! struct ! driver dev_map = { genmap_option, genmap_start, genmap_arc, --- 380,386 ---- } } ! struct driver dev_map = { genmap_option, genmap_start, genmap_arc, diff -rc transfig.3.2.3/fig2dev/dev/genmf.c transfig.3.2.3b/fig2dev/dev/genmf.c *** transfig.3.2.3/fig2dev/dev/genmf.c Wed Nov 24 14:31:04 1999 --- transfig.3.2.3b/fig2dev/dev/genmf.c Tue Jul 11 14:50:46 2000 *************** *** 51,57 **** double *value; } Options; - static double ppi; static double code = 32.0; static int oldpen = 0; static double penscale = 1; --- 51,56 ---- *************** *** 68,74 **** int thickness; { if (thickness != oldpen) { ! fprintf(tfp, "penwd := %.2lfpt;\n", thickness/THICK_SCALE*penscale*yscale*mag); fprintf(tfp, "drawpen := pencircle scaled penwd yscaled aspect_ratio;\n"); oldpen = thickness; --- 67,73 ---- int thickness; { if (thickness != oldpen) { ! fprintf(tfp, "penwd := %.2fpt;\n", thickness/THICK_SCALE*penscale*yscale*mag); fprintf(tfp, "drawpen := pencircle scaled penwd yscaled aspect_ratio;\n"); oldpen = thickness; *************** *** 84,90 **** if (maxy == INFTY) maxy = yu; - ppi = objects->nwcorner.x; curchar = (int)code; fprintf(tfp,"%%\n%% fig2dev -L mf (Version %s Patchlevel %s)\n", --- 83,88 ---- *************** *** 104,111 **** fprintf(tfp,"%%\n%% %s (char %d)\n%%\n", (name? name: ((from) ? from : "stdin")), ++curchar); ! fprintf(tfp,"xscale:=%.3lf; yscale:=%.3lf;\n", xscale*mag, yscale*mag); ! fprintf(tfp,"bounds(%.3lf,%.3lf,%.3lf,%.3lf);\n", xl, xu, yl, yu); fprintf(tfp,"unitlen:=1.0in#;\n"); fprintf(tfp,"beginmfpic(incr code);\n"); setpen(1); --- 102,109 ---- fprintf(tfp,"%%\n%% %s (char %d)\n%%\n", (name? name: ((from) ? from : "stdin")), ++curchar); ! fprintf(tfp,"xscale:=%.3f; yscale:=%.3f;\n", xscale*mag, yscale*mag); ! fprintf(tfp,"bounds(%.3f,%.3f,%.3f,%.3f);\n", xl, xu, yl, yu); fprintf(tfp,"unitlen:=1.0in#;\n"); fprintf(tfp,"beginmfpic(incr code);\n"); setpen(1); *************** *** 181,187 **** if (l->fill_style == BLACK_FILL) fprintf(tfp," filled "); else if (l->fill_style < BLACK_FILL && l->fill_style > 0) ! fprintf(tfp," shade(%lfpt) unfilled", dofill(l)); else if (l->fill_style == 0) fprintf(tfp," drawn unfilled "); else --- 179,185 ---- if (l->fill_style == BLACK_FILL) fprintf(tfp," filled "); else if (l->fill_style < BLACK_FILL && l->fill_style > 0) ! fprintf(tfp," shade(%fpt) unfilled", dofill(l)); else if (l->fill_style == 0) fprintf(tfp," drawn unfilled "); else *************** *** 189,198 **** fprintf(tfp,"polyline(true)\n"); } p = l->points; ! fprintf(tfp," ((%lf, %lf)", p->x/ppi, maxy-(p->y/ppi)); p = p->next; for ( ; p != NULL; p=p->next) { ! fprintf(tfp,",\n (%lf, %lf)", p->x/ppi, maxy-(p->y/ppi)); } fprintf(tfp, ");\n"); return; --- 187,196 ---- fprintf(tfp,"polyline(true)\n"); } p = l->points; ! fprintf(tfp," ((%f, %f)", p->x/ppi, maxy-(p->y/ppi)); p = p->next; for ( ; p != NULL; p=p->next) { ! fprintf(tfp,",\n (%f, %f)", p->x/ppi, maxy-(p->y/ppi)); } fprintf(tfp, ");\n"); return; *************** *** 216,222 **** if (s->fill_style == BLACK_FILL) fprintf(tfp," filled "); else if (s->fill_style < BLACK_FILL && s->fill_style > 0) ! fprintf(tfp," shade(%lfpt) unfilled ", dofill(s)); else if (s->fill_style == 0) fprintf(tfp," drawn unfilled "); else --- 214,220 ---- if (s->fill_style == BLACK_FILL) fprintf(tfp," filled "); else if (s->fill_style < BLACK_FILL && s->fill_style > 0) ! fprintf(tfp," shade(%fpt) unfilled ", dofill(s)); else if (s->fill_style == 0) fprintf(tfp," drawn unfilled "); else *************** *** 224,233 **** fprintf(tfp,"curve(true)\n"); } p = s->points; ! fprintf(tfp," ((%lf, %lf)", p->x/ppi, maxy-(p->y/ppi)); p = p->next; for ( ; p != NULL; p=p->next) { ! fprintf(tfp,",\n (%lf, %lf)", p->x/ppi, maxy-(p->y/ppi)); } fprintf(tfp, ");\n"); return; --- 222,231 ---- fprintf(tfp,"curve(true)\n"); } p = s->points; ! fprintf(tfp," ((%f, %f)", p->x/ppi, maxy-(p->y/ppi)); p = p->next; for ( ; p != NULL; p=p->next) { ! fprintf(tfp,",\n (%f, %f)", p->x/ppi, maxy-(p->y/ppi)); } fprintf(tfp, ");\n"); return; *************** *** 246,262 **** if (e->fill_style == BLACK_FILL) fprintf(tfp," filled "); else if (e->fill_style < BLACK_FILL && e->fill_style > 0) ! fprintf(tfp," shade(%lfpt) ", dofill(e)); else fprintf(tfp," drawn "); if (e->type == 3 || e->type == 4) { ! fprintf(tfp,"circle((%lf,%lf),%lf);\n", e->center.x/ppi, maxy-(e->center.y/ppi), e->radiuses.x/ppi); } else if (e->type == 1 || e->type == 2) { ! fprintf(tfp,"ellipse((%lf,%lf),%lf,%lf,0);\n", e->center.x/ppi, maxy-(e->center.y/ppi), e->radiuses.x/ppi, e->radiuses.y/ppi); } --- 244,260 ---- if (e->fill_style == BLACK_FILL) fprintf(tfp," filled "); else if (e->fill_style < BLACK_FILL && e->fill_style > 0) ! fprintf(tfp," shade(%fpt) ", dofill(e)); else fprintf(tfp," drawn "); if (e->type == 3 || e->type == 4) { ! fprintf(tfp,"circle((%f,%f),%f);\n", e->center.x/ppi, maxy-(e->center.y/ppi), e->radiuses.x/ppi); } else if (e->type == 1 || e->type == 2) { ! fprintf(tfp,"ellipse((%f,%f),%f,%f,0);\n", e->center.x/ppi, maxy-(e->center.y/ppi), e->radiuses.x/ppi, e->radiuses.y/ppi); } *************** *** 271,277 **** setpen(a->thickness); fprintf(tfp, " store (curpath)\n"); ! fprintf(tfp," drawn arcppp((%lf,%lf), (%lf,%lf), (%lf,%lf));\n", a->point[0].x/ppi, maxy-(a->point[0].y/ppi), a->point[1].x/ppi, maxy-(a->point[1].y/ppi), a->point[2].x/ppi, maxy-(a->point[2].y/ppi)); --- 269,275 ---- setpen(a->thickness); fprintf(tfp, " store (curpath)\n"); ! fprintf(tfp," drawn arcppp((%f,%f), (%f,%f), (%f,%f));\n", a->point[0].x/ppi, maxy-(a->point[0].y/ppi), a->point[1].x/ppi, maxy-(a->point[1].y/ppi), a->point[2].x/ppi, maxy-(a->point[2].y/ppi)); diff -rc transfig.3.2.3/fig2dev/dev/genpdf.c transfig.3.2.3b/fig2dev/dev/genpdf.c *** transfig.3.2.3/fig2dev/dev/genpdf.c Wed Nov 24 14:31:06 1999 --- transfig.3.2.3b/fig2dev/dev/genpdf.c Tue Jul 11 14:50:49 2000 *************** *** 18,24 **** * * Author: Brian V. Smith * Uses genps functions to generate PostScript output then ! * calls ps2pdf (which uses ghostscript) to convert it to pdf. */ #if defined(hpux) || defined(SYSV) || defin