Gentoo Archives: gentoo-commits

From: "Peter Volkov (pva)" <pva@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-gfx/transfig/files: transfig-3.2.5d-precision.patch transfig-3.2.5d-libpng-1.5.patch transfig-3.2.5d-MAXWIDTH.patch transfig-3.2.5d-fig2mpdf-r1.patch transfig-3.2.5d-leadspace.patch transfig-3.2.5-SetFigFont-params.patch transfig-3.2.5c-avoid_warnings.patch transfig-3.2.5c-fig2mpdf.patch transfig-3.2.5-imagemap.patch transfig-3.2.5-fig2ps2tex_bashisms.patch transfig-3.2.5-locale.patch transfig-3.2.5-displaywho.patch transfig-3.2.5d-fig2mpdf.patch transfig-3.2.5-arrows-and-QA.patch transfig-3.2.5c-cups_workaround.patch
Date: Sun, 01 May 2011 09:58:37
Message-Id: 20110501095824.E1F8420054@flycatcher.gentoo.org
1 pva 11/05/01 09:58:24
2
3 Added: transfig-3.2.5d-precision.patch
4 transfig-3.2.5d-libpng-1.5.patch
5 transfig-3.2.5d-MAXWIDTH.patch
6 transfig-3.2.5d-fig2mpdf-r1.patch
7 transfig-3.2.5d-leadspace.patch
8 Removed: transfig-3.2.5-SetFigFont-params.patch
9 transfig-3.2.5c-avoid_warnings.patch
10 transfig-3.2.5c-fig2mpdf.patch
11 transfig-3.2.5-imagemap.patch
12 transfig-3.2.5-fig2ps2tex_bashisms.patch
13 transfig-3.2.5-locale.patch
14 transfig-3.2.5-displaywho.patch
15 transfig-3.2.5d-fig2mpdf.patch
16 transfig-3.2.5-arrows-and-QA.patch
17 transfig-3.2.5c-cups_workaround.patch
18 Log:
19 Update to EAPI=4 and incorportage some prefix changes, bug #353408, thank Jeremy Olexa for report. Fix build issue with libpng-1.5, bug #356751 thank Alexis Ballier for the patch. Added debian fixes: update fig2mpdf patch to use list of layers instead of range of layers; leadspace patch to aoid wrong leading spaces in PIC text; precision to change the precision of PIC floating point output from %.2f to %.3f; MAXWIDTH to increasese MAXWIDTH of embedded images from 8K to 16K. Drop old.
20
21 (Portage version: 2.1.9.46/cvs/Linux x86_64)
22
23 Revision Changes Path
24 1.1 media-gfx/transfig/files/transfig-3.2.5d-precision.patch
25
26 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/transfig/files/transfig-3.2.5d-precision.patch?rev=1.1&view=markup
27 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/transfig/files/transfig-3.2.5d-precision.patch?rev=1.1&content-type=text/plain
28
29 Index: transfig-3.2.5d-precision.patch
30 ===================================================================
31 #! /bin/sh /usr/share/dpatch/dpatch-run
32 ## 24_PIC_precision.dpatch by Roger Leigh <rleigh@××××××.org>
33 ##
34 ## All lines beginning with `## DP:' are a description of the patch.
35 ## DP: Change the precision of PIC floating point output from %.2f to %.3f.
36 ## DP: (Closes: #611948)
37
38 @DPATCH@
39 diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2dev/dev/genpic.c transfig/fig2dev/dev/genpic.c
40 --- transfig~/fig2dev/dev/genpic.c
41 +++ transfig/fig2dev/dev/genpic.c
42 @@ -229,9 +229,9 @@
43
44 /* Should have a #define somewhere for the # of fill patterns */
45 if (l->fill_style != UNFILLED)
46 - fprintf(tfp, " fill %.2f", ((double) l->fill_style ) / (double) BLACK_FILL);
47 + fprintf(tfp, " fill %.3f", ((double) l->fill_style ) / (double) BLACK_FILL);
48
49 - fprintf(tfp, " with .sw at (%.2f,%.2f) ",
50 + fprintf(tfp, " with .sw at (%.3f,%.3f) ",
51 minx / ppi, convy(maxy / ppi));
52
53 width = (maxx - minx) / ppi;
54 @@ -239,10 +239,10 @@
55 height = convy(maxy / ppi) - convy(miny / ppi);
56 if (height < 0.0) height = -height;
57
58 - fprintf(tfp, "width %.2f height %.2f", width, height);
59 + fprintf(tfp, "width %.3f height %.3f", width, height);
60
61 if (OptArcBox && l->type == T_ARC_BOX)
62 - fprintf(tfp, " rad %.2f", l->radius/ppi);
63 + fprintf(tfp, " rad %.3f", l->radius/ppi);
64
65 AddThickness();
66
67 @@ -411,7 +411,7 @@
68 2 * e->radiuses.x/ppi, 2 * e->radiuses.y/ppi);
69
70 if ( OptEllipseFill && e->fill_style != UNFILLED)
71 - fprintf(tfp, " fill %.2f", (double)e->fill_style / (double) BLACK_FILL);
72 + fprintf(tfp, " fill %.3f", (double)e->fill_style / (double) BLACK_FILL);
73
74 AddThickness();
75
76
77
78
79 1.1 media-gfx/transfig/files/transfig-3.2.5d-libpng-1.5.patch
80
81 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/transfig/files/transfig-3.2.5d-libpng-1.5.patch?rev=1.1&view=markup
82 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/transfig/files/transfig-3.2.5d-libpng-1.5.patch?rev=1.1&content-type=text/plain
83
84 Index: transfig-3.2.5d-libpng-1.5.patch
85 ===================================================================
86 http://bugs.gentoo.org/show_bug.cgi?id=356751
87
88 Index: transfig.3.2.5d/fig2dev/dev/readpng.c
89 ===================================================================
90 --- transfig.3.2.5d.orig/fig2dev/dev/readpng.c
91 +++ transfig.3.2.5d/fig2dev/dev/readpng.c
92 @@ -62,7 +62,7 @@ read_png(file,filetype,pic,llx,lly)
93 }
94
95 /* set long jump here */
96 - if (setjmp(png_ptr->jmpbuf)) {
97 + if (setjmp(png_jmpbuf(png_ptr))) {
98 /* if we get here there was a problem reading the file */
99 png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
100 return 0;
101 @@ -78,15 +78,17 @@ read_png(file,filetype,pic,llx,lly)
102 png_get_IHDR(png_ptr, info_ptr, &w, &h, &bit_depth, &color_type,
103 &interlace_type, &compression_type, &filter_type);
104
105 - if (info_ptr->valid & PNG_INFO_gAMA)
106 - png_set_gamma(png_ptr, 2.2, info_ptr->gamma);
107 - else
108 - png_set_gamma(png_ptr, 2.2, 0.45);
109 + png_fixed_point gamma = 0.45;
110 + png_get_gAMA_fixed(png_ptr,info_ptr,&gamma);
111 + png_set_gamma(png_ptr, 2.2, gamma);
112
113 - if (info_ptr->valid & PNG_INFO_bKGD)
114 + if (png_get_valid(png_ptr,info_ptr,PNG_INFO_bKGD)) {
115 /* set the background to the one supplied */
116 - png_set_background(png_ptr, &info_ptr->background,
117 + png_color_16p background;
118 + png_get_bKGD(png_ptr,info_ptr,&background);
119 + png_set_background(png_ptr, background,
120 PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
121 + }
122 else {
123 /* blend the canvas background using the alpha channel */
124 if (bgspec) {
125
126
127
128 1.1 media-gfx/transfig/files/transfig-3.2.5d-MAXWIDTH.patch
129
130 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/transfig/files/transfig-3.2.5d-MAXWIDTH.patch?rev=1.1&view=markup
131 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/transfig/files/transfig-3.2.5d-MAXWIDTH.patch?rev=1.1&content-type=text/plain
132
133 Index: transfig-3.2.5d-MAXWIDTH.patch
134 ===================================================================
135 #! /bin/sh /usr/share/dpatch/dpatch-run
136 ## 23_MAXWIDTH.dpatch by Roland Rosenfeld <roland@××××××.org>
137 ##
138 ## All lines beginning with `## DP:' are a description of the patch.
139 ## DP: Increasese MAXWIDTH of embedded images from 8K to 16K (Closes: #610466)
140
141 @DPATCH@
142 diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2dev/dev/psencode.c transfig/fig2dev/dev/psencode.c
143 --- transfig~/fig2dev/dev/psencode.c
144 +++ transfig/fig2dev/dev/psencode.c
145 @@ -18,7 +18,7 @@
146
147 #include "fig2dev.h"
148
149 -#define MAXWIDTH 8192
150 +#define MAXWIDTH 16384
151
152 #define put_string nc=strlen(s); for(i=0;i<nc;i++) (putc((s[i]),tfp)); Nbyte += nc
153
154
155
156
157 1.1 media-gfx/transfig/files/transfig-3.2.5d-fig2mpdf-r1.patch
158
159 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/transfig/files/transfig-3.2.5d-fig2mpdf-r1.patch?rev=1.1&view=markup
160 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/transfig/files/transfig-3.2.5d-fig2mpdf-r1.patch?rev=1.1&content-type=text/plain
161
162 Index: transfig-3.2.5d-fig2mpdf-r1.patch
163 ===================================================================
164 #! /bin/sh /usr/share/dpatch/dpatch-run
165 ## 14_fig2mpdf.dpatch by Michael Pfeiffer <p3fff@×××.de>
166 ##
167 ## All lines beginning with `## DP:' are a description of the patch.
168
169 ## DP: creating multilayered or singlelayer PDF or EPS figures for
170 ## DP: including into LaTeX documents.
171 ## DP: http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html
172
173 @DPATCH@
174 diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/doc/fig2dev.1 transfig/doc/fig2dev.1
175 --- transfig~/doc/fig2dev.1
176 +++ transfig/doc/fig2dev.1
177 @@ -53,8 +53,8 @@
178 \fBbox, cgm, epic, eepic, eepicemu, emf, eps, gbx (Gerber beta driver), gif, ibmgl, jpeg,
179 latex, map (HTML image map), mf (MetaFont),
180 mp (MetaPost), mmp (Multi-MetaPost),
181 -pcx, pdf, pdftex, pdftex_t, pic, pictex, png, ppm, ps,
182 -pstex, pstex_t, pstricks, ptk (Perl/tk),
183 +pcx, pdf, pdftex, pdftex_t, pdftex_p, pic, pictex, png, ppm, ps,
184 +pstex, pstex_t, pstex_p, pstricks, ptk (Perl/tk),
185 shape (LaTeX shaped paragraphs), sld (AutoCad slide format),
186 svg (beta driver), textyl,
187 tiff, tk (tcl/tk), tpic, xbm and
188 @@ -1062,6 +1062,62 @@
189 font. Option 1 sets LaTeX font size only. Option 2 issues no font
190 commands at all.
191
192 +.SH PSTEX_P and PDFTEX_P OPTIONS
193 +The \fBpstex_p\fR language has the same intention as
194 +the combination of \fBpstex\fR and \fBpstex_t\fR.
195 +The only reason to use \fBpstex_p\fR is that you have partially overlayed texts.
196 +\fBpstex_p\fR splits the Fig file concerning the depths of existing texts. Because
197 +of it's necessary to get the resulting size of the figure for the pdf document
198 +you have to specify the target document format
199 +(i.e. using \fBpstex_p\fR rsp. \fBpdftex_p\fR).
200 +.br
201 +Two files results by using this language:
202 +.br
203 +.HP +.3i
204 +1) A bash script for creating and removing the necessary graphics files.
205 +Extension: \fB.create\fR
206 +.HP +.3i
207 +.HP +.3i
208 +2) The latex code which includes all graphics files and special texts. Content is
209 +put to stdout.
210 +
211 +.TP
212 +The \fBpstex_p\fR driver has the following special options:
213 +
214 +.TP
215 +.B \-p basename
216 +specifies the basename of the files to be created (see (1) above). This option
217 +is mandatory.
218 +.TP
219 +.B "\-d dmag"
220 +Set a separate magnification for the length of line dashes to
221 +.I dmag.
222 +.TP
223 +.B \-E num
224 +Set encoding for latex text translation (0 no translation, 1 ISO-8859-1, 2 ISO-8859-2)
225 +.TP
226 +.B "\-l lwidth"
227 +Sets the threshold between LaTeX thin and thick lines to
228 +.I lwidth
229 +pixels.
230 +LaTeX supports only two different line width: \\thinlines and \\thicklines.
231 +Lines of width greater than
232 +.I lwidth
233 +pixels are drawn as \\thicklines.
234 +Also affects the size of dots in dotted line style.
235 +The default is 1.
236 +.TP
237 +.B \-v
238 +Verbose mode.
239 +.TP
240 +.B \-F
241 +Don't set the font face, series, and style; only set it's size and the
242 +baselineskip. By default, fig2dev sets all 5 font parameters when it
243 +puts some text. The disadvantage is that you can't set the font from your
244 +LaTeX document. With this option on, you can set the font from your LaTeX
245 +document (like "\fB\\sfshape \\input picture.eepic\fR").
246 +
247 +
248 .SH TK and PTK OPTIONS (tcl/tk and Perl/tk)
249 .TP
250 .B \-l dummy_arg
251 @@ -1107,6 +1163,13 @@
252 .PP
253 Rotated text is only supported in the IBM-GL (HP/GL) and PostScript (including eps)
254 languages.
255 +.PP
256 +In \fBpdftex_p\fR language \fIfig2dev\fR can not determine the exact sizes of
257 +the special texts set by pdflatex afterwards. If these texts are bigger than
258 +expected the calculated bounding box might be too small so that some texts passes
259 +over the figure boundaries. If this happen you have to put an invisible
260 +rectangle (line width 0) around the text or the entire figure.
261 +
262 .SH COPYRIGHT
263 Copyright (c) 1991 Micah Beck
264 .br
265 @@ -1187,3 +1250,7 @@
266 The GBX (Gerber) driver was written by
267 .br
268 Edward Grace (ej.grace@×××××××××××.uk).
269 +.sp
270 +The PSTEX_P and PDFTEX_P drivers (overlayed LaTeX texts) was written by
271 +.br
272 +Michael Pfeiffer (p3f@×××.de)
273 diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2dev/dev/genpstex.c transfig/fig2dev/dev/genpstex.c
274 --- transfig~/fig2dev/dev/genpstex.c
275 +++ transfig/fig2dev/dev/genpstex.c
276 @@ -70,7 +70,307 @@
277 genps_end ();
278
279 static char pstex_file[1000] = "";
280 +static int iObjectsRead = 0;
281 +static int iTextRead = 0;
282 +static int iObjectsFileNumber = 0;
283 +static int iStartDepth;
284 +static int iLastDepth;
285 +static FILE * ptCreateFile;
286 +static char szFileName[1000];
287 +static int iLength;
288 +static int iPdfOutputs = 0;
289 +
290 +#ifdef never
291 +static double unitlength;
292 +static double dash_mag = 1.0;
293 +
294 +static int (*translate_coordinates)() = NULL;
295 +static int (*translate_coordinates_d)() = NULL;
296 +#else
297 +extern double unitlength;
298 +extern double dash_mag;
299 +
300 +extern int (*translate_coordinates)();
301 +extern int (*translate_coordinates_d)();
302 +#endif
303 +
304 +#define TOP 840
305 +#define SWAP(x,y) {tmp=x; x=y; y=tmp;}
306 +#define TRANS(x,y) (*translate_coordinates)(&x,&y)
307 +#define TRANS2(x1,y1,x2,y2) (*translate_coordinates)(&x1,&y1); \
308 + (*translate_coordinates)(&x2,&y2)
309 +#define TRANSD(x,y) (*translate_coordinates_d)(&x,&y)
310 +
311 +static void genpstex_p_finalize_objects(int depth);
312 +
313 +/*************************************************************************
314 + *************************************************************************/
315 +static
316 +translate2(xp, yp)
317 + int *xp, *yp;
318 +{
319 + *xp = *xp + 1;
320 + *yp = (double)(TOP - *yp -1);
321 + }
322 +
323 +static
324 +translate1_d(xp, yp)
325 + double *xp, *yp;
326 +{
327 + *xp = *xp + 1.0;
328 + *yp = *yp + 1.0;
329 + }
330 +
331 +static
332 +translate2_d(xp, yp)
333 + double *xp, *yp;
334 +{
335 + *xp = *xp + 1.0;
336 + *yp = (double)TOP - *yp -1.0;
337 + }
338 +
339 +/*************************************************************************
340 + *************************************************************************/
341 +void genpstex_p_option(opt, optarg)
342 +char opt, *optarg;
343 +{
344 + if (opt == 'p')
345 + {
346 + strcpy(pstex_file, optarg);
347 + }
348 + else
349 + genlatex_option(opt, optarg);
350 +}
351 +
352 +
353 +/*************************************************************************
354 + *************************************************************************/
355 +void genpstex_p_start(objects)
356 + F_compound *objects;
357 +{
358 + int tmp;
359 + struct stat tStat;
360 + long lUnitLength;
361 +
362 + if (*pstex_file == '\0')
363 + {
364 + put_msg("Argument -p is mandatory to pstex_p.");
365 + exit(1);
366 + }
367 +
368 + strncpy(szFileName, pstex_file, 900);
369 + iLength = strlen(szFileName);
370 +
371 + sprintf(szFileName + iLength, ".create");
372 + ptCreateFile = fopen (szFileName, "wb");
373 +
374 + if ( ! ptCreateFile)
375 + {
376 + put_msg("Couldn't open %s for writing", szFileName);
377 + exit(1);
378 + }
379 + fstat(fileno(ptCreateFile), & tStat);
380 + fchmod (fileno(ptCreateFile), tStat.st_mode | ((tStat.st_mode & (S_IRUSR | S_IRGRP | S_IROTH)) >> 2));
381 + fprintf(ptCreateFile, "#!/bin/bash\n\n", szFileName);
382 +
383 + fprintf(ptCreateFile, "while getopts \"r\" Option\n");
384 + fprintf(ptCreateFile, "do\n");
385 + fprintf(ptCreateFile, " case $Option in\n");
386 + fprintf(ptCreateFile, " r) iOptRemove=1;;\n");
387 + fprintf(ptCreateFile, " *) echo \"illegal option -$Option\"\n");
388 + fprintf(ptCreateFile, " esac\n");
389 + fprintf(ptCreateFile, "done\n");
390 + fprintf(ptCreateFile, "shift $(($OPTIND - 1))\n");
391 +
392 + texfontsizes[0] = texfontsizes[1] =
393 + TEXFONTSIZE(font_size != 0.0? font_size : DEFAULT_FONT_SIZE);
394 +
395 + unitlength = mag/ppi;
396 + dash_mag /= unitlength*80.0;
397 +
398 + translate_coordinates = translate2;
399 + translate_coordinates_d = translate2_d;
400 +
401 + TRANS2(llx, lly, urx, ury);
402 + if (llx > urx) SWAP(llx, urx)
403 + if (lly > ury) SWAP(lly, ury)
404 +
405 + /* LaTeX start */
406 +
407 + /* print any whole-figure comments prefixed with "%" */
408 + if (objects->comments) {
409 + fprintf(tfp,"%%\n");
410 + print_comments("% ",objects->comments, "");
411 + fprintf(tfp,"%%\n");
412 + }
413 +
414 + lUnitLength = (long) (round(4736286.72*unitlength));
415 + fprintf(tfp, "\\setlength{\\unitlength}{%lisp}%%\n",
416 + lUnitLength);
417 + /* define the SetFigFont macro */
418 + define_setfigfont(tfp);
419 +
420 + sprintf(szFileName + iLength, ".size");
421 + fprintf(ptCreateFile, "if [ \"$iOptRemove\" == \"\" ]; then\n");
422 + if (iPdfOutputs)
423 + fprintf(ptCreateFile, " echo \"\\setlength\\pdfpagewidth{%3.2fpt}\\setlength\\pdfpageheight{%3.2fpt}\" > %s\n",
424 + (float) lUnitLength / 65536 * (urx - llx), (float) lUnitLength / 65536 * (ury - lly), szFileName);
425 + else
426 + fprintf(ptCreateFile, "echo -n\"\" > %s\n", szFileName);
427 + fprintf(ptCreateFile, "else\n rm -f %s\nfi\n", szFileName);
428 +}
429 +
430 +/*************************************************************************
431 + *************************************************************************/
432 +void genpdftex_p_start(objects)
433 + F_compound *objects;
434 +{
435 + iPdfOutputs = 1;
436 + genpstex_p_start(objects);
437 +}
438 +
439 +
440 +/*************************************************************************
441 + *************************************************************************/
442 +int genpstex_p_end()
443 +{
444 + if (iTextRead)
445 + {
446 + fprintf(tfp, "\\end{picture}%%\n");
447 + iTextRead = 0;
448 + }
449 + if (iObjectsRead)
450 + {
451 + genpstex_p_finalize_objects(iLastDepth);
452 + iObjectsRead = 0;
453 + }
454 +
455 + /* LaTeX ending */
456 + fprintf(tfp, "\\begin{picture}(%d,%d)\n", urx-llx, ury-lly);
457 + fprintf(tfp, "\\end{picture}%%\n");
458 +
459 + fclose(ptCreateFile);
460 +
461 + /* all ok */
462 + return 0;
463 +}
464 +
465 +
466 +/*************************************************************************
467 + *************************************************************************/
468 +void genpstex_p_finalize_objects(depth)
469 +int depth;
470 +{
471 + char szFileName[1000];
472 + int iLength;
473 +
474 + strncpy(szFileName, pstex_file, 900);
475 + iLength = strlen(szFileName);
476 +
477 +
478 + sprintf(szFileName + iLength, "%03d", iObjectsFileNumber++);
479 + fprintf(ptCreateFile, "if [ \"$iOptRemove\" == \"\" ]; then\n");
480 + if (iPdfOutputs)
481 + {
482 + fprintf(ptCreateFile, " %s -L pstex -D +%d,%d %s", prog, depth, iStartDepth, from, szFileName);
483 + fprintf(ptCreateFile, " | epstopdf -f > %s.pdf\n", szFileName, szFileName);
484 + }
485 + else
486 + fprintf(ptCreateFile, "%s -L pstex -D +%d,%d %s %s.eps\n", prog, depth, iStartDepth, from, szFileName);
487 + fprintf(ptCreateFile, "else\n rm -f %s.", szFileName);
488 + if (iPdfOutputs)
489 + fprintf(ptCreateFile, "pdf");
490 + else
491 + fprintf(ptCreateFile, "eps");
492 + fprintf(ptCreateFile, "\nfi\n");
493 +
494 + fprintf(tfp, "\\begin{picture}(0,0)%%\n");
495 +/* newer includegraphics directive suggested by Stephen Harker 1/13/99 */
496 +#if defined(LATEX2E_GRAPHICS)
497 +# if defined(EPSFIG)
498 + fprintf(tfp, "\\epsfig{file=%s.eps}%%\n",szFileName);
499 +# else
500 + fprintf(tfp, "\\includegraphics{%s}%%\n",szFileName);
501 +# endif
502 +#else
503 + fprintf(tfp, "\\special{psfile=%s.eps}%%\n",szFileName);
504 +#endif
505 + fprintf(tfp, "\\end{picture}%%\n");
506 +}
507 +
508 +/*************************************************************************
509 + *************************************************************************/
510 +void genpstex_p_object(depth)
511 +int depth;
512 +{
513 + if (iTextRead)
514 + {
515 + fprintf(tfp, "\\end{picture}%%\n");
516 + iTextRead = 0;
517 + }
518 + if (iObjectsRead == 0)
519 + {
520 + iStartDepth = depth;
521 + iObjectsRead = 1;
522 + }
523 + iLastDepth = depth;
524 +
525 +}
526
527 +void genpstex_p_arc(obj)
528 +F_arc *obj;
529 +{
530 + genpstex_p_object(obj->depth);
531 +}
532 +
533 +
534 +void genpstex_p_ellipse(obj)
535 +F_ellipse *obj;
536 +{
537 + genpstex_p_object(obj->depth);
538 +}
539 +
540 +void genpstex_p_line(obj)
541 +F_line *obj;
542 +{
543 + genpstex_p_object(obj->depth);
544 +}
545 +
546 +void genpstex_p_spline(obj)
547 +F_spline *obj;
548 +{
549 + genpstex_p_object(obj->depth);
550 +}
551 +
552 +
553 +
554 +/*************************************************************************
555 + *************************************************************************/
556 +void genpstex_p_text(t)
557 +F_text *t;
558 +{
559 +
560 + if (!special_text(t))
561 + genpstex_p_object(t->depth);
562 + else
563 + {
564 + if (iObjectsRead)
565 + {
566 + genpstex_p_finalize_objects(iLastDepth);
567 + iObjectsRead = 0;
568 + }
569 + if (iTextRead == 0)
570 + {
571 + fprintf(tfp, "\\begin{picture}(0,0)(%d,%d)\n", llx, lly);
572 + iTextRead = 1;
573 + }
574 + genlatex_text(t);
575 + }
576 +
577 +}
578 +
579 +/*************************************************************************
580 + *************************************************************************/
581 void genpstex_t_option(opt, optarg)
582 char opt, *optarg;
583 {
584 @@ -112,6 +412,8 @@
585 else genlatex_text(t);
586 }
587
588 +/*************************************************************************
589 + *************************************************************************/
590 void genpstex_text(t)
591 F_text *t;
592 {
593 @@ -128,6 +430,32 @@
594 genlatex_option(opt, optarg);
595 }
596
597 +struct driver dev_pstex_p = {
598 + genpstex_p_option,
599 + genpstex_p_start,
600 + gendev_null,
601 + genpstex_p_arc,
602 + genpstex_p_ellipse,
603 + genpstex_p_line,
604 + genpstex_p_spline,
605 + genpstex_p_text,
606 + genpstex_p_end,
607 + INCLUDE_TEXT
608 +};
609 +
610 +struct driver dev_pdftex_p = {
611 + genpstex_p_option,
612 + genpdftex_p_start,
613 + gendev_null,
614 + genpstex_p_arc,
615 + genpstex_p_ellipse,
616 + genpstex_p_line,
617 + genpstex_p_spline,
618 + genpstex_p_text,
619 + genpstex_p_end,
620 + INCLUDE_TEXT
621 +};
622 +
623 struct driver dev_pstex_t = {
624 genpstex_t_option,
625 genpstex_t_start,
626 diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2dev/drivers.h transfig/fig2dev/drivers.h
627 --- transfig~/fig2dev/drivers.h
628 +++ transfig/fig2dev/drivers.h
629 @@ -30,8 +30,10 @@
630 extern struct driver dev_pdf;
631 extern struct driver dev_pdftex;
632 extern struct driver dev_pdftex_t;
633 +extern struct driver dev_pdftex_p;
634 extern struct driver dev_pstex;
635 extern struct driver dev_pstex_t;
636 +extern struct driver dev_pstex_p;
637 extern struct driver dev_pstricks;
638 extern struct driver dev_textyl;
639 extern struct driver dev_tk;
640 @@ -75,6 +77,7 @@
641 {"pdf", &dev_pdf},
642 {"pdftex", &dev_pdftex},
643 {"pdftex_t", &dev_pdftex_t},
644 + {"pdftex_p", &dev_pdftex_p},
645 {"pic", &dev_pic},
646 {"pictex", &dev_pictex},
647 {"png", &dev_bitmaps},
648 @@ -82,6 +85,7 @@
649 {"ps", &dev_ps},
650 {"pstex", &dev_pstex},
651 {"pstex_t", &dev_pstex_t},
652 + {"pstex_p", &dev_pstex_p},
653 {"pstricks", &dev_pstricks},
654 {"ptk", &dev_ptk},
655 {"shape", &dev_shape},
656 diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2dev/fig2dev.c transfig/fig2dev/fig2dev.c
657 --- transfig~/fig2dev/fig2dev.c
658 +++ transfig/fig2dev/fig2dev.c
659 @@ -651,6 +651,18 @@
660 #endif /* NFSS */
661 printf(" -p name name of the PostScript file to be overlaid\n");
662
663 + printf("PSTEX_P and PDFTEX_P Options:\n");
664 + printf(" -p name basename of the files to be created\n");
665 +#ifdef NFSS
666 + printf(" -F don't set font family/series/shape, so you can\n");
667 + printf(" set it from latex\n");
668 +#endif /* NFSS */
669 + printf(" -d dmag set separate magnification for length of line dashes to dmag\n");
670 + printf(" -E num set encoding for text translation (0 no translation,\n");
671 + printf(" 1 ISO-8859-1, 2 ISO-8859-2)\n");
672 + printf(" -l lwidth set threshold between thin and thick lines to lwidth\n");
673 + printf(" -v verbose mode\n");
674 +
675 printf("SHAPE (ShapePar driver) Options:\n");
676 printf(" -n name Set basename of the macro (e.g. \"face\" gives faceshape and facepar)\n");
677 printf("Tcl/Tk (tk) and Perl/Tk (ptk) Options:\n");
678 @@ -778,6 +790,12 @@
679 int rec_comp(r1, r2)
680 struct obj_rec *r1, *r2;
681 {
682 + if (r2->depth == r1->depth)
683 + {
684 + if ((r1->gendev == dev->text) ^ (r2->gendev == dev->text))
685 + return ((r1->gendev == dev->text) * 2 - 1);
686 + return (0);
687 + }
688 return (r2->depth - r1->depth);
689 }
690
691 diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2mpdf/copyright.txt transfig/fig2mpdf/copyright.txt
692 --- transfig~/fig2mpdf/copyright.txt
693 +++ transfig/fig2mpdf/copyright.txt
694 @@ -0,0 +1,25 @@
695 +The following files contain copyright and license info for
696 +the code they contain:
697 +fig2mpdf, fig2mpdf.1, transfig.3.2.4.patch, transfig-3.2.5-alpha7.patch
698 +
699 +-- fig2mpdf copyright begins here --
700 +
701 + fig2mpdf/pdftex_p and pstex_p driver of fig2dev
702 + Copyright (C) 2006 Michael Pfeiffer -- p3fff@×××.de
703 +
704 + This program is free software; you can redistribute it and/or modify
705 + it under the terms of the GNU General Public License as published by
706 + the Free Software Foundation; either version 2 of the License, or
707 + (at your option) any later version.
708 +
709 + This program is distributed in the hope that it will be useful,
710 + but WITHOUT ANY WARRANTY; without even the implied warranty of
711 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
712 + GNU General Public License for more details.
713 +
714 + You should have received a copy of the GNU General Public License
715 + along with this program; if not, write to the Free Software
716 + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
717 +
718 + (Author's note: the license is in the file gpl.txt, which is included
719 + in the archive.)
720 diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2mpdf/fig2mpdf transfig/fig2mpdf/fig2mpdf
721 --- transfig~/fig2mpdf/fig2mpdf
722 +++ transfig/fig2mpdf/fig2mpdf
723 @@ -0,0 +1,653 @@
724 +#!/bin/sh
725 +
726 +unset POSIXLY_CORRECT
727 +
728 +gawk '
729 +#########################################################################
730 +#########################################################################
731 +BEGIN {
732 +
733 + cmdGawk = "gawk";
734 + cmdCat = "cat";
735 + cmdLess = "less";
736 + cmdRm = "rm"
737 + cmdMv = "mv"
738 + cmdLatex = "latex";
739 + cmdPdftex = "pdflatex";
740 + cmdEpsToPdf = "epstopdf";
741 + cmdDvips = "dvips";
742 + cmdFig2dev = "fig2dev";
743 + cmdTouch = "touch";
744 +
745 + szVersion = "1.1.2";
746 + iError = 0;
747 + iGapWidth = 1;
748 +
749 +
750 + # get the options
751 + szOptString = "&l%e&m$p%i%I$s$H$g%G%v%V%d";
752 + getopt(szOptString);
753 +
754 + if (aOptions["d"])
755 + {
756 + aOptions["v"] = "-";
757 + for (iI = 0; iI < ARGC; iI++)
758 + printf("ARGV[%d]=%s\n", iI, ARGV[iI]);
759 +
760 + iDim = split(szOptString, aOpts, "[$%&]");
761 + for (iI = 2; iI <= iDim; iI++)
762 + debug("aOptions[%s] = >%s<\n", aOpts[iI], aOptions[aOpts[iI]]);
763 + }
764 +
765 +
766 +
767 + if (aOptions["V"] != "")
768 + {
769 + printf("fig2mpdf: version %s\n", szVersion);
770 + iError = 1;
771 + exit(0);
772 + }
773 +
774 + szTmpPrefix = "_fig2mpdf"
775 +
776 + iLine = -1;
777 + iInString = 0;
778 + iDepths = 1;
779 +
780 + iInvalidDepth = -2
781 + iAdminDepth = 2000
782 +
783 + szBase = ARGV[1];
784 + szOrigFile = ARGV[1];
785 + szOrigPath = ARGV[1];
786 +
787 + # set default switch state
788 + iDoMultiLayer = 0;
789 + iDoLatex = 0;
790 + iDoPdftex = 1;
791 + iIncludeLowestRange = 1;
792 +
793 + # set iDoLatex and iDoMultiLayer concerning the given suffix
794 + match(szBase, /\.[^\.\/]+$/);
795 + if (RLENGTH != -1)
796 + {
797 + szSuffix = substr(szBase, RSTART);
798 + if (szSuffix == ".lfig")
799 + iDoLatex = 1;
800 + else if (szSuffix == ".mfig")
801 + iDoMultiLayer = 1;
802 + else if ((szSuffix == ".mlfig") || (szSuffix == ".lmfig"))
803 + {
804 + iDoLatex = 1;
805 + iDoMultiLayer = 1;
806 + }
807 + }
808 +
809 + ################################
810 + # evalutate options
811 +
812 + # set toggle latex
813 + if (aOptions["l"] == "-")
814 + iDoLatex = 1;
815 + if (aOptions["l"] == "+")
816 + iDoLatex = 0;
817 +
818 + # set multilayer flag
819 + if (aOptions["m"] == "-")
820 + iDoMultiLayer = 1;
821 + if (aOptions["m"] == "+")
822 + iDoMultiLayer = 0;
823 +
824 + # set toggle pdftex
825 + if (aOptions["e"] == "-")
826 + iDoPdftex = 0;
827 +
828 + # evaluate do not include lowest layer in all figs
829 + iIncludeLowestRange = (aOptions["i"] == "-");
830 +
831 + # evaluate include all lower ranges in the sub figs
832 + iIncludeAllLowerRanges = (aOptions["I"] != "-");
833 +
834 + # check consistencies
835 + # if there are ranges given -> do multilayer
836 + if (aOptions["p"] != "")
837 + iDoMultiLayer = 1;
838 +
839 +
840 + if (aOptions["g"] != "")
841 + {
842 + if ( ! match (aOptions["g"], /^[0-9]+$/))
843 + usage();
844 +
845 + iGapWidth = aOptions["g"] + 1;
846 + }
847 +
848 + # get the basename of the source
849 + gsub(/\.[^\/]+$/, "", szBase);
850 + gsub(/^.*\//, "", szBase);
851 +
852 + # get the path to the original
853 + gsub(/[^\/]+$/, "", szOrigPath);
854 +}
855 +#########################################################################
856 +#########################################################################
857 +
858 +( iInString != 0) {
859 + aszLine[iLine] = sprintf("%s\n%s", aszLine[iLine], $0);
860 + iInString = (match($0, "\\\\001$") == 0);
861 + iSubLine++;
862 + next;
863 +}
864 +
865 +/^[135][ ]/ {
866 + iCmd = $1;
867 + iSubCmd = -1;
868 + iSubLine = 0;
869 + aiDepth[++iLine] = fnGetDepth($1);
870 + aszLine[iLine] = $0;
871 + next;
872 +}
873 +
874 +/^[2][ ]/ {
875 + iCmd = $1;
876 + iSubCmd = $2;
877 + iSubLine = 0;
878 + aiDepth[++iLine] = fnGetDepth($1);
879 + aszLine[iLine] = $0;
880 + next;
881 +}
882 +
883 +
884 +/^[4][ ]/ {
885 + iCmd = $1;
886 + iSubCmd = $2;
887 + iSubLine = 0;
888 + aiDepth[++iLine] = fnGetDepth($1);
889 + aszLine[iLine] = $0;
890 + iInString = (match($0, "\\\\001$") == 0);
891 + next;
892 +}
893 +
894 +/^(6[ ])|(-6)/ {
895 + iCmd = $1;
896 + iSubCmd = -1;
897 + iSubLine = 0;
898 + next;
899 +}
900 +
901 +/^[^ ]/ {
902 + iCmd = -1;
903 + aiDepth[++iLine] = fnGetDepth("A");
904 + iSubLine = 0;
905 + aszLine[iLine] = $0;
906 + next;
907 +}
908 +
909 +/^[ ]/ {
910 + iSubLine++;
911 + if ((iCmd == 2) && (iSubCmd == 5) && (iSubLine == 1))
912 + {
913 + if (match($0, "^\t[01] "))
914 + {
915 + szFileName = substr($0, RSTART + RLENGTH);
916 + if ( ! match(szFileName, /^\//))
917 + szFileName = sprintf("%s%s", szOrigPath, szFileName);
918 + aszLine[iLine] = sprintf("%s\n\t%s %s", aszLine[iLine], $1, szFileName);
919 + }
920 + else
921 + aszLine[iLine] = sprintf("%s\n%s", aszLine[iLine], $0);
922 + }
923 + else
924 + aszLine[iLine] = sprintf("%s\n%s", aszLine[iLine], $0);
925 +}
926 +
927 +
928 +END {
929 + iLine++;
930 + iLowestLayer = 0;
931 + iFirstRange = 0;
932 +
933 + if (iError == 0)
934 + {
935 +
936 +
937 + if (iDoMultiLayer)
938 + {
939 + asort(aiDepths, aiSortedDepth);
940 +
941 + # check for ranges as options
942 + if (aOptions["p"] != "")
943 + {
944 + # we have explicit ranges
945 + gsub(/-/, ":", aOptions["p"]);
946 + iRanges = split(aOptions["p"], aszRanges, ",");
947 + }
948 + else
949 + {
950 + if (iDepths < 4)
951 + {
952 + iRanges = 1;
953 + aszRanges[1] = "1:999";
954 + }
955 + else
956 + {
957 + iRanges = 0;
958 + iLastRange = aiSortedDepth[iDepths - 2] + 0;
959 + iRangeStart = iLastRange;
960 + for (iI = iDepths - 3; iI > 0; iI--)
961 + {
962 + aiSortedDepth[iI] += 0;
963 + if ((aiSortedDepth[iI] < iLastRange - iGapWidth) || (iI == 1))
964 + {
965 + if (aiSortedDepth[iI] >= iLastRange - iGapWidth)
966 + iLastRange = aiSortedDepth[iI];
967 +
968 + if (iLastRange != iRangeStart)
969 + aszRanges[++iRanges] = sprintf("%d:%d", iLastRange, iRangeStart);
970 + else
971 + aszRanges[++iRanges] = sprintf("%d", iRangeStart);
972 + iRangeStart = aiSortedDepth[iI];
973 +
974 + if ((iI == 1) && (aiSortedDepth[iI] < iLastRange - iGapWidth))
975 + aszRanges[++iRanges] = sprintf("%d", aiSortedDepth[iI]);
976 + }
977 + iLastRange = aiSortedDepth[iI];
978 + }
979 + }
980 + }
981 +
982 +
983 + # check for a multilayer file with only one range
984 + if ((iRanges == 1) && iIncludeLowestRange)
985 + {
986 + iIncludeLowestRange = 0;
987 + }
988 +
989 + szInitRangeList = " -D ";
990 + szSep = "";
991 +
992 + if (iIncludeLowestRange)
993 + {
994 + szInitRangeList = sprintf("%s+%s", szInitRangeList, aszRanges[1]);
995 + szSep = ",";
996 + }
997 + szRangeList = szInitRangeList;
998 +
999 + # step through the ranges
1000 + for (iI = iIncludeLowestRange; iI < iRanges; iI++)
1001 + {
1002 + szFileBase = sprintf("%s-%d", szBase, iI - iIncludeLowestRange);
1003 +
1004 + if (aOptions["I"])
1005 + {
1006 + szRangeList = sprintf("%s%s+%s", szRangeList, szSep, aszRanges[iI + 1]);
1007 + szSep = ",";
1008 + }
1009 + else
1010 + szRangeList = sprintf("%s%s+%s", szInitRangeList, szSep, aszRanges[iI + 1]);
1011 +
1012 +
1013 + if (iDoLatex)
1014 + szTargetFile = fnDoTexFig(szFileBase, szOrigFile, szRangeList, (iDoPdftex != 0));
1015 + else
1016 + szTargetFile = fnDoNormalFig(szFileBase, szOrigFile, szRangeList, (iDoPdftex != 0));
1017 +
1018 +
1019 + if (aOptions["G"])
1020 + {
1021 + match(szTargetFile, /\.[^.]*$/);
1022 + szCommand = sprintf("%s %s %s.page%d%s", cmdMv, szTargetFile, szBase, iI - iIncludeLowestRange, substr(szTargetFile, RSTART, RLENGTH));
1023 + debug("%s\n", szCommand);
1024 + system(szCommand);
1025 + }
1026 + }
1027 + }
1028 + else
1029 + {
1030 + szRangeList = "";
1031 +
1032 + if (iDoLatex)
1033 + szTargetFile = fnDoTexFig(szBase, szOrigFile, szRangeList, (iDoPdftex != 0));
1034 + else
1035 + szTargetFile = fnDoNormalFig(szBase, szOrigFile, szRangeList, (iDoPdftex != 0));
1036 + }
1037 + }
1038 +}
1039 +
1040 +
1041 +
1042 +#########################################################################
1043 +#########################################################################
1044 +function debug(str, arg0, arg1, arg2, arg3, arg4)
1045 +{
1046 + if (aOptions["v"])
1047 + printf (str, arg0, arg1, arg2, arg3, arg4);
1048 +}
1049 +
1050 +#########################################################################
1051 +#########################################################################
1052 +function fnGetDepth (iControl)
1053 +{
1054 +
1055 + if (iControl == 1)
1056 + {
1057 + iReturn = sprintf("%04d", $7);
1058 + }
1059 + else if (iControl == 2)
1060 + {
1061 + iReturn = sprintf("%04d", $7);
1062 + }
1063 + else if (iControl == 3)
1064 + {
1065 + iReturn = sprintf("%04d", $7);
1066 + }
1067 + else if (iControl == 4)
1068 + {
1069 + iReturn = sprintf("%04d", $4);
1070 + }
1071 + else if (iControl == 5)
1072 + {
1073 + iReturn = sprintf("%04d", $7);
1074 + }
1075 + else if ((iControl == 6) || (iControl == -6))
1076 + {
1077 + iReturn = sprintf("%04d", iInvalidDepth);
1078 + }
1079 + else
1080 + {
1081 + iReturn = sprintf("%04d", iAdminDepth);
1082 + }
1083 +
1084 + if (iReturn >= 0)
1085 + {
1086 + if (ahDepths[iReturn] == 0)
1087 + {
1088 + ahDepths[iReturn] = 1;
1089 + aiDepths[iDepths++] = iReturn;
1090 + }
1091 + }
1092 +
1093 + return (iReturn);
1094 +
1095 +}
1096 +
1097 +#########################################################################
1098 +#########################################################################
1099 +function fnDoNormalFig(szFileNameBase, szFigFile, szRangeList, iPdf,
1100 + szEpsFile, szPdfFile, szTargetFile, szCommand)
1101 +{
1102 +
1103 + debug("FileNameBase >%s< FigFile >%s< Pdf:%d\n", szFileNameBase, szFigFile, iPdf);
1104 +
1105 + if (iPdf)
1106 + szEpsFile = sprintf("%s%s.eps", szTmpPrefix, szFileNameBase);
1107 + else
1108 + {
1109 + szEpsFile = sprintf("%s.eps", szFileNameBase);
1110 + szTargetFile = szEpsFile;
1111 + }
1112 +
1113 + szCommand = sprintf("%s -L eps %s %s %s 2> /dev/null", cmdFig2dev, szRangeList, szFigFile, szEpsFile);
1114 + debug("%s\n", szCommand);
1115 + system(szCommand);
1116 +
1117 + if (iPdf)
1118 + {
1119 + szPdfFile = sprintf("%s.pdf", szFileNameBase);
1120 + szTargetFile = szPdfFile;
1121 + szCommand = sprintf("%s --outfile=%s %s", cmdEpsToPdf, szPdfFile, szEpsFile);
1122 + debug("%s\n", szCommand);
1123 + system(szCommand);
1124 +
1125 +
1126 + if ( ! aOptions["d"])
1127 + {
1128 + szCommand = sprintf("%s -f %s", cmdRm, szEpsFile);
1129 + debug("%s\n", szCommand);
1130 + system(szCommand);
1131 + }
1132 + }
1133 +
1134 +
1135 + return (szTargetFile);
1136 +}
1137 +
1138 +
1139 +#########################################################################
1140 +#########################################################################
1141 +function fnDoTexFig(szFileNameBase, szFigFile, szRangeList, iPdf,
1142 + szEpsFile, szPdfFile, szTexDoc, szTexPdf, szTexLog, szTexAux, szTexInp, szTmpPs, szTmpPdf, szTexSiz, szTmpEps, szCommand, szHeader)
1143 +{
1144 +
1145 + debug("FileNameBase >%s< FigFile >%s< Pdf:%d\n", szFileNameBase, szFigFile, iPdf);
1146 +
1147 + szEpsFile = sprintf("%s.eps", szFileNameBase);
1148 + szPdfFile = sprintf("%s.pdf", szFileNameBase);
1149 + szTexDoc = sprintf("%s%s_doc.tex", szTmpPrefix, szFileNameBase);
1150 + szTexPdf = sprintf("%s%s_doc.pdf", szTmpPrefix, szFileNameBase);
1151 + szTexDvi = sprintf("%s%s_doc.dvi", szTmpPrefix, szFileNameBase);
1152 + szTexLog = sprintf("%s%s_doc.log", szTmpPrefix, szFileNameBase);
1153 + szTexAux = sprintf("%s%s_doc.aux", szTmpPrefix, szFileNameBase);
1154 + szTexInpPref = sprintf("%s%s_inp", szTmpPrefix, szFileNameBase);
1155 + szTexInp = sprintf("%s.tex", szTexInpPref);
1156 + szTexCreator = sprintf("%s.create", szTexInpPref);
1157 + szTexSiz = sprintf("%s.size", szTexInpPref);
1158 +
1159 + if (iPdf)
1160 + szCommand = sprintf("%s -L pdftex_p %s -p %s %s %s", cmdFig2dev, szRangeList, szTexInpPref, szFigFile, szTexInp);
1161 + else
1162 + szCommand = sprintf("%s -L pstex_p %s -p %s %s %s", cmdFig2dev, szRangeList, szTexInpPref, szFigFile, szTexInp);
1163 + debug("%s\n", szCommand);
1164 + system(szCommand);
1165 +
1166 + szCommand = sprintf("./%s", szTexCreator);
1167 + debug("%s\n", szCommand);
1168 + system(szCommand);
1169 +
1170 + # check if there is an own hederfile to include
1171 + if (aOptions["s"] == "")
1172 + aOptions["s"] = "times";
1173 +
1174 + if (aOptions["H"] == "")
1175 + {
1176 + szHeader = sprintf("\\documentclass{article}\n\
1177 +\\usepackage{german,amssymb,amsmath}\n\
1178 +\\usepackage{%s}", aOptions["s"]);
1179 + }
1180 + else
1181 + szHeader = sprintf("\\input{%s}\n", aOptions["H"]);
1182 +
1183 + szHeader = sprintf("%s\n\
1184 +\\usepackage{color}\n\
1185 +\\usepackage{ifpdf}\n\
1186 +\\setlength{\\textwidth}{100cm}\n\
1187 +\\setlength{\\textheight}{100cm}\n\
1188 +\\setlength{\\topmargin}{-1in}\n\
1189 +\\setlength{\\headsep}{0pt}\n\
1190 +\\setlength{\\headheight}{0pt}\n\
1191 +\\setlength{\\oddsidemargin}{-1in}\n\
1192 +\\parindent=0cm\n\
1193 +\\ifpdf\n\
1194 +\\usepackage[pdftex]{graphicx}\n\
1195 +\\DeclareGraphicsExtensions{.pdf,.png,.jpg}\n\
1196 +\\usepackage{epsfig}\n\
1197 +\\input{%s}\n\
1198 +\\else\n\
1199 +\\usepackage{graphicx}\n\
1200 +\\usepackage{epsfig}\n\
1201 +\\fi\n\
1202 +", szHeader, szTexSiz);
1203 +
1204 + szCommand = sprintf("%s > %s << EOF\n\
1205 +%s\\begin{document}\n\
1206 +\\pagestyle{empty}\n\
1207 +\\input{%s}\n\
1208 +\\end{document}\n\
1209 +EOF", cmdCat, szTexDoc, szHeader, szTexInp);
1210 + if (aOptions["d"] != "")
1211 + debug("%s\n", szCommand);
1212 + system(szCommand);
1213 +
1214 + if (iPdf)
1215 + {
1216 +
1217 + szCommand = sprintf("%s -interaction batchmode %s", cmdPdftex, szTexDoc);
1218 + debug("%s\n", szCommand);
1219 + iReturn = system(szCommand);
1220 +
1221 + if (iReturn)
1222 + {
1223 + szCommand = sprintf("%s %s | %s +G", cmdCat, szTexLog, cmdLess);
1224 + system (szCommand);
1225 + }
1226 + else
1227 + {
1228 + szCommand = sprintf("%s %s %s", cmdMv, szTexPdf, szPdfFile);
1229 + debug("%s\n", szCommand);
1230 + system(szCommand);
1231 + }
1232 +
1233 + }
1234 + else
1235 + {
1236 + szCommand = sprintf("%s -interaction batchmode %s", cmdLatex, szTexDoc);
1237 + debug("%s\n", szCommand);
1238 + iReturn = system(szCommand);
1239 + if (iReturn)
1240 + {
1241 + szCommand = sprintf("%s %s | %s +G", cmdCat, szTexLog, cmdLess);
1242 + system (szCommand);
1243 + }
1244 + else
1245 + {
1246 + szCommand = sprintf("%s -q -E %s -o %s 2>&1 > /dev/null", cmdDvips, szTexDvi, szEpsFile);
1247 + debug("%s\n", szCommand);
1248 + system(szCommand);
1249 + }
1250 + }
1251 +
1252 + if ( ! aOptions["d"])
1253 + {
1254 + szCommand = sprintf("./%s -r", szTexCreator);
1255 + debug("%s\n", szCommand);
1256 + system(szCommand);
1257 + }
1258 +
1259 + if ( ! aOptions["d"])
1260 + {
1261 + szCommand = sprintf("%s -f %s %s %s %s %s %s %s", cmdRm, szTexDoc, szTexLog, szTexAux, szTexDvi, szTexInp, szTexCreator, szTexPdf);
1262 + debug("%s\n", szCommand);
1263 + system(szCommand);
1264 + }
1265 +
1266 + if (iPdf)
1267 + return (szPdfFile);
1268 + else
1269 + return (szEpsFile);
1270 +}
1271 +
1272 +
1273 +#########################################################################
1274 +#########################################################################
1275 +function getopt(sOptions, n, m, fHuntParam, iSearchMinus, iSPos, iCLen, iHuntSwitches, szSwChar, szOptChar) {
1276 +# Options: Flagoptions: %f
1277 +# Parameter: $p
1278 +
1279 + n = 1; # index in argv
1280 + m = 1; # processed entries in argv finally it points to the firs$
1281 + iSearchMinus = 1; # indicate that a switch leading sign minus is expected
1282 +
1283 + # check for initial -- to separate the gawk switches from the script switches
1284 + if (ARGV[n] == "--")
1285 + n++;
1286 +
1287 +
1288 + while (n < ARGC)
1289 + {
1290 + iHuntSwitches = 0;
1291 + iCLen = length(ARGV[n]);
1292 +
1293 + szSwChar = substr(ARGV[n], 1, 1);
1294 + if ((szSwChar == "-") || (szSwChar == "+"))
1295 + {
1296 + if ((iSearchMinus == 0) || fHuntParam)
1297 + usage();
1298 + iHuntSwitches = 1;
1299 + iSPos = 2;
1300 + fHuntParam = 0;
1301 + }
1302 + else
1303 + {
1304 + iSPos = 1;
1305 +
1306 + if (fHuntParam == 0)
1307 + iSearchMinus = 0;
1308 + }
1309 +
1310 + while (iSPos <= iCLen)
1311 + {
1312 + if (iHuntSwitches)
1313 + {
1314 + szOptChar = substr(ARGV[n], iSPos, 1);
1315 + iOPos = index(sOptions, szOptChar);
1316 + if (iOPos == 0)
1317 + {
1318 + printf("unknown option \"%s\"\n", szOptChar);
1319 + usage();
1320 + }
1321 + if ((substr(sOptions, iOPos - 1, 1) == "&") || ((substr(sOptions, iOPos - 1, 1) == "%") && (szSwChar == "-")))
1322 + {
1323 + aOptions[szOptChar] = szSwChar;
1324 + iSPos = iSPos + 1;
1325 + }
1326 + else if ((substr(sOptions, iOPos - 1, 1) == "$") && (szSwChar == "-"))
1327 + {
1328 + fHuntParam = 1;
1329 + iHuntSwitches = 0;
1330 + iSPos = iSPos + 1;
1331 + }
1332 + else
1333 + usage();
1334 +
1335 + }
1336 + else if (fHuntParam)
1337 + {
1338 + fHuntParam = 0;
1339 + aOptions[szOptChar] = substr(ARGV[n], iSPos, iCLen + 1 - iSPos);
1340 + iSPos = iCLen + 1;
1341 + }
1342 + else
1343 + {
1344 + ARGV[m++] = ARGV[n];
1345 + iSPos = iCLen + 1;
1346 + }
1347 + }
1348 + n = n + 1;
1349 + }
1350 + ARGC = m;
1351 +}
1352 +
1353 +
1354 +#########################################################################
1355 +#########################################################################
1356 +function usage() {
1357 + print "usage: fig2mpdf [-|+lm] [-eiIGvV] [-p <ranges>] [-g <gapwidth>] [-s <style>] [-H <headerfile>] file\n\
1358 +\n\
1359 + -|+l set|reset latex call\n\
1360 + -e create an eps file instead of a pdf\n\
1361 + -|+m set|reset multilayer creation\n\
1362 + -p <ranges> colon separated list of layer ranges a-b,c,d-e,...\n\
1363 + -i do include the deepest range in all figures\n\
1364 + (the one with the higest level number)\n\
1365 + -I include all lower ranges (pyramide mode)\n\
1366 + -g <gap> set layer gapwidth for automatically detecting ranges (default:0)\n\
1367 + -s <style> replace \\usepackage{times} by \\usepackage{<style>} in the latex commands\n\
1368 + -H <header> use file <header> for creating tex documents (only\n\
1369 + \\begin{document}...\\end{document} is set by fig2mpdf)\n\
1370 + -G name multilayer files in PGF file name format <name>.page<no>.<ext>\n\
1371 + -v be verbose\n\
1372 + -V print out the version of fig2mpdf\n";
1373 + exit 1;
1374 +}
1375 +' -- $*
1376 +
1377 diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2mpdf/fig2mpdf.1 transfig/fig2mpdf/fig2mpdf.1
1378 --- transfig~/fig2mpdf/fig2mpdf.1
1379 +++ transfig/fig2mpdf/fig2mpdf.1
1380 @@ -0,0 +1,208 @@
1381 +.TH fig2mpdf 1 "Jun 2006" "" "Including xfig figures into LaTeX documents"
1382 +.SH NAME
1383 +fig2mpdf \- creation of multilayer pdf or eps figures from fig files using latex for typesetting
1384 +.SH SYNOPSIS
1385 +.B fig2mpdf
1386 +[\fIOPTION\fR]... \fIFILE\fR
1387 +.SH DESCRIPTION
1388 +.PP
1389 +This tool can create pdf or eps figures using fig files as source. For beamer
1390 +presentations, for example, you can use the multilayer mode to create
1391 +multiple figures that can be overlayed to get a dynamic figure. For
1392 +proper appearance you can use latex to typeset some or all texts,
1393 +possibly containing formulas.
1394 +
1395 +The default interpretation of the given fig \fIFILE\fR depends on its suffix.
1396 +.TP
1397 +\fIfig\fR
1398 +Normal conversion of a fig file. All texts are interpreted as postscript
1399 +texts and all elements of the figure are included in the resulting figure.
1400 +.TP
1401 +\fIlfig\fR
1402 +LaTeX interpretation of the file. All texts of the input file that have the
1403 +special bit set are typeset by pdflatex resp. latex (see: Option \fB\-|+l\fR).
1404 +.TP
1405 +\fImfig\fR
1406 +Multilayer file interpretation. Depending on the used depths of the
1407 +figure it is split into multiple parts. For each part an output file is
1408 +created (see: section \fBMultiLayerOutput\fR).
1409 +.TP
1410 +\fImlfig\fR or \fIlmfig\fR
1411 +Combination of multilayer and LaTeX interpretation of the input (see: Suffix
1412 +\fIlfig\fR and \fImfig\fR).
1413 +.PP
1414 +The default interpretation of the input can be changed by using the options below.
1415 +.SH OPTIONS
1416 +.PP
1417 +.TP
1418 +\fB\-e\fR
1419 +produce an eps output file. Instead of creating a pdf file (the default)
1420 +an eps figure is produced.
1421 +.TP
1422 +\fB\-|+l\fR
1423 +force calling (pdf)latex (-) or do not use (pdf)latex (+) for
1424 +typesetting the text marked with the special flag. With this option you
1425 +can change the default behavior given by the input file suffix.
1426 +.TP
1427 +\fB\-|+m\fR
1428 +force set (-) or unset (+) the multilayer interpretation (see:
1429 +\fBMultiLayerOutput\fR below) which was previously set by the input
1430 +file suffix.
1431 +.TP
1432 +\fB\-p\fR \fIranges\fR
1433 +explicitly set the ranges of depths for splitting the input figure in
1434 +multilayer mode. \fIranges\fR is a colon separated list of ranges of
1435 +the form \fIupper-lower\fR or \fIdepth\fR where \fIupper\fR is the
1436 +top and \fIlower\fR the bottom depth in the range. If you use the
1437 +\fIdepth\fR form the range consist of just that depth.
1438 +.TP
1439 +\fB\-i\fR
1440 +include the the bottommost range (that is, the one with the highest depth) into
1441 +all output figures. This is for compatibility to older versions of this
1442 +tool.
1443 +.TP
1444 +\fB\-I\fR
1445 +turn on pyramid mode. The figure of a corresponding range in multilayer
1446 +mode includes all lower ranges too.
1447 +.TP
1448 +\fB\-g\fR \fIgapwidth\fR
1449 +set the allowed gapwidth between two used depths to decide if these
1450 +depths should be grouped together in one range. With this option you get
1451 +more flexibility to insert objects with new depths. The default width is
1452 +zero (no gap = consecutively numbered depths are grouped together).
1453 +.TP
1454 +\fB\-s\fR \fIstyle\fR
1455 +replace the default style for selecting a font family in LaTeX mode.
1456 +If this option is omitted the style `times' is set by default.
1457 +.TP
1458 +\fB\-H\fR \fIheader\fR
1459 +replace the default header sequence for creating temporary
1460 +LaTeX documents in LaTeX mode. To get maximum flexibility you can
1461 +set the entire document header in the file \fIheader\fR (see:
1462 +\fBCustomized Headers\fR below).
1463 +.TP
1464 +\fB\-G\fR
1465 +in multilayer mode change the default output file pattern to the PDF
1466 +format which is <name>.page<no>.<ext>
1467 +.TP
1468 +\fB\-v\fR
1469 +be verbose and print out all executed commands
1470 +.TP
1471 +\fB\-V\fR
1472 +print out the version of \fBfig2mpdf\fR
1473 +.PP
1474 +.SH "MultiLayerOutput"
1475 +In xfig you can assign an individual depth to all objects of the
1476 +figure. These depths are normally used to determine the order of
1477 +printing the objects. \fBfig2mpdf\fR uses these depths to group the
1478 +objects into ranges in automatic mode (if the ranges option is
1479 +omitted). In the list of used depths, consecutively numbered depths are
1480 +grouped into one range. That is, all gaps between used depths are used
1481 +to logically split the figure. With \fB\-g\fR you can set the
1482 +gapwidth which doesn't split the figure (default: zero).
1483 +.PP
1484 +The resulting list of ranges determines the number of output files. In
1485 +default mode all objects with depths assigned to one range are
1486 +collected and put into the corresponding output file. The contents of
1487 +the output files can be changed with the two Options \fB\-i\fR and
1488 +\fB\-I\fR.
1489 +.PP
1490 +The \fB\-i\fR option reduces the number of output files by one. The
1491 +bottommost range, that is the range which consist of the highest depths
1492 +of the figure, is included into all output files.
1493 +.PP
1494 +In pyramid mode, activated by the option \fB\-I\fR, the output files
1495 +contain additionally all lower ranges. With this mode you can
1496 +get stand alone figures that don't have to be overlayed to have
1497 +meaningful content.
1498 +.PP
1499 +\fBExample 1\fR
1500 +.PD 0
1501 +.PP
1502 +Assume that you have a fig file \fIfoo.fig\fR which contains the three ranges
1503 +.IR "230-233",
1504 +.IR "455-460"
1505 +and
1506 +.IR "499-500".
1507 +.PD
1508 +.PP
1509 +With no options set you get three output files, one per range. But if you
1510 +set the \fB\-i\fR option you get the following two files where the
1511 +bottommost range is included in both of the files:
1512 +.PD 0
1513 +.PP
1514 + \fIfoo-0.pdf\fR with ranges \fI455-460\fR and \fI499-500\fR
1515 +.PP
1516 + \fIfoo-1.pdf\fR with ranges \fI230-233\fR and \fI499-500\fR.
1517 +.PD
1518 +.PP
1519 +\fBExample 2\fR
1520 +.PD 0
1521 +.PP
1522 +The pyramid mode, activated by the option \fB\-I\fR, will produce the
1523 +following files from the source file of \fBExample 1\fR:
1524 +.PP
1525 + \fIfoo-0.pdf\fR with ranges \fI499-500\fR
1526 +.PP
1527 + \fIfoo-1.pdf\fR with ranges \fI455-460\fR and \fI499-500\fR
1528 +.PP
1529 + \fIfoo-2.pdf\fR with ranges \fI230-233\fR, \fI455-460\fR and \fI499-500\fR.
1530 +.PD
1531 +.PP
1532 +\fBExample 3\fR
1533 +.PD 0
1534 +.PP
1535 +If both options are set you will get just two files with the following
1536 +contents:
1537 +.PP
1538 + \fIfoo-0.pdf\fR with ranges \fI455-460\fR and \fI499-500\fR
1539 +.PP
1540 + \fIfoo-1.pdf\fR with ranges \fI230-233\fR, \fI455-460\fR and \fI499-500\fR.
1541 +.PD
1542 +.PP
1543 +.SH "Customized Headers"
1544 +For various reasons you might want to change the standard latex generation,
1545 +e.g., if you want to change the default font family. The following
1546 +example represents a valid header file.
1547 +
1548 +The usage of this example file changes the font family to sans serif
1549 +and adds an additional search path for includegraphics to the `figures'
1550 +subdirectory.
1551 +
1552 +.PD 0
1553 + \\documentclass{article}
1554 +.PP
1555 + \\usepackage{german,amssymb,amsmath}
1556 +.PP
1557 + \\renewcommand{\\familydefault}{\\sfdefault}
1558 +.PP
1559 + \\AtBeginDocument{\\graphicspath{{figures/}}}
1560 +.PD
1561 +
1562 +The following packages are generally used: \fBcolor\fR, \fBgraphicx\fR and \fBepsfig\fR.
1563 +.SH "Tex errors"
1564 +Sometimes it might happen that latex generates an error while processing
1565 +your special texts. To keep you informed about the occurrence of that
1566 +error and about what has happened, in this case the log file is shown
1567 +by invoking a less command.
1568 +.SH "Files"
1569 +In single layer mode for the resulting files the suffix fig is replaced
1570 +by pdf (resp. eps) (i.e. foo.fig -> foo.pdf).
1571 +.PP
1572 +.PD 0
1573 +In multilayer mode the base name of the source fig files is extended
1574 +by '-<range>' and the suffix is set to pdf (resp. eps).
1575 +.PP
1576 +(i.e., foo.fig -> foo-0.pdf, foo-1.pdf, foo-2.pdf, ...
1577 +.PP
1578 + or foo.fig -> foo.page0.pdf, foo.page1.pdf, foo.page2.pdf, ...
1579 +.PP
1580 + if the option \fB\-G\fR is set).
1581 +.PD
1582 +.SH "SEE ALSO"
1583 +.IR xfig(1)
1584 +.IR fig2dev(1)
1585 +.IR gawk(1)
1586 +.IR pdflatex(1)
1587 +.IR latex(1)
1588 +.IR dvips(1)
1589
1590
1591
1592 1.1 media-gfx/transfig/files/transfig-3.2.5d-leadspace.patch
1593
1594 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/transfig/files/transfig-3.2.5d-leadspace.patch?rev=1.1&view=markup
1595 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-gfx/transfig/files/transfig-3.2.5d-leadspace.patch?rev=1.1&content-type=text/plain
1596
1597 Index: transfig-3.2.5d-leadspace.patch
1598 ===================================================================
1599 #! /bin/sh /usr/share/dpatch/dpatch-run
1600 ## 25_PIC_leadspace.dpatch by Roger Leigh <rleigh@××××××.org>
1601 ##
1602 ## All lines beginning with `## DP:' are a description of the patch.
1603 ## DP: Avoid wrong leading spaces in PIC text (Closes: #611977).
1604
1605 @DPATCH@
1606 diff -urNad '--exclude=CVS' '--exclude=.svn' transfig~/fig2dev/dev/genpic.c transfig/fig2dev/dev/genpic.c
1607 --- transfig~/fig2dev/dev/genpic.c
1608 +++ transfig/fig2dev/dev/genpic.c
1609 @@ -443,7 +443,7 @@
1610 size = PICFONTMAG(t);
1611 if (!OptNoUnps) {
1612 unpsfont(t);
1613 - fprintf(tfp, "\"\\s%d\\f%s ", size, PICFONT(t->font));
1614 + fprintf(tfp, "\"\\s%d\\f%s", size, PICFONT(t->font));
1615 } else {
1616 fprintf(tfp, ".ps\n.ps %d\n", size );
1617 fprintf(tfp, ".ft\n.ft %s\n", PICPSFONT(t) );