Mercurial > octave-nkf
comparison scripts/plot/print.m @ 6965:c962cc09067a
[project @ 2007-10-06 04:54:36 by jwe]
author | jwe |
---|---|
date | Sat, 06 Oct 2007 04:54:36 +0000 |
parents | 76e3d985ae56 |
children | 93c65f2a5668 |
comparison
equal
deleted
inserted
replaced
6964:33f20a41aeea | 6965:c962cc09067a |
---|---|
66 ## @itemx aifm | 66 ## @itemx aifm |
67 ## Adobe Illustrator | 67 ## Adobe Illustrator |
68 ## @item cdr | 68 ## @item cdr |
69 ## @itemx corel | 69 ## @itemx corel |
70 ## CorelDraw | 70 ## CorelDraw |
71 ## @item dxf | |
72 ## AutoCAD | |
73 ## @item emf | |
74 ## Microsoft Enhanced Metafile | |
75 ## @item fig | |
76 ## XFig | |
71 ## @item hpgl | 77 ## @item hpgl |
72 ## HP plotter language | 78 ## HP plotter language |
73 ## @item fig | |
74 ## XFig | |
75 ## @item dxf | |
76 ## AutoCAD | |
77 ## @item mf | 79 ## @item mf |
78 ## Metafont | 80 ## Metafont |
79 ## @item png | 81 ## @item png |
80 ## Portable network graphics | 82 ## Portable network graphics |
81 ## @item pbm | 83 ## @item pbm |
82 ## PBMplus | 84 ## PBMplus |
83 ## @item emf | 85 ## @item svg |
84 ## Microsoft Enhanced Metafile | 86 ## Scalable vector graphics |
85 ## @end table | 87 ## @end table |
86 ## | 88 ## |
87 ## Other devices are supported by "convert" from ImageMagick. Type | 89 ## Other devices are supported by "convert" from ImageMagick. Type |
88 ## system("convert") to see what formats are available. | 90 ## system("convert") to see what formats are available. |
89 ## | 91 ## |
90 ## If the device is omitted, it is inferred from the file extension, | 92 ## If the device is omitted, it is inferred from the file extension, |
91 ## or if there is no filename it is sent to the printer as postscript. | 93 ## or if there is no filename it is sent to the printer as postscript. |
94 ## | |
95 ## @itemx -S@var{xsize},@var{ysize} | |
96 ## Plot size in pixels for PNG and SVG. If using the command form of | |
97 ## the print function, you must quote the @var{xsize},@var{ysize} | |
98 ## option. For example, by writing @code{"-S640,480"}. | |
92 ## | 99 ## |
93 ## @item -F@var{fontname} | 100 ## @item -F@var{fontname} |
94 ## @itemx -F@var{fontname}:@var{size} | 101 ## @itemx -F@var{fontname}:@var{size} |
95 ## @itemx -F:@var{size} | 102 ## @itemx -F:@var{size} |
96 ## @var{fontname} set the postscript font (for use with postscript, | 103 ## @var{fontname} set the postscript font (for use with postscript, |
113 orientation = orient (); | 120 orientation = orient (); |
114 use_color = 0; # 0=default, -1=mono, +1=color | 121 use_color = 0; # 0=default, -1=mono, +1=color |
115 force_solid = 0; # 0=default, -1=dashed, +1=solid | 122 force_solid = 0; # 0=default, -1=dashed, +1=solid |
116 fontsize = ""; | 123 fontsize = ""; |
117 font = ""; | 124 font = ""; |
125 size = ""; | |
118 name = ""; | 126 name = ""; |
119 devopt = ""; | 127 devopt = ""; |
120 printer = ""; | 128 printer = ""; |
121 debug = false; | 129 debug = false; |
122 debug_file = "octave-print-commands.log"; | 130 debug_file = "octave-print-commands.log"; |
151 font = arg(3:idx-1); | 159 font = arg(3:idx-1); |
152 fontsize = arg(idx+1:length(arg)); | 160 fontsize = arg(idx+1:length(arg)); |
153 else | 161 else |
154 font = arg(3:length(arg)); | 162 font = arg(3:length(arg)); |
155 endif | 163 endif |
164 elseif (length (arg) > 2 && arg(1:2) == "-S") | |
165 size = arg(3:length(arg)); | |
156 elseif (length (arg) >= 1 && arg(1) == "-") | 166 elseif (length (arg) >= 1 && arg(1) == "-") |
157 error ("print: unknown option `%s'", arg); | 167 error ("print: unknown option `%s'", arg); |
158 elseif (length (arg) > 0) | 168 elseif (length (arg) > 0) |
159 name = arg; | 169 name = arg; |
160 endif | 170 endif |
195 elseif (strcmp (dev, "cdr")) | 205 elseif (strcmp (dev, "cdr")) |
196 dev = "corel"; | 206 dev = "corel"; |
197 endif | 207 endif |
198 | 208 |
199 ## check if we have to use convert | 209 ## check if we have to use convert |
200 dev_list = {"aifm", "corel", "fig", "png", "pbm", "dxf", "mf", ... | 210 dev_list = {"aifm", "corel", "fig", "png", "pbm", "dxf", "mf", "svg", ... |
201 "hpgl", "ps", "ps2", "psc", "psc2", "eps", "eps2", ... | 211 "hpgl", "ps", "ps2", "psc", "psc2", "eps", "eps2", ... |
202 "epsc", "epsc2", "emf", "pstex", "pslatex", ... | 212 "epsc", "epsc2", "emf", "pstex", "pslatex", ... |
203 "epslatex", "epslatexstandalone"}; | 213 "epslatex", "epslatexstandalone"}; |
204 convertname = ""; | 214 convertname = ""; |
205 [idx, errmsg] = cellidx (dev_list, dev); | 215 [idx, errmsg] = cellidx (dev_list, dev); |
329 ## eval (sprintf ("__gnuplot_set__ term %s color medium", dev)); | 339 ## eval (sprintf ("__gnuplot_set__ term %s color medium", dev)); |
330 ##else | 340 ##else |
331 ##eval (sprintf ("__gnuplot_set__ term %s mono medium", dev)); | 341 ##eval (sprintf ("__gnuplot_set__ term %s mono medium", dev)); |
332 ##endif | 342 ##endif |
333 | 343 |
334 new_terminal = "png large"; | 344 if (isempty (size)) |
345 options = " large"; | |
346 else | |
347 options = strcat (" size ", size); | |
348 endif | |
349 new_terminal = strcat ("png", options); | |
335 | 350 |
336 elseif (strcmp (dev, "dxf") || strcmp (dev, "mf") || strcmp (dev, "hpgl")) | 351 elseif (strcmp (dev, "dxf") || strcmp (dev, "mf") || strcmp (dev, "hpgl")) |
337 ## AutoCad DXF, METAFONT, HPGL | 352 ## AutoCad DXF, METAFONT, HPGL |
338 new_terminal = dev; | 353 new_terminal = dev; |
354 | |
355 elseif (strcmp (dev, "svg")) | |
356 ## SVG | |
357 options = ""; | |
358 if (! isempty (size)) | |
359 options = strcat (" size ", size); | |
360 endif | |
361 new_terminal = strcat ("svg", options); | |
362 | |
339 endif | 363 endif |
340 | 364 |
341 if (debug) | 365 if (debug) |
342 drawnow (new_terminal, name, debug_file); | 366 drawnow (new_terminal, name, debug_file); |
343 else | 367 else |