Rev 8102 | Rev 8158 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8102 | Rev 8134 | ||
---|---|---|---|
Line 13... | Line 13... | ||
13 | * You should have received a copy of the GNU General Public License |
13 | * You should have received a copy of the GNU General Public License |
14 | * along with this program; if not, write to the Free Software |
14 | * along with this program; if not, write to the Free Software |
15 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
15 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
16 | */ |
16 | */ |
17 | 17 | ||
18 |
|
18 | /* This file is a temporary patch to tex eps files with extra borders. |
19 | |
19 | * It cuts the borders in the resulting gif file, so that the font |
20 | |
20 | * fits tightly in the cadre. libgd is required. |
- | 21 | */ |
|
21 | 22 | ||
22 | #include "flydraw.h" |
23 | #include "flydraw.h" |
23 | 24 | ||
24 | char imagefilename[1024]; |
25 | char imagefilename[1024]; |
25 | char vimgfilename[1024]; |
26 | char vimgfilename[1024]; |
Line 42... | Line 43... | ||
42 | * 1: DXF vector output. */ |
43 | * 1: DXF vector output. */ |
43 | int vimg_enable=0; /* 0: disable. 1: enable. */ |
44 | int vimg_enable=0; /* 0: disable. 1: enable. */ |
44 | int vimg_ready=0; |
45 | int vimg_ready=0; |
45 | FILE *vimgf=NULL; |
46 | FILE *vimgf=NULL; |
46 | double scale_buf[MAX_PARMS]; |
47 | double scale_buf[MAX_PARMS]; |
47 | /***** Les modifs a JC Fev 06 *****/ |
- | |
48 | / |
48 | /* les matrices suivantes sont initialisees par la commande setmatrix nummatrix,a11,a12,a21,a22 |
49 |
|
49 | * elles sont remises a l'unite par resetmatrix nummatrix |
50 | - | ||
51 |
|
50 | * la matrice fixant le systeme de coordonnees "mathematiques" dans l'image |
- | 51 | */ |
|
52 | matrice matrices_pavage[JC_NB_MATRICES+1]; |
52 | matrice matrices_pavage[JC_NB_MATRICES+1]; |
53 | vecteur vecteurs_pavage[JC_NB_MATRICES+1]; |
53 | vecteur vecteurs_pavage[JC_NB_MATRICES+1]; |
54 | 54 | ||
55 | / |
55 | /* les coordonnees du parallelograme de pavage = coordonnees "mathematiques" |
- | 56 | * du parallelogramme contenant l'image a recopier on place ces coorodonnes |
|
56 |
|
57 | * avec setparallelogram xs,ys,xu,yu,xv,yu |
57 |
|
58 | * xs,ys=coordonnees math du point 0,0, |
58 | * xu,yu coordonnees math de l'horizontale |
59 | * xu,yu coordonnees math de l'horizontale |
59 | * xv,yv coordonnees math de la verticale |
60 | * xv,yv coordonnees math de la verticale |
60 | * ces coordonnees sont remises a leur valeur par defaut par resetparallelogram |
61 | * ces coordonnees sont remises a leur valeur par defaut par resetparallelogram |
61 | */ |
62 | */ |
62 | /** TODO serait-ce un moyen de definir la brush ?? **/ |
- | |
63 | double parallogram_fonda[]={0,0,100,0,0,100}; |
63 | double parallogram_fonda[]={0,0,100,0,0,100}; |
64 | - | ||
65 | /**** Fin modifs JC Fev 06 ******/ |
- | |
66 | 64 | ||
67 | /* Write the image */ |
65 | /* Write the image */ |
68 | void output(void) |
66 | void output(void) |
69 | { |
67 | { |
70 | FILE *out; |
68 | FILE *out; |
Line 75... | Line 73... | ||
75 | if(out!=NULL) {gdImageGif(image,out); fclose(out); } |
73 | if(out!=NULL) {gdImageGif(image,out); fclose(out); } |
76 | } |
74 | } |
77 | else gdImageGif(image,stdout); |
75 | else gdImageGif(image,stdout); |
78 | saved=1; |
76 | saved=1; |
79 | } |
77 | } |
80 | - | ||
81 | /*#include "flylines.c"*/ |
- | |
82 | /*#include "nametab.c"*/ |
- | |
83 | 78 | ||
84 | /* substitute variable names by their environment strings |
79 | /* substitute variable names by their environment strings |
85 | * The buffer pointed to by p must have enough space |
80 | * The buffer pointed to by p must have enough space |
86 | * (defined by MAX_LINELEN). |
81 | * (defined by MAX_LINELEN). |
87 | */ |
82 | */ |
Line 105... | Line 100... | ||
105 | if(nametab[i].type==t_color) |
100 | if(nametab[i].type==t_color) |
106 | string_modify(p,pp,pe,colortab[nametab[i].serial].def); |
101 | string_modify(p,pp,pe,colortab[nametab[i].serial].def); |
107 | } |
102 | } |
108 | return p; |
103 | return p; |
109 | } |
104 | } |
110 | - | ||
111 | /*#include "vimg.c"*/ |
- | |
112 | /*#include "objects.c"*/ |
- | |
113 | 105 | ||
114 | void process(void) |
106 | void process(void) |
115 | { |
107 | { |
116 | char buf[MAX_LINELEN+1]; |
108 | char buf[MAX_LINELEN+1]; |
117 | int c; |
109 | int c; |