Mercurial > hg > octave-nkf
comparison scripts/plot/__print_parse_opts__.m @ 10861:2f70e7098cbe
__print_parse_opts__.m: .
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Thu, 05 Aug 2010 19:53:36 -0400 |
parents | d5a7db05d591 |
children | 337db4e1342d |
comparison
equal
deleted
inserted
replaced
10860:3a5f5c99cc39 | 10861:2f70e7098cbe |
---|---|
136 if (isempty (arg_st.orientation)) | 136 if (isempty (arg_st.orientation)) |
137 if (isfigure (arg_st.figure)) | 137 if (isfigure (arg_st.figure)) |
138 arg_st.orientation = get (arg_st.figure, "paperorientation"); | 138 arg_st.orientation = get (arg_st.figure, "paperorientation"); |
139 else | 139 else |
140 ## Allows tests to be run without error. | 140 ## Allows tests to be run without error. |
141 arg_st.orientation = get (0, "portrait"); | 141 arg_st.orientation = "portrait"; |
142 endif | 142 endif |
143 endif | 143 endif |
144 | 144 |
145 if (isempty (arg_st.ghostscript.binary)) | 145 if (isempty (arg_st.ghostscript.binary)) |
146 arg_st.ghostscript.binary = __ghostscript_binary__ (); | 146 arg_st.ghostscript.binary = __ghostscript_binary__ (); |
206 dev_list = {"aifm", "corel", "fig", "png", "jpeg", ... | 206 dev_list = {"aifm", "corel", "fig", "png", "jpeg", ... |
207 "gif", "pbm", "pbmraw", "dxf", "mf", ... | 207 "gif", "pbm", "pbmraw", "dxf", "mf", ... |
208 "svg", "hpgl", "ps", "ps2", "psc", ... | 208 "svg", "hpgl", "ps", "ps2", "psc", ... |
209 "psc2", "eps", "eps2", "epsc", "epsc2", ... | 209 "psc2", "eps", "eps2", "epsc", "epsc2", ... |
210 "emf", "pdf", "pslatex", "epslatex", "epslatexstandalone", ... | 210 "emf", "pdf", "pslatex", "epslatex", "epslatexstandalone", ... |
211 "pslatexstandalone", "pdflatexstandalone", ... | |
211 "pstex", "tiff", "tiffn" "tikz", "pcxmono", ... | 212 "pstex", "tiff", "tiffn" "tikz", "pcxmono", ... |
212 "pcx24b", "pcx256", "pcx16", "pgm", "pgmraw", ... | 213 "pcx24b", "pcx256", "pcx16", "pgm", "pgmraw", ... |
213 "ppm", "ppmraw"}; | 214 "ppm", "ppmraw", "pdflatex"}; |
214 | 215 |
215 suffixes = {"ai", "cdr", "fig", "png", "jpg", ... | 216 suffixes = {"ai", "cdr", "fig", "png", "jpg", ... |
216 "gif", "pbm", "pbm", "dxf", "mf", ... | 217 "gif", "pbm", "pbm", "dxf", "mf", ... |
217 "svg", "hpgl", "ps", "ps", "ps", ... | 218 "svg", "hpgl", "ps", "ps", "ps", ... |
218 "ps", "eps", "eps", "eps", "eps", ... | 219 "ps", "eps", "eps", "eps", "eps", ... |
219 "emf", "pdf", "tex", "tex", "tex", ... | 220 "emf", "pdf", "tex", "tex", "tex", ... |
221 "tex", "tex", ... | |
220 "tex", "tiff", "tiff", "tikz", "pcx", ... | 222 "tex", "tiff", "tiff", "tikz", "pcx", ... |
221 "pcx", "pcx", "pcx", "pgm", "pgm", ... | 223 "pcx", "pcx", "pcx", "pgm", "pgm", ... |
222 "ppm", "ppm"}; | 224 "ppm", "ppm", "tex"}; |
223 | 225 |
224 match = strcmpi (dev_list, arg_st.devopt); | 226 match = strcmpi (dev_list, arg_st.devopt); |
225 if (any (match)) | 227 if (any (match)) |
226 default_suffix = suffixes {match}; | 228 default_suffix = suffixes {match}; |
227 else | 229 else |
277 %! for n = 1:numel(opts.unlink) | 279 %! for n = 1:numel(opts.unlink) |
278 %! unlink (opts.unlink{n}); | 280 %! unlink (opts.unlink{n}); |
279 %! endfor | 281 %! endfor |
280 | 282 |
281 %!test | 283 %!test |
282 %! opts = __print_parse_opts__ ("test.pdf", "-SX640,Y480"); | 284 %! opts = __print_parse_opts__ ("test.pdf", "-S640,480"); |
283 %! assert (opts.canvas_size, [307.2, 230.4], 0.1); | 285 %! assert (opts.canvas_size, [307.2, 230.4], 0.1); |
284 | 286 |
285 %!test | 287 %!test |
286 %! opts = __print_parse_opts__ ("-dpsc", "-append"); | 288 %! opts = __print_parse_opts__ ("-dpsc", "-append"); |
287 %! assert (opts.devopt, "psc"); | 289 %! assert (opts.devopt, "psc"); |