From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- media-gfx/transfig/Manifest | 21 + .../transfig/files/transfig-3.2.5-solaris.patch | 12 + .../files/transfig-3.2.5c-maxfontsize.patch | 44 + .../transfig/files/transfig-3.2.5d-MAXWIDTH.patch | 19 + .../files/transfig-3.2.5d-fig2mpdf-r1.patch | 1425 ++++++++++++++++++++ .../transfig/files/transfig-3.2.5d-leadspace.patch | 19 + .../files/transfig-3.2.5d-libpng-1.5.patch | 39 + .../transfig/files/transfig-3.2.5d-precision.patch | 45 + .../transfig-3.2.5e-fprintf_format_warnings.patch | 55 + .../files/transfig-3.2.5e-man-hyphen.patch | 530 ++++++++ .../transfig/files/transfig-3.2.5e-typos.patch | 25 + media-gfx/transfig/files/transfig-ru_RU.CP1251.ps | 298 ++++ media-gfx/transfig/files/transfig-ru_RU.KOI8-R.ps | 298 ++++ media-gfx/transfig/files/transfig-uk_UA.KOI8-U.ps | 298 ++++ media-gfx/transfig/metadata.xml | 7 + media-gfx/transfig/transfig-3.2.5d-r1.ebuild | 94 ++ media-gfx/transfig/transfig-3.2.5e.ebuild | 93 ++ 17 files changed, 3322 insertions(+) create mode 100644 media-gfx/transfig/Manifest create mode 100644 media-gfx/transfig/files/transfig-3.2.5-solaris.patch create mode 100644 media-gfx/transfig/files/transfig-3.2.5c-maxfontsize.patch create mode 100644 media-gfx/transfig/files/transfig-3.2.5d-MAXWIDTH.patch create mode 100644 media-gfx/transfig/files/transfig-3.2.5d-fig2mpdf-r1.patch create mode 100644 media-gfx/transfig/files/transfig-3.2.5d-leadspace.patch create mode 100644 media-gfx/transfig/files/transfig-3.2.5d-libpng-1.5.patch create mode 100644 media-gfx/transfig/files/transfig-3.2.5d-precision.patch create mode 100644 media-gfx/transfig/files/transfig-3.2.5e-fprintf_format_warnings.patch create mode 100644 media-gfx/transfig/files/transfig-3.2.5e-man-hyphen.patch create mode 100644 media-gfx/transfig/files/transfig-3.2.5e-typos.patch create mode 100644 media-gfx/transfig/files/transfig-ru_RU.CP1251.ps create mode 100644 media-gfx/transfig/files/transfig-ru_RU.KOI8-R.ps create mode 100644 media-gfx/transfig/files/transfig-uk_UA.KOI8-U.ps create mode 100644 media-gfx/transfig/metadata.xml create mode 100644 media-gfx/transfig/transfig-3.2.5d-r1.ebuild create mode 100644 media-gfx/transfig/transfig-3.2.5e.ebuild (limited to 'media-gfx/transfig') diff --git a/media-gfx/transfig/Manifest b/media-gfx/transfig/Manifest new file mode 100644 index 000000000000..d34481bb2cd1 --- /dev/null +++ b/media-gfx/transfig/Manifest @@ -0,0 +1,21 @@ +AUX transfig-3.2.5-solaris.patch 263 SHA256 ef80b926734637eea2cf55c35746d5c1f405ddcbcce989136d223d79668fa995 SHA512 ea76ae31b050a80bf8321a554d0d5c0f1a300cc27b063b5cda6194c465757f7fd00916fee08d69369740a59850fa978a700e7c780911db5fcf04a1c23818f8f2 WHIRLPOOL 69b897dda43c1d56c35b1c0476c93b953bdf3dbcc61717d991f415c6d8ffd93a3e4bb94c086635ad706a5d1d33a4902fca62e015819c4012f19d670ca4c6cabc +AUX transfig-3.2.5c-maxfontsize.patch 1956 SHA256 b3f1ff76e940a7912f7617a62355d1cc0aec6cc793da1d2472fb3dcb4c2744c6 SHA512 f135d99d69988d5d4f0ab803ece9d2d88e1ef2e0605887328a92d3cbca561dc20869dbd8f6aa3eee9e59d74786eafcd3552e2076bff46b1c8002724c94a6247a WHIRLPOOL 0e6fe8b9164e771f447b454dda148f54234571a977fadee1b4c733e45c6d9d430e03b88ae6ff55b76fd3e1028cf4530f6ab5d85b42569bf95ee62a51923aa371 +AUX transfig-3.2.5d-MAXWIDTH.patch 637 SHA256 0a9ea3f1aabf2110e348e8cd789bd9863b3f9ec5ce729041b491d13beca71df4 SHA512 fe5d4afca4b57e6cde61f91d6ddf4be4ed83fee2ecb07c796ad95c8a5a96a19592abec0b520505030e0d00bd1bb1192bb90a9f0f0c95eb3f6c70266e598492a6 WHIRLPOOL eab17b7e3a03421a1b7f191e5ea01bec7e0804c47a1318089250922c8a5b6e0d0be562c503c622ed05d61f0b1f8aa22883e9f6c9fa0c31ab607a7c290ea49541 +AUX transfig-3.2.5d-fig2mpdf-r1.patch 41613 SHA256 13360b2bd5916b459b3b1debf18f66fbe8abead874b2eea1c77e09ffa404a85a SHA512 cac4ce672f1c9ba0f97243d8e550e9191676006f8ad6a3584a48e3f557af1e2ade1584f652fe812bf07250ad0e56fffd8f2d63b4827921e98a120ef635c62fc2 WHIRLPOOL 7467996c4b2ef5a1730d7595df6227b133c561793e327bf3bbf14b295c8cd2167cb94a002ba3711973adab38fa4d54dc380d8774ed15aa81e4b2a21deb6f94ae +AUX transfig-3.2.5d-leadspace.patch 725 SHA256 dbb22b727835186d5c9422decf130cf2b292b7fde288aa212b9e52144de4f79f SHA512 70b3f171f028febee8689bcbca66d67de524c734bd09a978eae40b9c15ade06d884380e77dccd69518a2af286e4f3033b1aedd188871b4a5c701e020fc2607d5 WHIRLPOOL a14b46505dc2f2ccb6ce15dca16f3b0ff9f10b3c544302d691341dc83529d3736769b56a5b8d42e95e7a084dc2ad3b934f3b393cbc4430f7870daae3c27b6357 +AUX transfig-3.2.5d-libpng-1.5.patch 1449 SHA256 8621fc408f700225ff9498f0743afabb135c729b244a2bcafd3418692d2a4230 SHA512 66c0018a62a22cec02df59ac80326e0d77399190b66a7df125886bb76d1e682655ef1a498e940b7ab0a5e12e2156dc98b3d88a5d81513a47154ebf4c62ba02dc WHIRLPOOL cccf802ab472fb76ed4f1e306a60560927bdcca647f339da3038790664092e41a61f1a6fdc17aee00833f474c66e43ea8d83ef4d0a9f8afc1fdca53f42a7d955 +AUX transfig-3.2.5d-precision.patch 1633 SHA256 e2d4c992e438df5271d462cae48c5472a485517fb4093577c4461b6f97e45bb0 SHA512 8ed38b2f295da48a56049368f0643b8e1c26d06c3a340c81999e67608ec70854d72703ae81be89006efb54a0a9a4145b71100c4dc48d9602dd1cb86545cf2763 WHIRLPOOL dc27333136aeeb83082d2e857dba2086ddd0f80ebfda24447bd8e6290ce069daa8db0ad9d6ff6ec1e07ecd021526a457d7fdd68038512bdb3103136677396bad +AUX transfig-3.2.5e-fprintf_format_warnings.patch 1463 SHA256 359845d2da3b7273d8e85d7a4fe8b9ec39b0cdfea02fb2da3276b353c937d6d1 SHA512 28d85316b96d371fb1c8459ebcccf5f482f66c94edc7b11830007c10d7fb0d444430af36f951bde1c49f4b313fce4585454913bce179814de20154bf755647cf WHIRLPOOL d0a58d5664123c22e4b325d6ccd32985a6bc52cdee2deb97e25c221dbe9e38835474899990e3badd7de426a840d15963138a0728f2a5a90b635c120eebc6a902 +AUX transfig-3.2.5e-man-hyphen.patch 16349 SHA256 85d64fcc42bf0e1c14ac4a621535e1a778e9164f840f2c2d077c5d42fadc0266 SHA512 61a0ee8b5e91929806d1255cf18e4431142c59855285c381fb983241ebda8b6c4c9186a152f1cd448190cb144ffb8a5c7d8b8d7d17c789909edebdb0bd71ab32 WHIRLPOOL b8ddbf572c6d317d9fcc549f7cf725740ede1887e0de32e14c3cdd284d3188fffcb8ff62c1f401681a2ac26221a6e8e264d5aca2e8a7e4b0f0e96760a37624e8 +AUX transfig-3.2.5e-typos.patch 801 SHA256 755994323cff774c7f6e48834a98048998fdabd44de9ce152cf2035fd0cc5e86 SHA512 2cdc36f2361a2606164688d18ae8a2e23debb6d16b656bf0f3762d52a2a6175c7b279bb6ee3226f3f884ca043b03ce39aec9870800890eff017f6734486c3707 WHIRLPOOL 0f7dff1b45a789e03f83027ae49ffc1fdb14619c2b396d5f0c537de58f17dd90036697e81c654da4638cba4bafd94bf96b74c132c2cb5ab2932b330959ef9c02 +AUX transfig-ru_RU.CP1251.ps 6079 SHA256 8b3ce8f098776fb8ed1623903fe4af70e439d708e6b58444c72023c2b4d45a3c SHA512 aba314ed3ec3ff2f2b07c97195d1059c0c64f6c5dbfeb41b93bc0d3bb77becffffbaae8aecf552d27f3fc337d23e150601c0dd703997bba9fc18b154c89ddda1 WHIRLPOOL 4c4cc3c24d8b6f84533262abc795fc47ea7e848447b6ea72c8fcb98d3673523d90baaf04731f3ff40f78143a0492763bd7258247690d1cd560d2736290e3165e +AUX transfig-ru_RU.KOI8-R.ps 6015 SHA256 af71380057217460eb476e9a6800e3c7bbe22db44420d0d5d6939bd3321a4c86 SHA512 1222403ca7fa7e1a796e46e9693237d9a7afa8889e66af17b5c705f0383ab32382a21a499059f0fef5b6a3640385f74da77e5d1a8e4406ef1c635e48a551885d WHIRLPOOL 6c661b755be14a959d62f2f7fbe9e6fad8d335bc8fa32686b5b1042dd5057b45025303f1f8fe493b7783e888f6d3b0a78249d381846a6903c9f55dba79f33f94 +AUX transfig-uk_UA.KOI8-U.ps 6023 SHA256 b71427fb5e938ee285aea7290af41bcfc1f6820520f5ca7a2746dd51c00b5eee SHA512 e7dd914414594e27e38905c114e9ce86a29a551facadf08ba8beb7087e5e30e400a3e3cc4472d31dce3b2f0cf1b864806915c71efd76b518d3a815a98bb2d020 WHIRLPOOL eb1f5579de8c4845db836a4cb418bf9205a47d2c938626ff6b4a4bf59241c833d6967d5b40c32fdaf6965fabb62090a596586be0b272dc6636aec2d13e46eaec +DIST fig2mpdf-1.1.2.tar.bz2 191438 SHA256 35f02293592244d5ff4a7a60e00023696c05dec855495871226c67669ba4daf3 SHA512 36dea40008371386b47a4451e2f311cc2540ab063e3b61e628a535775d62a8840c5cc20c37b80465184bf041c6e583aaf3e5156079e72211d0a87ff3346d2980 WHIRLPOOL 73f98e0c8f26a0a9f5a06ba38169a107587dd09ecce69c69d251d46274697db7a1923479030693bf9079705820ce67b3df62d0de54492039acd0ac71f4f22fa7 +DIST transfig.3.2.5d.tar.gz 497451 SHA256 ae81214177fb05f91f6e43b0b42633b6e0024570cbc6591a3858e12100ce8aaa SHA512 6e9b9551bf3bff7a94d6a0d8bac336c36b2721f9babc4cf38472737ac737afd27f93dcb012e510d6c439c6aaeed95ba03b19508b4229386915c0dc0751daac10 WHIRLPOOL ca503a9ba228f54d20a6771dfca9dd0e6bb127618db8bc94bf1a62149e007627786fe2eee8f15a47723781d8381950cfac97264b5846550f7c669a8d8c82a1f2 +DIST transfig.3.2.5e.tar.gz 531256 SHA256 8ec5a8f13254dd155622ed3ee0fda1382b1e2b5882d83b9aca1871f12a3e7744 SHA512 ed1379f1112514d90a4b3eecd3222baad311d804b5090e8e66867ec299e4f9a5f8d83ef8939aa6ecaa85a18143b8fb9b97f78e078ac5eeb934a158c55de6bb1e WHIRLPOOL a781dd6fd85ff7ff12219444a8fbc91fc8c7f6fe1b4628cc1fd6bb3feae29392edc62a8f3a4db0945bdf2e67a67af7046864826024acdbaa8a8581a873cdb82f +EBUILD transfig-3.2.5d-r1.ebuild 2701 SHA256 9be7d58284c642cdc319296cc520e19aac33392e5dfb20b141d67ccdd94a27fe SHA512 fc31324d34c7fad3f117018162abc8d945efceb819ad7572df9368d00d6d4c77cd47114a4a915c0dcb41cf70f18db7e21ef4126b298fae05c31fdf422c718cc7 WHIRLPOOL d7de72d5d97e449401c70ad8ca5e17fc71e7035441065dd0605c0e5850d09ac76d7e33407d7734bfad0d309c50e85758f986902075b386d523edca51c4f2b206 +EBUILD transfig-3.2.5e.ebuild 2702 SHA256 80b07c142896fbf0b47a36520786a0dedf9a8d98851206c1701a500feb776014 SHA512 1ce1d7e1473553ccf7bee8a5e8b2e677da6c2347b6a272528e6596cabea100ab2d9565d8954473e812d561fd2da24779d8bc7fd8c64584a3369386c09661043b WHIRLPOOL 3de68fc233d35f2607fdc1735992b8540ba92e64c164bf655e9c634648397b93b0b5997bc83939a58cfa4ee12f03b6cf93c1d5c84d9a7570e0f738817d1ae536 +MISC ChangeLog 2938 SHA256 6403e9d91d7ce6cafd604d5397bf606d26d279ab2fb0fa52dccb13827ea4d90d SHA512 7dca29c5c4796e1780441376b73373f0a6881b6829dc2198c038de23c4480cc815d62eb0cfe912c9c856282b13c89d793e36c69d414f5cb9305d532262f50ce6 WHIRLPOOL 61a5715ce41e7aaec78b9ad8d0a10679d0ec3e6c21315240b70cdf81997bbac4da495e0761516e29dd11bb75935b67d69ea8647043745e1451d12c80448fc486 +MISC ChangeLog-2015 12854 SHA256 df42b41e6259d566fa4f7ba91f8d09f88881f39d3b05740a2046e927ac12bb05 SHA512 9474319e26af282a9d52befb8dc569b6464efd8bb704cf986d8d85a7f3cdcbbd64569c9e8ded50510d9868438b6ca26547818581da08993d3b378f39bfc15419 WHIRLPOOL 1ee16d1fcd5f8199e1a96988d7b9bdb980e3ee23a592ceedcc20f069ec36409a579198af1ab4aecdd107846ba7f7caa7f15180fc0d708bbaca4c388f86996d81 +MISC metadata.xml 212 SHA256 00d100e8d1bbfee4c0e3dcd7695c183150d06133fddd672e246c21bc02c4c8d7 SHA512 05c3af7b4c872998a64d3d6dce356ad1bfeb67f4ec845e82e022a89c96945ba5fe8848df48b8736feb39bd4d9a7d6714f0895a9c824e3c67d903ea3da1ca0f22 WHIRLPOOL 1fd2058c94f0e8891205ed1e106759e99c8bd0f765618fc2fc801e566241b062a1219f5044b8b7ed1299b28a189846c2d125ea86b71f72e9fa403ad3f0dea4b3 diff --git a/media-gfx/transfig/files/transfig-3.2.5-solaris.patch b/media-gfx/transfig/files/transfig-3.2.5-solaris.patch new file mode 100644 index 000000000000..680a0591f1cf --- /dev/null +++ b/media-gfx/transfig/files/transfig-3.2.5-solaris.patch @@ -0,0 +1,12 @@ +Fixes complation error on both Darwin and Solaris + +--- fig2dev/fig2dev.h ++++ fig2dev/fig2dev.h +@@ -20,6 +20,7 @@ + #include "patchlevel.h" + #include + #include ++#include + #include + #include + #include diff --git a/media-gfx/transfig/files/transfig-3.2.5c-maxfontsize.patch b/media-gfx/transfig/files/transfig-3.2.5c-maxfontsize.patch new file mode 100644 index 000000000000..9ce105fe9355 --- /dev/null +++ b/media-gfx/transfig/files/transfig-3.2.5c-maxfontsize.patch @@ -0,0 +1,44 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 09_maxfontsize.dpatch by Roland Rosenfeld +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: For fonts >=42pt use the given font size in TeX instead of +## DP: restricting this to 42pt. This allows to create posters using +## DP: \usepackage{type1cm}. See +## DP: http://linuxgazette.vlsm.org/issue96/artime.html and Bug#343139 + +@DPATCH@ +diff -urNad transfig~/LATEX.AND.XFIG transfig/LATEX.AND.XFIG +--- transfig~/LATEX.AND.XFIG ++++ transfig/LATEX.AND.XFIG +@@ -55,7 +55,7 @@ + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LaTeX Preamble %%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +-\documentstyle[12pt,bezier,amstex]{article} % include bezier curves ++\documentclass[12pt,bezier,amstex]{article} % include bezier curves + \renewcommand\baselinestretch{1.0} % single space + \pagestyle{empty} % no headers and page numbers + \oddsidemargin -10 true pt % Left margin on odd-numbered pages. +@@ -72,7 +72,9 @@ + \usepackage{epsfig} + + \usepackage{graphicx} % Graphics package +- ++ ++\usepackage{type1cm} % Necessary for fonts bigger than 42pt ++ + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Document Beginning %%%%%%%%%%%%%%%%%%%%% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +diff -urNad transfig~/fig2dev/dev/texfonts.h transfig/fig2dev/dev/texfonts.h +--- transfig~/fig2dev/dev/texfonts.h ++++ transfig/fig2dev/dev/texfonts.h +@@ -86,6 +86,7 @@ + + #define TEXFONTSIZE(S) (texfontsizes[((S) <= MAXFONTSIZE) ? (int)(round(S))\ + : (MAXFONTSIZE-1)]) ++#define TEXFONTSIZE(S) (((S) <= MAXFONTSIZE) ? texfontsizes[(int)(round(S))] : (S)) + #define TEXFONTMAG(T) TEXFONTSIZE(T->size*(rigid_text(T) ? 1.0 : fontmag)) + + void setfigfont( F_text *text ); /* genepic.c */ diff --git a/media-gfx/transfig/files/transfig-3.2.5d-MAXWIDTH.patch b/media-gfx/transfig/files/transfig-3.2.5d-MAXWIDTH.patch new file mode 100644 index 000000000000..3ac14818655a --- /dev/null +++ b/media-gfx/transfig/files/transfig-3.2.5d-MAXWIDTH.patch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## 23_MAXWIDTH.dpatch by Roland Rosenfeld +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Increasese MAXWIDTH of embedded images from 8K to 16K (Closes: #610466) + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2dev/dev/psencode.c transfig/fig2dev/dev/psencode.c +--- transfig~/fig2dev/dev/psencode.c ++++ transfig/fig2dev/dev/psencode.c +@@ -18,7 +18,7 @@ + + #include "fig2dev.h" + +-#define MAXWIDTH 8192 ++#define MAXWIDTH 16384 + + #define put_string nc=strlen(s); for(i=0;i +## +## All lines beginning with `## DP:' are a description of the patch. + +## DP: creating multilayered or singlelayer PDF or EPS figures for +## DP: including into LaTeX documents. +## DP: http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/doc/fig2dev.1 transfig/doc/fig2dev.1 +--- transfig~/doc/fig2dev.1 ++++ transfig/doc/fig2dev.1 +@@ -53,8 +53,8 @@ + \fBbox, cgm, epic, eepic, eepicemu, emf, eps, gbx (Gerber beta driver), gif, ibmgl, jpeg, + latex, map (HTML image map), mf (MetaFont), + mp (MetaPost), mmp (Multi-MetaPost), +-pcx, pdf, pdftex, pdftex_t, pic, pictex, png, ppm, ps, +-pstex, pstex_t, pstricks, ptk (Perl/tk), ++pcx, pdf, pdftex, pdftex_t, pdftex_p, pic, pictex, png, ppm, ps, ++pstex, pstex_t, pstex_p, pstricks, ptk (Perl/tk), + shape (LaTeX shaped paragraphs), sld (AutoCad slide format), + svg (beta driver), textyl, + tiff, tk (tcl/tk), tpic, xbm and +@@ -1062,6 +1062,62 @@ + font. Option 1 sets LaTeX font size only. Option 2 issues no font + commands at all. + ++.SH PSTEX_P and PDFTEX_P OPTIONS ++The \fBpstex_p\fR language has the same intention as ++the combination of \fBpstex\fR and \fBpstex_t\fR. ++The only reason to use \fBpstex_p\fR is that you have partially overlayed texts. ++\fBpstex_p\fR splits the Fig file concerning the depths of existing texts. Because ++of it's necessary to get the resulting size of the figure for the pdf document ++you have to specify the target document format ++(i.e. using \fBpstex_p\fR rsp. \fBpdftex_p\fR). ++.br ++Two files results by using this language: ++.br ++.HP +.3i ++1) A bash script for creating and removing the necessary graphics files. ++Extension: \fB.create\fR ++.HP +.3i ++.HP +.3i ++2) The latex code which includes all graphics files and special texts. Content is ++put to stdout. ++ ++.TP ++The \fBpstex_p\fR driver has the following special options: ++ ++.TP ++.B \-p basename ++specifies the basename of the files to be created (see (1) above). This option ++is mandatory. ++.TP ++.B "\-d dmag" ++Set a separate magnification for the length of line dashes to ++.I dmag. ++.TP ++.B \-E num ++Set encoding for latex text translation (0 no translation, 1 ISO-8859-1, 2 ISO-8859-2) ++.TP ++.B "\-l lwidth" ++Sets the threshold between LaTeX thin and thick lines to ++.I lwidth ++pixels. ++LaTeX supports only two different line width: \\thinlines and \\thicklines. ++Lines of width greater than ++.I lwidth ++pixels are drawn as \\thicklines. ++Also affects the size of dots in dotted line style. ++The default is 1. ++.TP ++.B \-v ++Verbose mode. ++.TP ++.B \-F ++Don't set the font face, series, and style; only set it's size and the ++baselineskip. By default, fig2dev sets all 5 font parameters when it ++puts some text. The disadvantage is that you can't set the font from your ++LaTeX document. With this option on, you can set the font from your LaTeX ++document (like "\fB\\sfshape \\input picture.eepic\fR"). ++ ++ + .SH TK and PTK OPTIONS (tcl/tk and Perl/tk) + .TP + .B \-l dummy_arg +@@ -1107,6 +1163,13 @@ + .PP + Rotated text is only supported in the IBM-GL (HP/GL) and PostScript (including eps) + languages. ++.PP ++In \fBpdftex_p\fR language \fIfig2dev\fR can not determine the exact sizes of ++the special texts set by pdflatex afterwards. If these texts are bigger than ++expected the calculated bounding box might be too small so that some texts passes ++over the figure boundaries. If this happen you have to put an invisible ++rectangle (line width 0) around the text or the entire figure. ++ + .SH COPYRIGHT + Copyright (c) 1991 Micah Beck + .br +@@ -1187,3 +1250,7 @@ + The GBX (Gerber) driver was written by + .br + Edward Grace (ej.grace@imperial.ac.uk). ++.sp ++The PSTEX_P and PDFTEX_P drivers (overlayed LaTeX texts) was written by ++.br ++Michael Pfeiffer (p3f@gmx.de) +diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2dev/dev/genpstex.c transfig/fig2dev/dev/genpstex.c +--- transfig~/fig2dev/dev/genpstex.c ++++ transfig/fig2dev/dev/genpstex.c +@@ -70,7 +70,307 @@ + genps_end (); + + static char pstex_file[1000] = ""; ++static int iObjectsRead = 0; ++static int iTextRead = 0; ++static int iObjectsFileNumber = 0; ++static int iStartDepth; ++static int iLastDepth; ++static FILE * ptCreateFile; ++static char szFileName[1000]; ++static int iLength; ++static int iPdfOutputs = 0; ++ ++#ifdef never ++static double unitlength; ++static double dash_mag = 1.0; ++ ++static int (*translate_coordinates)() = NULL; ++static int (*translate_coordinates_d)() = NULL; ++#else ++extern double unitlength; ++extern double dash_mag; ++ ++extern int (*translate_coordinates)(); ++extern int (*translate_coordinates_d)(); ++#endif ++ ++#define TOP 840 ++#define SWAP(x,y) {tmp=x; x=y; y=tmp;} ++#define TRANS(x,y) (*translate_coordinates)(&x,&y) ++#define TRANS2(x1,y1,x2,y2) (*translate_coordinates)(&x1,&y1); \ ++ (*translate_coordinates)(&x2,&y2) ++#define TRANSD(x,y) (*translate_coordinates_d)(&x,&y) ++ ++static void genpstex_p_finalize_objects(int depth); ++ ++/************************************************************************* ++ *************************************************************************/ ++static ++translate2(xp, yp) ++ int *xp, *yp; ++{ ++ *xp = *xp + 1; ++ *yp = (double)(TOP - *yp -1); ++ } ++ ++static ++translate1_d(xp, yp) ++ double *xp, *yp; ++{ ++ *xp = *xp + 1.0; ++ *yp = *yp + 1.0; ++ } ++ ++static ++translate2_d(xp, yp) ++ double *xp, *yp; ++{ ++ *xp = *xp + 1.0; ++ *yp = (double)TOP - *yp -1.0; ++ } ++ ++/************************************************************************* ++ *************************************************************************/ ++void genpstex_p_option(opt, optarg) ++char opt, *optarg; ++{ ++ if (opt == 'p') ++ { ++ strcpy(pstex_file, optarg); ++ } ++ else ++ genlatex_option(opt, optarg); ++} ++ ++ ++/************************************************************************* ++ *************************************************************************/ ++void genpstex_p_start(objects) ++ F_compound *objects; ++{ ++ int tmp; ++ struct stat tStat; ++ long lUnitLength; ++ ++ if (*pstex_file == '\0') ++ { ++ put_msg("Argument -p is mandatory to pstex_p."); ++ exit(1); ++ } ++ ++ strncpy(szFileName, pstex_file, 900); ++ iLength = strlen(szFileName); ++ ++ sprintf(szFileName + iLength, ".create"); ++ ptCreateFile = fopen (szFileName, "wb"); ++ ++ if ( ! ptCreateFile) ++ { ++ put_msg("Couldn't open %s for writing", szFileName); ++ exit(1); ++ } ++ fstat(fileno(ptCreateFile), & tStat); ++ fchmod (fileno(ptCreateFile), tStat.st_mode | ((tStat.st_mode & (S_IRUSR | S_IRGRP | S_IROTH)) >> 2)); ++ fprintf(ptCreateFile, "#!/bin/bash\n\n", szFileName); ++ ++ fprintf(ptCreateFile, "while getopts \"r\" Option\n"); ++ fprintf(ptCreateFile, "do\n"); ++ fprintf(ptCreateFile, " case $Option in\n"); ++ fprintf(ptCreateFile, " r) iOptRemove=1;;\n"); ++ fprintf(ptCreateFile, " *) echo \"illegal option -$Option\"\n"); ++ fprintf(ptCreateFile, " esac\n"); ++ fprintf(ptCreateFile, "done\n"); ++ fprintf(ptCreateFile, "shift $(($OPTIND - 1))\n"); ++ ++ texfontsizes[0] = texfontsizes[1] = ++ TEXFONTSIZE(font_size != 0.0? font_size : DEFAULT_FONT_SIZE); ++ ++ unitlength = mag/ppi; ++ dash_mag /= unitlength*80.0; ++ ++ translate_coordinates = translate2; ++ translate_coordinates_d = translate2_d; ++ ++ TRANS2(llx, lly, urx, ury); ++ if (llx > urx) SWAP(llx, urx) ++ if (lly > ury) SWAP(lly, ury) ++ ++ /* LaTeX start */ ++ ++ /* print any whole-figure comments prefixed with "%" */ ++ if (objects->comments) { ++ fprintf(tfp,"%%\n"); ++ print_comments("% ",objects->comments, ""); ++ fprintf(tfp,"%%\n"); ++ } ++ ++ lUnitLength = (long) (round(4736286.72*unitlength)); ++ fprintf(tfp, "\\setlength{\\unitlength}{%lisp}%%\n", ++ lUnitLength); ++ /* define the SetFigFont macro */ ++ define_setfigfont(tfp); ++ ++ sprintf(szFileName + iLength, ".size"); ++ fprintf(ptCreateFile, "if [ \"$iOptRemove\" == \"\" ]; then\n"); ++ if (iPdfOutputs) ++ fprintf(ptCreateFile, " echo \"\\setlength\\pdfpagewidth{%3.2fpt}\\setlength\\pdfpageheight{%3.2fpt}\" > %s\n", ++ (float) lUnitLength / 65536 * (urx - llx), (float) lUnitLength / 65536 * (ury - lly), szFileName); ++ else ++ fprintf(ptCreateFile, "echo -n\"\" > %s\n", szFileName); ++ fprintf(ptCreateFile, "else\n rm -f %s\nfi\n", szFileName); ++} ++ ++/************************************************************************* ++ *************************************************************************/ ++void genpdftex_p_start(objects) ++ F_compound *objects; ++{ ++ iPdfOutputs = 1; ++ genpstex_p_start(objects); ++} ++ ++ ++/************************************************************************* ++ *************************************************************************/ ++int genpstex_p_end() ++{ ++ if (iTextRead) ++ { ++ fprintf(tfp, "\\end{picture}%%\n"); ++ iTextRead = 0; ++ } ++ if (iObjectsRead) ++ { ++ genpstex_p_finalize_objects(iLastDepth); ++ iObjectsRead = 0; ++ } ++ ++ /* LaTeX ending */ ++ fprintf(tfp, "\\begin{picture}(%d,%d)\n", urx-llx, ury-lly); ++ fprintf(tfp, "\\end{picture}%%\n"); ++ ++ fclose(ptCreateFile); ++ ++ /* all ok */ ++ return 0; ++} ++ ++ ++/************************************************************************* ++ *************************************************************************/ ++void genpstex_p_finalize_objects(depth) ++int depth; ++{ ++ char szFileName[1000]; ++ int iLength; ++ ++ strncpy(szFileName, pstex_file, 900); ++ iLength = strlen(szFileName); ++ ++ ++ sprintf(szFileName + iLength, "%03d", iObjectsFileNumber++); ++ fprintf(ptCreateFile, "if [ \"$iOptRemove\" == \"\" ]; then\n"); ++ if (iPdfOutputs) ++ { ++ fprintf(ptCreateFile, " %s -L pstex -D +%d,%d %s", prog, depth, iStartDepth, from, szFileName); ++ fprintf(ptCreateFile, " | epstopdf -f > %s.pdf\n", szFileName, szFileName); ++ } ++ else ++ fprintf(ptCreateFile, "%s -L pstex -D +%d,%d %s %s.eps\n", prog, depth, iStartDepth, from, szFileName); ++ fprintf(ptCreateFile, "else\n rm -f %s.", szFileName); ++ if (iPdfOutputs) ++ fprintf(ptCreateFile, "pdf"); ++ else ++ fprintf(ptCreateFile, "eps"); ++ fprintf(ptCreateFile, "\nfi\n"); ++ ++ fprintf(tfp, "\\begin{picture}(0,0)%%\n"); ++/* newer includegraphics directive suggested by Stephen Harker 1/13/99 */ ++#if defined(LATEX2E_GRAPHICS) ++# if defined(EPSFIG) ++ fprintf(tfp, "\\epsfig{file=%s.eps}%%\n",szFileName); ++# else ++ fprintf(tfp, "\\includegraphics{%s}%%\n",szFileName); ++# endif ++#else ++ fprintf(tfp, "\\special{psfile=%s.eps}%%\n",szFileName); ++#endif ++ fprintf(tfp, "\\end{picture}%%\n"); ++} ++ ++/************************************************************************* ++ *************************************************************************/ ++void genpstex_p_object(depth) ++int depth; ++{ ++ if (iTextRead) ++ { ++ fprintf(tfp, "\\end{picture}%%\n"); ++ iTextRead = 0; ++ } ++ if (iObjectsRead == 0) ++ { ++ iStartDepth = depth; ++ iObjectsRead = 1; ++ } ++ iLastDepth = depth; ++ ++} + ++void genpstex_p_arc(obj) ++F_arc *obj; ++{ ++ genpstex_p_object(obj->depth); ++} ++ ++ ++void genpstex_p_ellipse(obj) ++F_ellipse *obj; ++{ ++ genpstex_p_object(obj->depth); ++} ++ ++void genpstex_p_line(obj) ++F_line *obj; ++{ ++ genpstex_p_object(obj->depth); ++} ++ ++void genpstex_p_spline(obj) ++F_spline *obj; ++{ ++ genpstex_p_object(obj->depth); ++} ++ ++ ++ ++/************************************************************************* ++ *************************************************************************/ ++void genpstex_p_text(t) ++F_text *t; ++{ ++ ++ if (!special_text(t)) ++ genpstex_p_object(t->depth); ++ else ++ { ++ if (iObjectsRead) ++ { ++ genpstex_p_finalize_objects(iLastDepth); ++ iObjectsRead = 0; ++ } ++ if (iTextRead == 0) ++ { ++ fprintf(tfp, "\\begin{picture}(0,0)(%d,%d)\n", llx, lly); ++ iTextRead = 1; ++ } ++ genlatex_text(t); ++ } ++ ++} ++ ++/************************************************************************* ++ *************************************************************************/ + void genpstex_t_option(opt, optarg) + char opt, *optarg; + { +@@ -112,6 +412,8 @@ + else genlatex_text(t); + } + ++/************************************************************************* ++ *************************************************************************/ + void genpstex_text(t) + F_text *t; + { +@@ -128,6 +430,32 @@ + genlatex_option(opt, optarg); + } + ++struct driver dev_pstex_p = { ++ genpstex_p_option, ++ genpstex_p_start, ++ gendev_null, ++ genpstex_p_arc, ++ genpstex_p_ellipse, ++ genpstex_p_line, ++ genpstex_p_spline, ++ genpstex_p_text, ++ genpstex_p_end, ++ INCLUDE_TEXT ++}; ++ ++struct driver dev_pdftex_p = { ++ genpstex_p_option, ++ genpdftex_p_start, ++ gendev_null, ++ genpstex_p_arc, ++ genpstex_p_ellipse, ++ genpstex_p_line, ++ genpstex_p_spline, ++ genpstex_p_text, ++ genpstex_p_end, ++ INCLUDE_TEXT ++}; ++ + struct driver dev_pstex_t = { + genpstex_t_option, + genpstex_t_start, +diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2dev/drivers.h transfig/fig2dev/drivers.h +--- transfig~/fig2dev/drivers.h ++++ transfig/fig2dev/drivers.h +@@ -30,8 +30,10 @@ + extern struct driver dev_pdf; + extern struct driver dev_pdftex; + extern struct driver dev_pdftex_t; ++extern struct driver dev_pdftex_p; + extern struct driver dev_pstex; + extern struct driver dev_pstex_t; ++extern struct driver dev_pstex_p; + extern struct driver dev_pstricks; + extern struct driver dev_textyl; + extern struct driver dev_tk; +@@ -75,6 +77,7 @@ + {"pdf", &dev_pdf}, + {"pdftex", &dev_pdftex}, + {"pdftex_t", &dev_pdftex_t}, ++ {"pdftex_p", &dev_pdftex_p}, + {"pic", &dev_pic}, + {"pictex", &dev_pictex}, + {"png", &dev_bitmaps}, +@@ -82,6 +85,7 @@ + {"ps", &dev_ps}, + {"pstex", &dev_pstex}, + {"pstex_t", &dev_pstex_t}, ++ {"pstex_p", &dev_pstex_p}, + {"pstricks", &dev_pstricks}, + {"ptk", &dev_ptk}, + {"shape", &dev_shape}, +diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2dev/fig2dev.c transfig/fig2dev/fig2dev.c +--- transfig~/fig2dev/fig2dev.c ++++ transfig/fig2dev/fig2dev.c +@@ -651,6 +651,18 @@ + #endif /* NFSS */ + printf(" -p name name of the PostScript file to be overlaid\n"); + ++ printf("PSTEX_P and PDFTEX_P Options:\n"); ++ printf(" -p name basename of the files to be created\n"); ++#ifdef NFSS ++ printf(" -F don't set font family/series/shape, so you can\n"); ++ printf(" set it from latex\n"); ++#endif /* NFSS */ ++ printf(" -d dmag set separate magnification for length of line dashes to dmag\n"); ++ printf(" -E num set encoding for text translation (0 no translation,\n"); ++ printf(" 1 ISO-8859-1, 2 ISO-8859-2)\n"); ++ printf(" -l lwidth set threshold between thin and thick lines to lwidth\n"); ++ printf(" -v verbose mode\n"); ++ + printf("SHAPE (ShapePar driver) Options:\n"); + printf(" -n name Set basename of the macro (e.g. \"face\" gives faceshape and facepar)\n"); + printf("Tcl/Tk (tk) and Perl/Tk (ptk) Options:\n"); +@@ -778,6 +790,12 @@ + int rec_comp(r1, r2) + struct obj_rec *r1, *r2; + { ++ if (r2->depth == r1->depth) ++ { ++ if ((r1->gendev == dev->text) ^ (r2->gendev == dev->text)) ++ return ((r1->gendev == dev->text) * 2 - 1); ++ return (0); ++ } + return (r2->depth - r1->depth); + } + +diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2mpdf/copyright.txt transfig/fig2mpdf/copyright.txt +--- transfig~/fig2mpdf/copyright.txt ++++ transfig/fig2mpdf/copyright.txt +@@ -0,0 +1,25 @@ ++The following files contain copyright and license info for ++the code they contain: ++fig2mpdf, fig2mpdf.1, transfig.3.2.4.patch, transfig-3.2.5-alpha7.patch ++ ++-- fig2mpdf copyright begins here -- ++ ++ fig2mpdf/pdftex_p and pstex_p driver of fig2dev ++ Copyright (C) 2006 Michael Pfeiffer -- p3fff@web.de ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ ++ (Author's note: the license is in the file gpl.txt, which is included ++ in the archive.) +diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2mpdf/fig2mpdf transfig/fig2mpdf/fig2mpdf +--- transfig~/fig2mpdf/fig2mpdf ++++ transfig/fig2mpdf/fig2mpdf +@@ -0,0 +1,653 @@ ++#!/bin/sh ++ ++unset POSIXLY_CORRECT ++ ++gawk ' ++######################################################################### ++######################################################################### ++BEGIN { ++ ++ cmdGawk = "gawk"; ++ cmdCat = "cat"; ++ cmdLess = "less"; ++ cmdRm = "rm" ++ cmdMv = "mv" ++ cmdLatex = "latex"; ++ cmdPdftex = "pdflatex"; ++ cmdEpsToPdf = "epstopdf"; ++ cmdDvips = "dvips"; ++ cmdFig2dev = "fig2dev"; ++ cmdTouch = "touch"; ++ ++ szVersion = "1.1.2"; ++ iError = 0; ++ iGapWidth = 1; ++ ++ ++ # get the options ++ szOptString = "&l%e&m$p%i%I$s$H$g%G%v%V%d"; ++ getopt(szOptString); ++ ++ if (aOptions["d"]) ++ { ++ aOptions["v"] = "-"; ++ for (iI = 0; iI < ARGC; iI++) ++ printf("ARGV[%d]=%s\n", iI, ARGV[iI]); ++ ++ iDim = split(szOptString, aOpts, "[$%&]"); ++ for (iI = 2; iI <= iDim; iI++) ++ debug("aOptions[%s] = >%s<\n", aOpts[iI], aOptions[aOpts[iI]]); ++ } ++ ++ ++ ++ if (aOptions["V"] != "") ++ { ++ printf("fig2mpdf: version %s\n", szVersion); ++ iError = 1; ++ exit(0); ++ } ++ ++ szTmpPrefix = "_fig2mpdf" ++ ++ iLine = -1; ++ iInString = 0; ++ iDepths = 1; ++ ++ iInvalidDepth = -2 ++ iAdminDepth = 2000 ++ ++ szBase = ARGV[1]; ++ szOrigFile = ARGV[1]; ++ szOrigPath = ARGV[1]; ++ ++ # set default switch state ++ iDoMultiLayer = 0; ++ iDoLatex = 0; ++ iDoPdftex = 1; ++ iIncludeLowestRange = 1; ++ ++ # set iDoLatex and iDoMultiLayer concerning the given suffix ++ match(szBase, /\.[^\.\/]+$/); ++ if (RLENGTH != -1) ++ { ++ szSuffix = substr(szBase, RSTART); ++ if (szSuffix == ".lfig") ++ iDoLatex = 1; ++ else if (szSuffix == ".mfig") ++ iDoMultiLayer = 1; ++ else if ((szSuffix == ".mlfig") || (szSuffix == ".lmfig")) ++ { ++ iDoLatex = 1; ++ iDoMultiLayer = 1; ++ } ++ } ++ ++ ################################ ++ # evalutate options ++ ++ # set toggle latex ++ if (aOptions["l"] == "-") ++ iDoLatex = 1; ++ if (aOptions["l"] == "+") ++ iDoLatex = 0; ++ ++ # set multilayer flag ++ if (aOptions["m"] == "-") ++ iDoMultiLayer = 1; ++ if (aOptions["m"] == "+") ++ iDoMultiLayer = 0; ++ ++ # set toggle pdftex ++ if (aOptions["e"] == "-") ++ iDoPdftex = 0; ++ ++ # evaluate do not include lowest layer in all figs ++ iIncludeLowestRange = (aOptions["i"] == "-"); ++ ++ # evaluate include all lower ranges in the sub figs ++ iIncludeAllLowerRanges = (aOptions["I"] != "-"); ++ ++ # check consistencies ++ # if there are ranges given -> do multilayer ++ if (aOptions["p"] != "") ++ iDoMultiLayer = 1; ++ ++ ++ if (aOptions["g"] != "") ++ { ++ if ( ! match (aOptions["g"], /^[0-9]+$/)) ++ usage(); ++ ++ iGapWidth = aOptions["g"] + 1; ++ } ++ ++ # get the basename of the source ++ gsub(/\.[^\/]+$/, "", szBase); ++ gsub(/^.*\//, "", szBase); ++ ++ # get the path to the original ++ gsub(/[^\/]+$/, "", szOrigPath); ++} ++######################################################################### ++######################################################################### ++ ++( iInString != 0) { ++ aszLine[iLine] = sprintf("%s\n%s", aszLine[iLine], $0); ++ iInString = (match($0, "\\\\001$") == 0); ++ iSubLine++; ++ next; ++} ++ ++/^[135][ ]/ { ++ iCmd = $1; ++ iSubCmd = -1; ++ iSubLine = 0; ++ aiDepth[++iLine] = fnGetDepth($1); ++ aszLine[iLine] = $0; ++ next; ++} ++ ++/^[2][ ]/ { ++ iCmd = $1; ++ iSubCmd = $2; ++ iSubLine = 0; ++ aiDepth[++iLine] = fnGetDepth($1); ++ aszLine[iLine] = $0; ++ next; ++} ++ ++ ++/^[4][ ]/ { ++ iCmd = $1; ++ iSubCmd = $2; ++ iSubLine = 0; ++ aiDepth[++iLine] = fnGetDepth($1); ++ aszLine[iLine] = $0; ++ iInString = (match($0, "\\\\001$") == 0); ++ next; ++} ++ ++/^(6[ ])|(-6)/ { ++ iCmd = $1; ++ iSubCmd = -1; ++ iSubLine = 0; ++ next; ++} ++ ++/^[^ ]/ { ++ iCmd = -1; ++ aiDepth[++iLine] = fnGetDepth("A"); ++ iSubLine = 0; ++ aszLine[iLine] = $0; ++ next; ++} ++ ++/^[ ]/ { ++ iSubLine++; ++ if ((iCmd == 2) && (iSubCmd == 5) && (iSubLine == 1)) ++ { ++ if (match($0, "^\t[01] ")) ++ { ++ szFileName = substr($0, RSTART + RLENGTH); ++ if ( ! match(szFileName, /^\//)) ++ szFileName = sprintf("%s%s", szOrigPath, szFileName); ++ aszLine[iLine] = sprintf("%s\n\t%s %s", aszLine[iLine], $1, szFileName); ++ } ++ else ++ aszLine[iLine] = sprintf("%s\n%s", aszLine[iLine], $0); ++ } ++ else ++ aszLine[iLine] = sprintf("%s\n%s", aszLine[iLine], $0); ++} ++ ++ ++END { ++ iLine++; ++ iLowestLayer = 0; ++ iFirstRange = 0; ++ ++ if (iError == 0) ++ { ++ ++ ++ if (iDoMultiLayer) ++ { ++ asort(aiDepths, aiSortedDepth); ++ ++ # check for ranges as options ++ if (aOptions["p"] != "") ++ { ++ # we have explicit ranges ++ gsub(/-/, ":", aOptions["p"]); ++ iRanges = split(aOptions["p"], aszRanges, ","); ++ } ++ else ++ { ++ if (iDepths < 4) ++ { ++ iRanges = 1; ++ aszRanges[1] = "1:999"; ++ } ++ else ++ { ++ iRanges = 0; ++ iLastRange = aiSortedDepth[iDepths - 2] + 0; ++ iRangeStart = iLastRange; ++ for (iI = iDepths - 3; iI > 0; iI--) ++ { ++ aiSortedDepth[iI] += 0; ++ if ((aiSortedDepth[iI] < iLastRange - iGapWidth) || (iI == 1)) ++ { ++ if (aiSortedDepth[iI] >= iLastRange - iGapWidth) ++ iLastRange = aiSortedDepth[iI]; ++ ++ if (iLastRange != iRangeStart) ++ aszRanges[++iRanges] = sprintf("%d:%d", iLastRange, iRangeStart); ++ else ++ aszRanges[++iRanges] = sprintf("%d", iRangeStart); ++ iRangeStart = aiSortedDepth[iI]; ++ ++ if ((iI == 1) && (aiSortedDepth[iI] < iLastRange - iGapWidth)) ++ aszRanges[++iRanges] = sprintf("%d", aiSortedDepth[iI]); ++ } ++ iLastRange = aiSortedDepth[iI]; ++ } ++ } ++ } ++ ++ ++ # check for a multilayer file with only one range ++ if ((iRanges == 1) && iIncludeLowestRange) ++ { ++ iIncludeLowestRange = 0; ++ } ++ ++ szInitRangeList = " -D "; ++ szSep = ""; ++ ++ if (iIncludeLowestRange) ++ { ++ szInitRangeList = sprintf("%s+%s", szInitRangeList, aszRanges[1]); ++ szSep = ","; ++ } ++ szRangeList = szInitRangeList; ++ ++ # step through the ranges ++ for (iI = iIncludeLowestRange; iI < iRanges; iI++) ++ { ++ szFileBase = sprintf("%s-%d", szBase, iI - iIncludeLowestRange); ++ ++ if (aOptions["I"]) ++ { ++ szRangeList = sprintf("%s%s+%s", szRangeList, szSep, aszRanges[iI + 1]); ++ szSep = ","; ++ } ++ else ++ szRangeList = sprintf("%s%s+%s", szInitRangeList, szSep, aszRanges[iI + 1]); ++ ++ ++ if (iDoLatex) ++ szTargetFile = fnDoTexFig(szFileBase, szOrigFile, szRangeList, (iDoPdftex != 0)); ++ else ++ szTargetFile = fnDoNormalFig(szFileBase, szOrigFile, szRangeList, (iDoPdftex != 0)); ++ ++ ++ if (aOptions["G"]) ++ { ++ match(szTargetFile, /\.[^.]*$/); ++ szCommand = sprintf("%s %s %s.page%d%s", cmdMv, szTargetFile, szBase, iI - iIncludeLowestRange, substr(szTargetFile, RSTART, RLENGTH)); ++ debug("%s\n", szCommand); ++ system(szCommand); ++ } ++ } ++ } ++ else ++ { ++ szRangeList = ""; ++ ++ if (iDoLatex) ++ szTargetFile = fnDoTexFig(szBase, szOrigFile, szRangeList, (iDoPdftex != 0)); ++ else ++ szTargetFile = fnDoNormalFig(szBase, szOrigFile, szRangeList, (iDoPdftex != 0)); ++ } ++ } ++} ++ ++ ++ ++######################################################################### ++######################################################################### ++function debug(str, arg0, arg1, arg2, arg3, arg4) ++{ ++ if (aOptions["v"]) ++ printf (str, arg0, arg1, arg2, arg3, arg4); ++} ++ ++######################################################################### ++######################################################################### ++function fnGetDepth (iControl) ++{ ++ ++ if (iControl == 1) ++ { ++ iReturn = sprintf("%04d", $7); ++ } ++ else if (iControl == 2) ++ { ++ iReturn = sprintf("%04d", $7); ++ } ++ else if (iControl == 3) ++ { ++ iReturn = sprintf("%04d", $7); ++ } ++ else if (iControl == 4) ++ { ++ iReturn = sprintf("%04d", $4); ++ } ++ else if (iControl == 5) ++ { ++ iReturn = sprintf("%04d", $7); ++ } ++ else if ((iControl == 6) || (iControl == -6)) ++ { ++ iReturn = sprintf("%04d", iInvalidDepth); ++ } ++ else ++ { ++ iReturn = sprintf("%04d", iAdminDepth); ++ } ++ ++ if (iReturn >= 0) ++ { ++ if (ahDepths[iReturn] == 0) ++ { ++ ahDepths[iReturn] = 1; ++ aiDepths[iDepths++] = iReturn; ++ } ++ } ++ ++ return (iReturn); ++ ++} ++ ++######################################################################### ++######################################################################### ++function fnDoNormalFig(szFileNameBase, szFigFile, szRangeList, iPdf, ++ szEpsFile, szPdfFile, szTargetFile, szCommand) ++{ ++ ++ debug("FileNameBase >%s< FigFile >%s< Pdf:%d\n", szFileNameBase, szFigFile, iPdf); ++ ++ if (iPdf) ++ szEpsFile = sprintf("%s%s.eps", szTmpPrefix, szFileNameBase); ++ else ++ { ++ szEpsFile = sprintf("%s.eps", szFileNameBase); ++ szTargetFile = szEpsFile; ++ } ++ ++ szCommand = sprintf("%s -L eps %s %s %s 2> /dev/null", cmdFig2dev, szRangeList, szFigFile, szEpsFile); ++ debug("%s\n", szCommand); ++ system(szCommand); ++ ++ if (iPdf) ++ { ++ szPdfFile = sprintf("%s.pdf", szFileNameBase); ++ szTargetFile = szPdfFile; ++ szCommand = sprintf("%s --outfile=%s %s", cmdEpsToPdf, szPdfFile, szEpsFile); ++ debug("%s\n", szCommand); ++ system(szCommand); ++ ++ ++ if ( ! aOptions["d"]) ++ { ++ szCommand = sprintf("%s -f %s", cmdRm, szEpsFile); ++ debug("%s\n", szCommand); ++ system(szCommand); ++ } ++ } ++ ++ ++ return (szTargetFile); ++} ++ ++ ++######################################################################### ++######################################################################### ++function fnDoTexFig(szFileNameBase, szFigFile, szRangeList, iPdf, ++ szEpsFile, szPdfFile, szTexDoc, szTexPdf, szTexLog, szTexAux, szTexInp, szTmpPs, szTmpPdf, szTexSiz, szTmpEps, szCommand, szHeader) ++{ ++ ++ debug("FileNameBase >%s< FigFile >%s< Pdf:%d\n", szFileNameBase, szFigFile, iPdf); ++ ++ szEpsFile = sprintf("%s.eps", szFileNameBase); ++ szPdfFile = sprintf("%s.pdf", szFileNameBase); ++ szTexDoc = sprintf("%s%s_doc.tex", szTmpPrefix, szFileNameBase); ++ szTexPdf = sprintf("%s%s_doc.pdf", szTmpPrefix, szFileNameBase); ++ szTexDvi = sprintf("%s%s_doc.dvi", szTmpPrefix, szFileNameBase); ++ szTexLog = sprintf("%s%s_doc.log", szTmpPrefix, szFileNameBase); ++ szTexAux = sprintf("%s%s_doc.aux", szTmpPrefix, szFileNameBase); ++ szTexInpPref = sprintf("%s%s_inp", szTmpPrefix, szFileNameBase); ++ szTexInp = sprintf("%s.tex", szTexInpPref); ++ szTexCreator = sprintf("%s.create", szTexInpPref); ++ szTexSiz = sprintf("%s.size", szTexInpPref); ++ ++ if (iPdf) ++ szCommand = sprintf("%s -L pdftex_p %s -p %s %s %s", cmdFig2dev, szRangeList, szTexInpPref, szFigFile, szTexInp); ++ else ++ szCommand = sprintf("%s -L pstex_p %s -p %s %s %s", cmdFig2dev, szRangeList, szTexInpPref, szFigFile, szTexInp); ++ debug("%s\n", szCommand); ++ system(szCommand); ++ ++ szCommand = sprintf("./%s", szTexCreator); ++ debug("%s\n", szCommand); ++ system(szCommand); ++ ++ # check if there is an own hederfile to include ++ if (aOptions["s"] == "") ++ aOptions["s"] = "times"; ++ ++ if (aOptions["H"] == "") ++ { ++ szHeader = sprintf("\\documentclass{article}\n\ ++\\usepackage{german,amssymb,amsmath}\n\ ++\\usepackage{%s}", aOptions["s"]); ++ } ++ else ++ szHeader = sprintf("\\input{%s}\n", aOptions["H"]); ++ ++ szHeader = sprintf("%s\n\ ++\\usepackage{color}\n\ ++\\usepackage{ifpdf}\n\ ++\\setlength{\\textwidth}{100cm}\n\ ++\\setlength{\\textheight}{100cm}\n\ ++\\setlength{\\topmargin}{-1in}\n\ ++\\setlength{\\headsep}{0pt}\n\ ++\\setlength{\\headheight}{0pt}\n\ ++\\setlength{\\oddsidemargin}{-1in}\n\ ++\\parindent=0cm\n\ ++\\ifpdf\n\ ++\\usepackage[pdftex]{graphicx}\n\ ++\\DeclareGraphicsExtensions{.pdf,.png,.jpg}\n\ ++\\usepackage{epsfig}\n\ ++\\input{%s}\n\ ++\\else\n\ ++\\usepackage{graphicx}\n\ ++\\usepackage{epsfig}\n\ ++\\fi\n\ ++", szHeader, szTexSiz); ++ ++ szCommand = sprintf("%s > %s << EOF\n\ ++%s\\begin{document}\n\ ++\\pagestyle{empty}\n\ ++\\input{%s}\n\ ++\\end{document}\n\ ++EOF", cmdCat, szTexDoc, szHeader, szTexInp); ++ if (aOptions["d"] != "") ++ debug("%s\n", szCommand); ++ system(szCommand); ++ ++ if (iPdf) ++ { ++ ++ szCommand = sprintf("%s -interaction batchmode %s", cmdPdftex, szTexDoc); ++ debug("%s\n", szCommand); ++ iReturn = system(szCommand); ++ ++ if (iReturn) ++ { ++ szCommand = sprintf("%s %s | %s +G", cmdCat, szTexLog, cmdLess); ++ system (szCommand); ++ } ++ else ++ { ++ szCommand = sprintf("%s %s %s", cmdMv, szTexPdf, szPdfFile); ++ debug("%s\n", szCommand); ++ system(szCommand); ++ } ++ ++ } ++ else ++ { ++ szCommand = sprintf("%s -interaction batchmode %s", cmdLatex, szTexDoc); ++ debug("%s\n", szCommand); ++ iReturn = system(szCommand); ++ if (iReturn) ++ { ++ szCommand = sprintf("%s %s | %s +G", cmdCat, szTexLog, cmdLess); ++ system (szCommand); ++ } ++ else ++ { ++ szCommand = sprintf("%s -q -E %s -o %s 2>&1 > /dev/null", cmdDvips, szTexDvi, szEpsFile); ++ debug("%s\n", szCommand); ++ system(szCommand); ++ } ++ } ++ ++ if ( ! aOptions["d"]) ++ { ++ szCommand = sprintf("./%s -r", szTexCreator); ++ debug("%s\n", szCommand); ++ system(szCommand); ++ } ++ ++ if ( ! aOptions["d"]) ++ { ++ szCommand = sprintf("%s -f %s %s %s %s %s %s %s", cmdRm, szTexDoc, szTexLog, szTexAux, szTexDvi, szTexInp, szTexCreator, szTexPdf); ++ debug("%s\n", szCommand); ++ system(szCommand); ++ } ++ ++ if (iPdf) ++ return (szPdfFile); ++ else ++ return (szEpsFile); ++} ++ ++ ++######################################################################### ++######################################################################### ++function getopt(sOptions, n, m, fHuntParam, iSearchMinus, iSPos, iCLen, iHuntSwitches, szSwChar, szOptChar) { ++# Options: Flagoptions: %f ++# Parameter: $p ++ ++ n = 1; # index in argv ++ m = 1; # processed entries in argv finally it points to the firs$ ++ iSearchMinus = 1; # indicate that a switch leading sign minus is expected ++ ++ # check for initial -- to separate the gawk switches from the script switches ++ if (ARGV[n] == "--") ++ n++; ++ ++ ++ while (n < ARGC) ++ { ++ iHuntSwitches = 0; ++ iCLen = length(ARGV[n]); ++ ++ szSwChar = substr(ARGV[n], 1, 1); ++ if ((szSwChar == "-") || (szSwChar == "+")) ++ { ++ if ((iSearchMinus == 0) || fHuntParam) ++ usage(); ++ iHuntSwitches = 1; ++ iSPos = 2; ++ fHuntParam = 0; ++ } ++ else ++ { ++ iSPos = 1; ++ ++ if (fHuntParam == 0) ++ iSearchMinus = 0; ++ } ++ ++ while (iSPos <= iCLen) ++ { ++ if (iHuntSwitches) ++ { ++ szOptChar = substr(ARGV[n], iSPos, 1); ++ iOPos = index(sOptions, szOptChar); ++ if (iOPos == 0) ++ { ++ printf("unknown option \"%s\"\n", szOptChar); ++ usage(); ++ } ++ if ((substr(sOptions, iOPos - 1, 1) == "&") || ((substr(sOptions, iOPos - 1, 1) == "%") && (szSwChar == "-"))) ++ { ++ aOptions[szOptChar] = szSwChar; ++ iSPos = iSPos + 1; ++ } ++ else if ((substr(sOptions, iOPos - 1, 1) == "$") && (szSwChar == "-")) ++ { ++ fHuntParam = 1; ++ iHuntSwitches = 0; ++ iSPos = iSPos + 1; ++ } ++ else ++ usage(); ++ ++ } ++ else if (fHuntParam) ++ { ++ fHuntParam = 0; ++ aOptions[szOptChar] = substr(ARGV[n], iSPos, iCLen + 1 - iSPos); ++ iSPos = iCLen + 1; ++ } ++ else ++ { ++ ARGV[m++] = ARGV[n]; ++ iSPos = iCLen + 1; ++ } ++ } ++ n = n + 1; ++ } ++ ARGC = m; ++} ++ ++ ++######################################################################### ++######################################################################### ++function usage() { ++ print "usage: fig2mpdf [-|+lm] [-eiIGvV] [-p ] [-g ] [-s