Mercurial > hg > octave-nkf
annotate scripts/plot/util/private/__print_parse_opts__.m @ 20441:83792dd9bcc1
Use in-place operators in m-files where possible.
* scripts/audio/@audioplayer/set.m, scripts/audio/@audiorecorder/set.m,
scripts/audio/mu2lin.m, scripts/elfun/cosd.m, scripts/general/del2.m,
scripts/general/profexplore.m, scripts/general/quadl.m, scripts/general/rat.m,
scripts/general/rotdim.m, scripts/help/get_first_help_sentence.m,
scripts/help/private/__strip_html_tags__.m, scripts/image/cubehelix.m,
scripts/io/textread.m, scripts/linear-algebra/duplication_matrix.m,
scripts/linear-algebra/housh.m, scripts/linear-algebra/krylov.m,
scripts/linear-algebra/logm.m, scripts/linear-algebra/normest.m,
scripts/linear-algebra/onenormest.m, scripts/optimization/fminsearch.m,
scripts/optimization/lsqnonneg.m, scripts/optimization/qp.m,
scripts/plot/appearance/annotation.m, scripts/plot/appearance/axis.m,
scripts/plot/appearance/legend.m, scripts/plot/appearance/specular.m,
scripts/plot/draw/colorbar.m, scripts/plot/draw/hist.m,
scripts/plot/draw/plotmatrix.m, scripts/plot/draw/private/__stem__.m,
scripts/plot/util/__actual_axis_position__.m,
scripts/plot/util/__gnuplot_drawnow__.m, scripts/plot/util/findobj.m,
scripts/plot/util/print.m, scripts/plot/util/private/__go_draw_axes__.m,
scripts/plot/util/private/__print_parse_opts__.m, scripts/plot/util/rotate.m,
scripts/polynomial/pchip.m, scripts/polynomial/polyaffine.m,
scripts/polynomial/polyder.m, scripts/polynomial/private/__splinefit__.m,
scripts/polynomial/residue.m, scripts/signal/arch_fit.m,
scripts/signal/arch_rnd.m, scripts/signal/bartlett.m,
scripts/signal/blackman.m, scripts/signal/freqz.m, scripts/signal/hamming.m,
scripts/signal/hanning.m, scripts/signal/spectral_adf.m,
scripts/signal/spectral_xdf.m, scripts/signal/stft.m,
scripts/sparse/bicgstab.m, scripts/sparse/cgs.m,
scripts/sparse/private/__sprand_impl__.m, scripts/sparse/qmr.m,
scripts/sparse/sprandsym.m, scripts/sparse/svds.m, scripts/specfun/legendre.m,
scripts/special-matrix/gallery.m, scripts/statistics/base/gls.m,
scripts/statistics/models/logistic_regression.m,
scripts/statistics/tests/kruskal_wallis_test.m,
scripts/statistics/tests/manova.m, scripts/statistics/tests/wilcoxon_test.m,
scripts/time/datevec.m:
Use in-place operators in m-files where possible.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 26 May 2015 21:07:42 -0700 |
parents | 6b78feb92f53 |
children |
rev | line source |
---|---|
19898
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19793
diff
changeset
|
1 ## Copyright (C) 2010-2015 Shai Ayal |
10727
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
2 ## |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
3 ## This file is part of Octave. |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
4 ## |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
5 ## Octave is free software; you can redistribute it and/or modify it |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
6 ## under the terms of the GNU General Public License as published by |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
8 ## your option) any later version. |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
9 ## |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
10 ## Octave is distributed in the hope that it will be useful, but |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
13 ## General Public License for more details. |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
14 ## |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
15 ## You should have received a copy of the GNU General Public License |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
16 ## along with Octave; see the file COPYING. If not, see |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
18 |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
19 ## -*- texinfo -*- |
14366
b76f0740940e
doc: Periodic grammar check of documentation.
Rik <octave@nomad.inbox5.com>
parents:
14363
diff
changeset
|
20 ## @deftypefn {Function File} {@var{args} =} __print_parse_opts__ (@var{propname}, @var{propvalue}) |
14130
e13bfbc2c4c5
__print_parse_opts__.m: Fix doc string and copyright.
Ben Abbott <bpabbott@mac.com>
parents:
13728
diff
changeset
|
21 ## @deftypefnx {Function File} {@var{args} =} __print_parse_opts__ (@var{struct}) |
e13bfbc2c4c5
__print_parse_opts__.m: Fix doc string and copyright.
Ben Abbott <bpabbott@mac.com>
parents:
13728
diff
changeset
|
22 ## Undocumented internal function. |
10727
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
23 ## @end deftypefn |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
24 |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
25 function arg_st = __print_parse_opts__ (varargin) |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
26 |
11009 | 27 persistent warn_on_missing_binary = true |
28 | |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
29 arg_st.append_to_file = false; |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
30 arg_st.canvas_size = []; |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
31 arg_st.debug = false; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
32 arg_st.debug_file = "octave-print-commands.log"; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
33 arg_st.devopt = ""; |
11009 | 34 arg_st.epstool_binary = __quote_path__ (__find_binary__ ("epstool")); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
35 arg_st.figure = get (0, "currentfigure"); |
10889
1d7a7fb5074b
__print_parse_opts__.m: Double quote paths with spaces.
Ben Abbott <bpabbott@mac.com>
parents:
10876
diff
changeset
|
36 arg_st.fig2dev_binary = __quote_path__ (__find_binary__ ("fig2dev")); |
10727
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
37 arg_st.fontsize = ""; |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
38 arg_st.font = ""; |
14206
df695e37d404
Make sure "print '-SX,Y' ..." doesn't round down a pixel. Bug # 35307.
Ben Abbott <bpabbott@mac.com>
parents:
14138
diff
changeset
|
39 arg_st.scalefontsize = 1; |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
40 arg_st.force_solid = 0; # 0=default, -1=dashed, +1=solid |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
41 arg_st.formatted_for_printing = false; |
10889
1d7a7fb5074b
__print_parse_opts__.m: Double quote paths with spaces.
Ben Abbott <bpabbott@mac.com>
parents:
10876
diff
changeset
|
42 arg_st.ghostscript.binary = __quote_path__ (__ghostscript_binary__ ()); |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
43 arg_st.ghostscript.debug = false; |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
44 arg_st.ghostscript.device = ""; |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
45 arg_st.ghostscript.epscrop = true; |
19764
6a9bde1ba0ea
Stop using deprecated and removed ghostscript device pswrite (bug #41141)
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
46 arg_st.ghostscript.level = 2; |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
47 arg_st.ghostscript.output = ""; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
48 arg_st.ghostscript.papersize = ""; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
49 arg_st.ghostscript.pageoffset = []; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
50 arg_st.ghostscript.resolution = 150; |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
51 arg_st.ghostscript.antialiasing = false; |
14774
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14549
diff
changeset
|
52 arg_st.ghostscript.antialiasing_textalphabits = 4; |
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14549
diff
changeset
|
53 arg_st.ghostscript.antialiasing_graphicsalphabits = 4; |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
54 arg_st.loose = false; |
11009 | 55 arg_st.lpr_binary = __quote_path__ (__find_binary__ ("lpr")); |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
56 arg_st.name = ""; |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
57 arg_st.orientation = ""; |
10889
1d7a7fb5074b
__print_parse_opts__.m: Double quote paths with spaces.
Ben Abbott <bpabbott@mac.com>
parents:
10876
diff
changeset
|
58 arg_st.pstoedit_binary = __quote_path__ (__find_binary__ ("pstoedit")); |
11009 | 59 arg_st.preview = ""; |
10727
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
60 arg_st.printer = ""; |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
61 arg_st.send_to_printer = false; |
10727
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
62 arg_st.special_flag = "textnormal"; |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
63 arg_st.tight_flag = false; |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
64 arg_st.use_color = 0; # 0=default, -1=mono, +1=color |
11009 | 65 |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
66 if (isunix ()) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
67 arg_st.lpr_options = "-l"; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
68 elseif (ispc ()) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
69 arg_st.lpr_options = "-o l"; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
70 else |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
71 arg_st.lpr_options = ""; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
72 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
73 arg_st.unlink = {}; |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
74 |
11268
1ddf64be9cbd
__print_parse_opts__.m: For tests, allow __print_parse_opts__ to run with no inputs.
Ben Abbott <bpabbott@mac.com>
parents:
11253
diff
changeset
|
75 if (nargin > 0 && isfigure (varargin{1})) |
11253 | 76 arg_st.figure = varargin{1}; |
77 varargin(1) = []; | |
78 endif | |
79 | |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14774
diff
changeset
|
80 for i = 1:numel (varargin) |
11009 | 81 arg = strtrim (varargin{i}); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
82 if (ischar (arg)) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
83 if (strcmp (arg, "-color")) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
84 arg_st.use_color = 1; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
85 elseif (strcmp (arg, "-append")) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
86 arg_st.append_to_file = true; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
87 elseif (strcmp (arg, "-mono")) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
88 arg_st.use_color = -1; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
89 elseif (strcmp (arg, "-solid")) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
90 arg_st.force_solid = 1; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
91 elseif (strcmp (arg, "-dashed")) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
92 arg_st.force_solid = -1; |
17405
3f0ed69d21c6
Replace unnecessary instances of strncmp with strcmp.
Rik <rik@octave.org>
parents:
17380
diff
changeset
|
93 elseif (strncmp (arg, "-portrait", length (arg))) |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
94 arg_st.orientation = "portrait"; |
17405
3f0ed69d21c6
Replace unnecessary instances of strncmp with strcmp.
Rik <rik@octave.org>
parents:
17380
diff
changeset
|
95 elseif (strncmp (arg, "-landscape", length (arg))) |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
96 arg_st.orientation = "landscape"; |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
97 elseif (strcmp (arg, "-loose")) |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
98 arg_st.loose = true; |
11027
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
99 arg_st.tight_flag = false; |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
100 elseif (strcmp (arg, "-tight")) |
11027
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
101 arg_st.loose = false; |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
102 arg_st.tight_flag = true; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
103 elseif (strcmp (arg, "-textspecial")) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
104 arg_st.special_flag = "textspecial"; |
11009 | 105 elseif (any (strcmp (arg, {"-interchange", "-metafile", "-pict", "-tiff"}))) |
106 arg_st.preview = arg(2:end); | |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
107 elseif (strncmp (arg, "-debug", 6)) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
108 arg_st.debug = true; |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
109 arg_st.ghostscript.debug = true; |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
110 if (length (arg) > 7) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
111 arg_st.debug_file = arg(8:end); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
112 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
113 elseif (length (arg) > 2 && arg(1:2) == "-d") |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
114 arg_st.devopt = tolower (arg(3:end)); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
115 elseif (length (arg) > 2 && arg(1:2) == "-P") |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
116 arg_st.printer = arg; |
11009 | 117 elseif (strncmp (arg, "-EPSTOOL:", 9)) |
118 arg_st.epstool_binary = arg{10:end}; | |
119 elseif (strncmp (arg, "-FIG2DEV:", 9)) | |
120 arg_st.fig2dev_binary = arg{10:end}; | |
121 elseif (strncmp (arg, "-PSTOEDIT:", 9)) | |
122 arg_st.pstoedit_binary = arg{10:end}; | |
14774
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14549
diff
changeset
|
123 elseif (strncmpi (arg, "-textalphabits=", 15)) |
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14549
diff
changeset
|
124 n = find (arg == "="); |
17405
3f0ed69d21c6
Replace unnecessary instances of strncmp with strcmp.
Rik <rik@octave.org>
parents:
17380
diff
changeset
|
125 if (! isempty (n) && n == numel (arg) - 1 && any (arg(end) == "124")) |
14774
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14549
diff
changeset
|
126 arg_st.ghostscript.antialiasing_textalphabits = str2num (arg(end)); |
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14549
diff
changeset
|
127 else |
15202
f3b5cadfd6d5
fix missing semicolons in various .m files
John W. Eaton <jwe@octave.org>
parents:
14872
diff
changeset
|
128 error ("print: improper syntax, or value, for TextAlphaBits"); |
14774
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14549
diff
changeset
|
129 endif |
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14549
diff
changeset
|
130 elseif (strncmpi (arg, "-graphicsalphabits=", 19)) |
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14549
diff
changeset
|
131 n = find (arg == "="); |
17405
3f0ed69d21c6
Replace unnecessary instances of strncmp with strcmp.
Rik <rik@octave.org>
parents:
17380
diff
changeset
|
132 if (! isempty (n) && n == numel (arg) - 1 && any (arg(end) == "124")) |
14774
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14549
diff
changeset
|
133 arg_st.ghostscript.antialiasing_graphicsalphabits = str2num (arg(end)); |
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14549
diff
changeset
|
134 else |
15202
f3b5cadfd6d5
fix missing semicolons in various .m files
John W. Eaton <jwe@octave.org>
parents:
14872
diff
changeset
|
135 error ("print: improper syntax, or value, for GraphicsAlphaBits"); |
14774
0d6dae0f6bc2
Allow setting of ghostscript TextAlphaBits and GraphicsAlphaBits.
John Hunt <huntj@gmx.us>
parents:
14549
diff
changeset
|
136 endif |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
137 elseif ((length (arg) > 2) && arg(1:2) == "-G") |
11300
4ecc7bc5bc83
search PATH from environment for programs, not EXEC_PATH
John W. Eaton <jwe@octave.org>
parents:
11268
diff
changeset
|
138 arg_st.ghostscript.binary = file_in_path (getenv ("PATH"), arg(3:end)); |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
139 if (isempty (arg_st.ghostscript.binary)) |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
140 error ("print: Ghostscript binary ""%s"" could not be located", |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
141 arg(3:end)); |
10889
1d7a7fb5074b
__print_parse_opts__.m: Double quote paths with spaces.
Ben Abbott <bpabbott@mac.com>
parents:
10876
diff
changeset
|
142 else |
15611
773892abfd93
Add correct typo ghostscript_binary -> ghostscript.binary.
Dmitri A. Sergatskov <dasergatskov@gmail.com>
parents:
15610
diff
changeset
|
143 arg_st.ghostscript.binary = __quote_path__ (arg_st.ghostscript.binary); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
144 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
145 elseif (length (arg) > 2 && arg(1:2) == "-F") |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
146 idx = rindex (arg, ":"); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
147 if (idx) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
148 arg_st.font = arg(3:idx-1); |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
149 arg_st.fontsize = str2num (arg(idx+1:end)); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
150 else |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
151 arg_st.font = arg(3:end); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
152 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
153 elseif (length (arg) > 2 && arg(1:2) == "-S") |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
154 arg_st.canvas_size = str2num (arg(3:end)); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
155 elseif (length (arg) > 2 && arg(1:2) == "-r") |
11333
492e7b587352
Convert print resolution from char to double.
Rik <octave@nomad.inbox5.com>
parents:
11300
diff
changeset
|
156 arg_st.ghostscript.resolution = str2double (arg(3:end)); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
157 elseif (length (arg) > 2 && arg(1:2) == "-f") |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
158 arg_st.figure = str2num (arg(3:end)); |
20248
6b78feb92f53
Accept, but warn about unimplemented Matlab print options (bug #44760).
Rik <rik@octave.org>
parents:
20038
diff
changeset
|
159 elseif (any (strcmp (arg, {"-painters", "-opengl"}))) |
6b78feb92f53
Accept, but warn about unimplemented Matlab print options (bug #44760).
Rik <rik@octave.org>
parents:
20038
diff
changeset
|
160 warning ("print: '%s' accepted for Matlab compatibility, but is ignored", arg); |
6b78feb92f53
Accept, but warn about unimplemented Matlab print options (bug #44760).
Rik <rik@octave.org>
parents:
20038
diff
changeset
|
161 elseif (strcmp (arg, "-noui")) |
6b78feb92f53
Accept, but warn about unimplemented Matlab print options (bug #44760).
Rik <rik@octave.org>
parents:
20038
diff
changeset
|
162 warning ("print: option '-noui' not yet implemented"); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
163 elseif (length (arg) >= 1 && arg(1) == "-") |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14530
diff
changeset
|
164 error ("print: unknown option '%s'", arg); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
165 elseif (length (arg) > 0) |
16488
d4ce14c19c2c
Fix print to work with filenames which begin with '~' (bug #38694).
Rik <rik@octave.org>
parents:
15624
diff
changeset
|
166 arg_st.name = tilde_expand (arg); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
167 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
168 elseif (isfigure (arg)) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
169 arg_st.figure = arg; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
170 else |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
171 error ("print: expecting inputs to be character string options or a figure handle"); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
172 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
173 endfor |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
174 |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
175 if (arg_st.ghostscript.resolution == 0) |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
176 ## Do as Matlab does. |
14530
93cb513ed5fc
Fix regression after 3.4.0 with '-r0' option to print (bug #36092).
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
177 arg_st.ghostscript.resolution = get (0, "screenpixelsperinch"); |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
178 endif |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
179 |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
180 if (isempty (arg_st.orientation)) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
181 if (isfigure (arg_st.figure)) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
182 arg_st.orientation = get (arg_st.figure, "paperorientation"); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
183 else |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
184 ## Allows tests to be run without error. |
10861 | 185 arg_st.orientation = "portrait"; |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
186 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
187 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
188 |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
189 if (isempty (arg_st.ghostscript.binary)) |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
190 arg_st.ghostscript.binary = __ghostscript_binary__ (); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
191 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
192 |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
193 dot = rindex (arg_st.name, "."); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
194 if (isempty (arg_st.devopt)) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
195 if (dot == 0) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
196 arg_st.devopt = "psc"; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
197 else |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
198 arg_st.devopt = tolower (arg_st.name(dot+1:end)); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
199 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
200 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
201 |
10918
811f8611995d
__print_parse_opts__.m: Fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
10913
diff
changeset
|
202 if (arg_st.use_color == 0) |
811f8611995d
__print_parse_opts__.m: Fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
10913
diff
changeset
|
203 if (any (strcmp ({"ps", "ps2", "eps", "eps2"}, arg_st.devopt))) |
811f8611995d
__print_parse_opts__.m: Fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
10913
diff
changeset
|
204 arg_st.use_color = -1; |
811f8611995d
__print_parse_opts__.m: Fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
10913
diff
changeset
|
205 else |
811f8611995d
__print_parse_opts__.m: Fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
10913
diff
changeset
|
206 arg_st.use_color = 1; |
811f8611995d
__print_parse_opts__.m: Fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
10913
diff
changeset
|
207 endif |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
208 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
209 |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
210 if (strcmp (arg_st.devopt, "tex")) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
211 arg_st.devopt = "epslatex"; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
212 elseif (strcmp (arg_st.devopt, "ill")) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
213 arg_st.devopt = "aifm"; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
214 elseif (strcmp (arg_st.devopt, "cdr")) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
215 arg_st.devopt = "corel"; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
216 elseif (strcmp (arg_st.devopt, "meta")) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
217 arg_st.devopt = "emf"; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
218 elseif (strcmp (arg_st.devopt, "jpg")) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
219 arg_st.devopt = "jpeg"; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
220 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
221 |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
222 dev_list = {"aifm", "corel", "fig", "png", "jpeg", ... |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
223 "gif", "pbm", "pbmraw", "dxf", "mf", ... |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
224 "svg", "hpgl", "ps", "ps2", "psc", ... |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
225 "psc2", "eps", "eps2", "epsc", "epsc2", ... |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
226 "emf", "pdf", "pslatex", "epslatex", "epslatexstandalone", ... |
10861 | 227 "pslatexstandalone", "pdflatexstandalone", ... |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
228 "pstex", "tiff", "tiffn" "tikz", "pcxmono", ... |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
229 "pcx24b", "pcx256", "pcx16", "pgm", "pgmraw", ... |
11009 | 230 "ppm", "ppmraw", "pdflatex", "texdraw", ... |
11022
a5bee81bb69f
__print_parse_opts__.m: Recongize gs devices {eps/pdf/ps}write.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
231 "pdfcairo", "pngcairo", "pstricks", ... |
19778
2058d87174c8
Recognize new eps2write device from Ghostscript (partial fix for bug #43989).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
232 "epswrite", "eps2write", "pswrite", "ps2write", "pdfwrite"}; |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
233 |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
234 suffixes = {"ai", "cdr", "fig", "png", "jpg", ... |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
235 "gif", "pbm", "pbm", "dxf", "mf", ... |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
236 "svg", "hpgl", "ps", "ps", "ps", ... |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
237 "ps", "eps", "eps", "eps", "eps", ... |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
238 "emf", "pdf", "tex", "tex", "tex", ... |
10861 | 239 "tex", "tex", ... |
10876
53ec464300ef
__print_parse_opts__.m: Default pstex suffix should be '.ps'.
Ben Abbott <bpabbott@mac.com>
parents:
10862
diff
changeset
|
240 "ps", "tiff", "tiff", "tikz", "pcx", ... |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
241 "pcx", "pcx", "pcx", "pgm", "pgm", ... |
11009 | 242 "ppm", "ppm", "tex", "tex", ... |
11022
a5bee81bb69f
__print_parse_opts__.m: Recongize gs devices {eps/pdf/ps}write.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
243 "pdf", "png", "tex", ... |
19778
2058d87174c8
Recognize new eps2write device from Ghostscript (partial fix for bug #43989).
Rik <rik@octave.org>
parents:
19766
diff
changeset
|
244 "eps", "eps", "ps", "ps", "pdf"}; |
10727
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
245 |
11027
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
246 if (isfigure (arg_st.figure)) |
11576
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
247 __graphics_toolkit__ = get (arg_st.figure, "__graphics_toolkit__"); |
11027
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
248 else |
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
249 ## Allow tests when no figures are present. |
11576
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
250 __graphics_toolkit__ = get (0, "defaultfigure__graphics_toolkit__"); |
11027
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
251 endif |
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
252 |
11576
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
253 if (strcmp (__graphics_toolkit__, "gnuplot") |
10913
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
254 && __gnuplot_has_feature__ ("epslatex_implies_eps_filesuffix")) |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
255 suffixes(strncmp (dev_list, "epslatex", 8)) = {"eps"}; |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
256 endif |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
257 |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
258 match = strcmpi (dev_list, arg_st.devopt); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
259 if (any (match)) |
20038
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
260 default_suffix = suffixes{match}; |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
261 else |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
262 default_suffix = arg_st.devopt; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
263 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
264 |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
265 if (dot == 0 && ! isempty (arg_st.name)) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
266 arg_st.name = strcat (arg_st.name, ".", default_suffix); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
267 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
268 |
10913
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
269 if (arg_st.append_to_file) |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
270 if (isempty (arg_st.name)) |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
271 arg_st.append_to_file = false; |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
272 elseif (any (strcmpi (arg_st.devopt, {"eps", "eps2", "epsc", "epsc2", ... |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
273 "ps", "ps2", "psc", "psc2", "pdf"}))) |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
274 have_ghostscript = ! isempty (__ghostscript_binary__ ()); |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
275 if (have_ghostscript) |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
276 file_exists = ((numel (dir (arg_st.name)) == 1) |
11009 | 277 && (! isdir (arg_st.name))); |
10913
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
278 if (! file_exists) |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
279 arg_st.append_to_file = false; |
11113
a8ac114ec9ab
Stylefixes, replace end by endif.
Thorsten Meyer <thorsten.meyier@gmx.de>
parents:
11031
diff
changeset
|
280 endif |
10913
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
281 else |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
282 arg_st.append_to_file = false; |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
283 warning ("print.m: appended output requires ghostscript to be installed"); |
10913
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
284 endif |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
285 else |
11009 | 286 warning ("print.m: appended output is not supported for device '%s'", |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
287 arg_st.devopt); |
10913
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
288 arg_st.append_to_file = false; |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
289 endif |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
290 endif |
dd6b90f44ae5
Unify gnuplot printing with the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10889
diff
changeset
|
291 |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
292 if (! isempty (arg_st.printer) || isempty (arg_st.name)) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
293 arg_st.send_to_printer = true; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
294 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
295 |
11022
a5bee81bb69f
__print_parse_opts__.m: Recongize gs devices {eps/pdf/ps}write.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
296 if (any (strcmp (arg_st.devopt, {"ps", "ps2", "psc", "psc2", "pdf"}))) |
a5bee81bb69f
__print_parse_opts__.m: Recongize gs devices {eps/pdf/ps}write.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
297 arg_st.formatted_for_printing = true; |
a5bee81bb69f
__print_parse_opts__.m: Recongize gs devices {eps/pdf/ps}write.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
298 endif |
a5bee81bb69f
__print_parse_opts__.m: Recongize gs devices {eps/pdf/ps}write.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
299 |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
300 aliases = gs_aliases (); |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
301 if (any (strcmp (arg_st.devopt, fieldnames (aliases)))) |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
302 arg_st.devopt = aliases.(arg_st.devopt); |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
303 endif |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
304 |
11022
a5bee81bb69f
__print_parse_opts__.m: Recongize gs devices {eps/pdf/ps}write.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
305 if ((any (strcmp (arg_st.devopt, gs_device_list)) |
a5bee81bb69f
__print_parse_opts__.m: Recongize gs devices {eps/pdf/ps}write.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
306 && ! arg_st.formatted_for_printing) |
a5bee81bb69f
__print_parse_opts__.m: Recongize gs devices {eps/pdf/ps}write.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
307 || any (strcmp (arg_st.devopt, {"pswrite", "ps2write", "pdfwrite"}))) |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
308 ## Use ghostscript for graphic formats |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
309 arg_st.ghostscript.device = arg_st.devopt; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
310 arg_st.ghostscript.output = arg_st.name; |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
311 arg_st.ghostscript.antialiasing = true; |
11027
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
312 if (arg_st.formatted_for_printing) |
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
313 arg_st.ghostscript.epscrop = ! arg_st.loose; |
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
314 else |
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
315 ## pstoedit throws errors if the EPS file isn't cropped |
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
316 arg_st.ghostscript.epscrop = true; |
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
317 endif |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
318 elseif (all (! strcmp (arg_st.devopt, dev_list))) |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
319 ## Assume we are formating output for a printer |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
320 arg_st.formatted_for_printing = true; |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
321 arg_st.ghostscript.device = arg_st.devopt; |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
322 arg_st.ghostscript.output = arg_st.name; |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
323 arg_st.ghostscript.antialiasing = false; |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
324 arg_st.ghostscript.epscrop = ! arg_st.loose; |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
325 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
326 |
17380
50794f5e2323
Set gs sOutputFile option to "-" when spooling to the system printer.
Ben Abbott <bpabbott@mac.com>
parents:
17174
diff
changeset
|
327 if (arg_st.send_to_printer) |
50794f5e2323
Set gs sOutputFile option to "-" when spooling to the system printer.
Ben Abbott <bpabbott@mac.com>
parents:
17174
diff
changeset
|
328 if (isempty (arg_st.name)) |
19790
446c46af4b42
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
329 ## Pipe the ghostscript output |
17380
50794f5e2323
Set gs sOutputFile option to "-" when spooling to the system printer.
Ben Abbott <bpabbott@mac.com>
parents:
17174
diff
changeset
|
330 arg_st.name = "-"; |
50794f5e2323
Set gs sOutputFile option to "-" when spooling to the system printer.
Ben Abbott <bpabbott@mac.com>
parents:
17174
diff
changeset
|
331 else |
50794f5e2323
Set gs sOutputFile option to "-" when spooling to the system printer.
Ben Abbott <bpabbott@mac.com>
parents:
17174
diff
changeset
|
332 error ("print: a file name may not specified when spooling to a printer") |
50794f5e2323
Set gs sOutputFile option to "-" when spooling to the system printer.
Ben Abbott <bpabbott@mac.com>
parents:
17174
diff
changeset
|
333 endif |
18749
077575fe9a7e
__print_parse_opts__.m: Add ')' missing in cset cdc16fbb513f.
Rik <rik@octave.org>
parents:
18748
diff
changeset
|
334 if (! any (strcmp (arg_st.devopt, gs_device_list))) |
18748
cdc16fbb513f
Allow only Ghostscript devices when spooling to a printer (bug #41957)
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
335 ## Only supported ghostscript devices |
cdc16fbb513f
Allow only Ghostscript devices when spooling to a printer (bug #41957)
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
336 error ("print: format must be a valid Ghostscript format for spooling to a printer") |
17380
50794f5e2323
Set gs sOutputFile option to "-" when spooling to the system printer.
Ben Abbott <bpabbott@mac.com>
parents:
17174
diff
changeset
|
337 endif |
50794f5e2323
Set gs sOutputFile option to "-" when spooling to the system printer.
Ben Abbott <bpabbott@mac.com>
parents:
17174
diff
changeset
|
338 elseif (isempty (arg_st.name)) |
50794f5e2323
Set gs sOutputFile option to "-" when spooling to the system printer.
Ben Abbott <bpabbott@mac.com>
parents:
17174
diff
changeset
|
339 error ("print: an output file name must be specified") |
50794f5e2323
Set gs sOutputFile option to "-" when spooling to the system printer.
Ben Abbott <bpabbott@mac.com>
parents:
17174
diff
changeset
|
340 endif |
50794f5e2323
Set gs sOutputFile option to "-" when spooling to the system printer.
Ben Abbott <bpabbott@mac.com>
parents:
17174
diff
changeset
|
341 |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
342 if (isempty (arg_st.canvas_size)) |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
343 if (isfigure (arg_st.figure)) |
11009 | 344 [arg_st.ghostscript.papersize, paperposition] = ... |
345 gs_papersize (arg_st.figure, arg_st.orientation); | |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
346 else |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
347 ## allows tests to be run |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
348 arg_st.ghostscript.papersize = "letter"; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
349 paperposition = [0.25, 2.50, 8.00, 6.00] * 72; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
350 endif |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
351 arg_st.canvas_size = paperposition(3:4); |
20038
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
352 if (strcmp (__graphics_toolkit__, "gnuplot") |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
353 && ! arg_st.ghostscript.epscrop) |
11027
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
354 arg_st.ghostscript.pageoffset = paperposition(1:2) - 50; |
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
355 else |
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
356 arg_st.ghostscript.pageoffset = paperposition(1:2); |
a2bdd9180a3c
__print_parse_opts__.m: Properly crop eps image and fix tests.
Ben Abbott <bpabbott@mac.com>
parents:
11022
diff
changeset
|
357 endif |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
358 else |
14206
df695e37d404
Make sure "print '-SX,Y' ..." doesn't round down a pixel. Bug # 35307.
Ben Abbott <bpabbott@mac.com>
parents:
14138
diff
changeset
|
359 ## Convert canvas size to points from pixels. |
df695e37d404
Make sure "print '-SX,Y' ..." doesn't round down a pixel. Bug # 35307.
Ben Abbott <bpabbott@mac.com>
parents:
14138
diff
changeset
|
360 if (! isempty (arg_st.fontsize)) |
df695e37d404
Make sure "print '-SX,Y' ..." doesn't round down a pixel. Bug # 35307.
Ben Abbott <bpabbott@mac.com>
parents:
14138
diff
changeset
|
361 ## Work around the eps bbox having whole numbers (both gnuplot & gl2ps). |
df695e37d404
Make sure "print '-SX,Y' ..." doesn't round down a pixel. Bug # 35307.
Ben Abbott <bpabbott@mac.com>
parents:
14138
diff
changeset
|
362 arg_st.scalefontsize = arg_st.ghostscript.resolution / 72; |
df695e37d404
Make sure "print '-SX,Y' ..." doesn't round down a pixel. Bug # 35307.
Ben Abbott <bpabbott@mac.com>
parents:
14138
diff
changeset
|
363 endif |
df695e37d404
Make sure "print '-SX,Y' ..." doesn't round down a pixel. Bug # 35307.
Ben Abbott <bpabbott@mac.com>
parents:
14138
diff
changeset
|
364 arg_st.ghostscript.resolution = 72; |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
365 arg_st.ghostscript.papersize = arg_st.canvas_size; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
366 arg_st.ghostscript.epscrop = true; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
367 arg_st.ghostscript.pageoffset = [0, 0]; |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
368 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
369 |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
370 if (arg_st.formatted_for_printing) |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
371 arg_st.ghostscript.resolution = []; |
11009 | 372 else |
373 arg_st.ghostscript.papersize = ""; | |
374 arg_st.ghostscript.pageoffset = [0, 0]; | |
375 endif | |
376 | |
377 if (warn_on_missing_binary) | |
378 if (isempty (arg_st.ghostscript.binary)) | |
12460
952e52dda82e
Improve warnings when shell utilties needed for printing are missing.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
379 warning ("print:missing_gs", "print.m: Ghostscript binary is not available.\nOnly eps output is available."); |
952e52dda82e
Improve warnings when shell utilties needed for printing are missing.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
380 else |
952e52dda82e
Improve warnings when shell utilties needed for printing are missing.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
381 if (isempty (arg_st.epstool_binary)) |
952e52dda82e
Improve warnings when shell utilties needed for printing are missing.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
382 warning ("print:missing_epstool", "print.m: epstool binary is not available.\nSome output formats are not available."); |
952e52dda82e
Improve warnings when shell utilties needed for printing are missing.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
383 endif |
952e52dda82e
Improve warnings when shell utilties needed for printing are missing.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
384 if (isempty (arg_st.fig2dev_binary)) |
952e52dda82e
Improve warnings when shell utilties needed for printing are missing.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
385 warning ("print:missing_fig2dev", "print.m: fig2dev binary is not available.\nSome output formats are not available."); |
952e52dda82e
Improve warnings when shell utilties needed for printing are missing.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
386 endif |
952e52dda82e
Improve warnings when shell utilties needed for printing are missing.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
387 if (isempty (arg_st.pstoedit_binary)) |
952e52dda82e
Improve warnings when shell utilties needed for printing are missing.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
388 warning ("print:missing_pstoedit", "print.m: pstoedit binary is not available.\nSome output formats are not available."); |
952e52dda82e
Improve warnings when shell utilties needed for printing are missing.
Ben Abbott <bpabbott@mac.com>
parents:
11589
diff
changeset
|
389 endif |
11009 | 390 endif |
391 warn_on_missing_binary = false; | |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
392 endif |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
393 |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
394 endfunction |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
395 |
12793
6f91ca83d2be
codesprint : Make many plot helper functions private.
Rik <octave@nomad.inbox5.com>
parents:
12460
diff
changeset
|
396 ## Test blocks are not allowed (and not needed) for private functions |
6f91ca83d2be
codesprint : Make many plot helper functions private.
Rik <octave@nomad.inbox5.com>
parents:
12460
diff
changeset
|
397 #%!test |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
398 %! opts = __print_parse_opts__ (); |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
399 %! assert (opts.devopt, "pswrite"); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
400 %! assert (opts.use_color, 1); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
401 %! assert (opts.send_to_printer, true); |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
402 %! assert (opts.canvas_size, [576, 432]); |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14206
diff
changeset
|
403 %! assert (opts.ghostscript.device, "pswrite"); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
404 |
12793
6f91ca83d2be
codesprint : Make many plot helper functions private.
Rik <octave@nomad.inbox5.com>
parents:
12460
diff
changeset
|
405 #%!test |
10861 | 406 %! opts = __print_parse_opts__ ("test.pdf", "-S640,480"); |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
407 %! assert (opts.canvas_size, [307.2, 230.4], 0.1); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
408 |
12793
6f91ca83d2be
codesprint : Make many plot helper functions private.
Rik <octave@nomad.inbox5.com>
parents:
12460
diff
changeset
|
409 #%!test |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
410 %! opts = __print_parse_opts__ ("-dpsc", "-append", "-loose"); |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
411 %! assert (opts.devopt, "pswrite"); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
412 %! assert (opts.send_to_printer, true); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
413 %! assert (opts.use_color, 1); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
414 %! assert (opts.append_to_file, false); |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14206
diff
changeset
|
415 %! assert (opts.ghostscript.device, "pswrite"); |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
416 %! assert (opts.ghostscript.epscrop, false); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
417 |
12793
6f91ca83d2be
codesprint : Make many plot helper functions private.
Rik <octave@nomad.inbox5.com>
parents:
12460
diff
changeset
|
418 #%!test |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
419 %! opts = __print_parse_opts__ ("-deps", "-tight"); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
420 %! assert (opts.tight_flag, true); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
421 %! assert (opts.send_to_printer, true); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
422 %! assert (opts.use_color, -1); |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14206
diff
changeset
|
423 %! assert (opts.ghostscript.device, ""); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
424 |
12793
6f91ca83d2be
codesprint : Make many plot helper functions private.
Rik <octave@nomad.inbox5.com>
parents:
12460
diff
changeset
|
425 #%!test |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
426 %! opts = __print_parse_opts__ ("-djpg", "foobar", "-mono", "-loose"); |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14206
diff
changeset
|
427 %! assert (opts.devopt, "jpeg"); |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14206
diff
changeset
|
428 %! assert (opts.name, "foobar.jpg"); |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14206
diff
changeset
|
429 %! assert (opts.ghostscript.device, "jpeg"); |
11031
d81b6144c4ba
__print_parse_opts__.m: Fix test.
Ben Abbott <bpabbott@mac.com>
parents:
11027
diff
changeset
|
430 %! assert (opts.ghostscript.epscrop, true); |
11009 | 431 %! assert (opts.ghostscript.papersize, ""); |
432 %! assert (opts.ghostscript.pageoffset, [0, 0]); | |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
433 %! assert (opts.send_to_printer, false); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
434 %! assert (opts.printer, ""); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
435 %! assert (opts.use_color, -1); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
436 |
12793
6f91ca83d2be
codesprint : Make many plot helper functions private.
Rik <octave@nomad.inbox5.com>
parents:
12460
diff
changeset
|
437 #%!test |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
438 %! opts = __print_parse_opts__ ("-ddeskjet", "foobar", "-mono", "-Pmyprinter"); |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14206
diff
changeset
|
439 %! assert (opts.ghostscript.output, "foobar.deskjet"); |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14206
diff
changeset
|
440 %! assert (opts.ghostscript.device, "deskjet"); |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14206
diff
changeset
|
441 %! assert (opts.devopt, "deskjet"); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
442 %! assert (opts.send_to_printer, true); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
443 %! assert (opts.printer, "-Pmyprinter"); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
444 %! assert (opts.use_color, -1); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
445 |
12793
6f91ca83d2be
codesprint : Make many plot helper functions private.
Rik <octave@nomad.inbox5.com>
parents:
12460
diff
changeset
|
446 #%!test |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
447 %! opts = __print_parse_opts__ ("-f5", "-dljet3"); |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14206
diff
changeset
|
448 %! assert (opts.ghostscript.device, "ljet3"); |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14206
diff
changeset
|
449 %! assert (strfind (opts.ghostscript.output, ".ljet3")); |
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14206
diff
changeset
|
450 %! assert (opts.devopt, "ljet3"); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
451 %! assert (opts.send_to_printer, true); |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14206
diff
changeset
|
452 %! assert (opts.figure, 5); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
453 |
10889
1d7a7fb5074b
__print_parse_opts__.m: Double quote paths with spaces.
Ben Abbott <bpabbott@mac.com>
parents:
10876
diff
changeset
|
454 function cmd = __quote_path__ (cmd) |
14403
61cc4c715962
Replace file-separater "/" with "\" for MinGW MSYS shell.
Ben Abbott <bpabbott@mac.com>
parents:
14366
diff
changeset
|
455 if (! isempty (cmd)) |
61cc4c715962
Replace file-separater "/" with "\" for MinGW MSYS shell.
Ben Abbott <bpabbott@mac.com>
parents:
14366
diff
changeset
|
456 is_quoted = all (cmd([1, end]) == "'"); |
61cc4c715962
Replace file-separater "/" with "\" for MinGW MSYS shell.
Ben Abbott <bpabbott@mac.com>
parents:
14366
diff
changeset
|
457 if (! is_quoted) |
61cc4c715962
Replace file-separater "/" with "\" for MinGW MSYS shell.
Ben Abbott <bpabbott@mac.com>
parents:
14366
diff
changeset
|
458 dos_shell = ! isunix () && ispc (); |
61cc4c715962
Replace file-separater "/" with "\" for MinGW MSYS shell.
Ben Abbott <bpabbott@mac.com>
parents:
14366
diff
changeset
|
459 if (dos_shell && any (cmd == "/")) |
61cc4c715962
Replace file-separater "/" with "\" for MinGW MSYS shell.
Ben Abbott <bpabbott@mac.com>
parents:
14366
diff
changeset
|
460 cmd = strrep (cmd, "/", "\\"); |
61cc4c715962
Replace file-separater "/" with "\" for MinGW MSYS shell.
Ben Abbott <bpabbott@mac.com>
parents:
14366
diff
changeset
|
461 endif |
61cc4c715962
Replace file-separater "/" with "\" for MinGW MSYS shell.
Ben Abbott <bpabbott@mac.com>
parents:
14366
diff
changeset
|
462 if (any (cmd == " ")) |
14439
b06010f12183
__print_parse_opts__.m: Use single quotes to simplify code.
Rik <octave@nomad.inbox5.com>
parents:
14403
diff
changeset
|
463 cmd = strcat ('"', strrep (cmd, '"', '""') ,'"'); |
14403
61cc4c715962
Replace file-separater "/" with "\" for MinGW MSYS shell.
Ben Abbott <bpabbott@mac.com>
parents:
14366
diff
changeset
|
464 endif |
61cc4c715962
Replace file-separater "/" with "\" for MinGW MSYS shell.
Ben Abbott <bpabbott@mac.com>
parents:
14366
diff
changeset
|
465 endif |
10889
1d7a7fb5074b
__print_parse_opts__.m: Double quote paths with spaces.
Ben Abbott <bpabbott@mac.com>
parents:
10876
diff
changeset
|
466 endif |
1d7a7fb5074b
__print_parse_opts__.m: Double quote paths with spaces.
Ben Abbott <bpabbott@mac.com>
parents:
10876
diff
changeset
|
467 endfunction |
1d7a7fb5074b
__print_parse_opts__.m: Double quote paths with spaces.
Ben Abbott <bpabbott@mac.com>
parents:
10876
diff
changeset
|
468 |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
469 function gs = __ghostscript_binary__ () |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
470 |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
471 persistent ghostscript_binary = "" |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
472 persistent warn_on_no_ghostscript = true |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
473 persistent warn_on_bad_gsc = true |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
474 |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
475 if (isempty (ghostscript_binary)) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
476 GSC = getenv ("GSC"); |
11300
4ecc7bc5bc83
search PATH from environment for programs, not EXEC_PATH
John W. Eaton <jwe@octave.org>
parents:
11268
diff
changeset
|
477 if (exist (GSC, "file") |
4ecc7bc5bc83
search PATH from environment for programs, not EXEC_PATH
John W. Eaton <jwe@octave.org>
parents:
11268
diff
changeset
|
478 || (! isempty (GSC) && file_in_path (getenv ("PATH"), GSC))) |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
479 gs_binaries = {GSC}; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
480 elseif (! isempty (GSC) && warn_on_bad_gsc) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
481 warning ("print:badgscenv", |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
482 "print.m: GSC environment variable not set properly"); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
483 warn_on_bad_gsc = false; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
484 gs_binaries = {}; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
485 else |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
486 gs_binaries = {}; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
487 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
488 if (isunix ()) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
489 ## Unix - Includes Mac OSX and Cygwin. |
20038
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
490 gs_binaries = [gs_binaries, {"gs", "gs.exe"}]; |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
491 else |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
492 ## pc - Includes Win32 and mingw. |
20038
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
493 gs_binaries = [gs_binaries, ... |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
494 {"gs.exe", "gswin32c.exe", "gswin64c.exe", "mgs.exe"}]; |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
495 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
496 n = 0; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
497 while (n < numel (gs_binaries) && isempty (ghostscript_binary)) |
20441
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20248
diff
changeset
|
498 n += 1; |
11300
4ecc7bc5bc83
search PATH from environment for programs, not EXEC_PATH
John W. Eaton <jwe@octave.org>
parents:
11268
diff
changeset
|
499 ghostscript_binary = file_in_path (getenv ("PATH"), gs_binaries{n}); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
500 endwhile |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
501 if (warn_on_no_ghostscript && isempty (ghostscript_binary)) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
502 warning ("print:noghostscript", |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
503 "print.m: ghostscript not found in PATH"); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
504 warn_on_no_ghostscript = false; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
505 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
506 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
507 |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
508 gs = ghostscript_binary; |
10727
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
509 |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
510 endfunction |
570f30a48732
split printing between backends
Shai Ayal <shaiay@users.sourceforge.net>
parents:
diff
changeset
|
511 |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
512 function bin = __find_binary__ (binary) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
513 |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
514 persistent data = struct () |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
515 |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
516 if (! isfield (data, binary)) |
15466
d174210ce1ec
use ' instead of ` in error messages, warnings and most comments
John W. Eaton <jwe@octave.org>
parents:
14530
diff
changeset
|
517 ## Reinitialize when 'user_binaries' is present. |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
518 data.(binary).bin = ""; |
10862
337db4e1342d
Warn on absence of fig2dev/pstoedit only when needed.
Ben Abbott <bpabbott@mac.com>
parents:
10861
diff
changeset
|
519 data.(binary).warn_on_absence = false; |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
520 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
521 |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
522 if (isempty (data.(binary).bin)) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
523 if (isunix ()) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
524 ## Unix - Includes Mac OSX and Cygwin. |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
525 binaries = strcat (binary, {"", ".exe"}); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
526 else |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
527 ## pc - Includes Win32 and mingw. |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
528 binaries = strcat (binary, {".exe"}); |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
529 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
530 n = 0; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
531 while (n < numel (binaries) && isempty (data.(binary).bin)) |
20441
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20248
diff
changeset
|
532 n += 1; |
11300
4ecc7bc5bc83
search PATH from environment for programs, not EXEC_PATH
John W. Eaton <jwe@octave.org>
parents:
11268
diff
changeset
|
533 data.(binary).bin = file_in_path (getenv ("PATH"), binaries{n}); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
534 endwhile |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
535 if (isempty (data.(binary).bin) && data.(binary).warn_on_absence) |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
536 warning (sprintf ("print:no%s", binary), |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
537 "print.m: '%s' not found in PATH", binary); |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
538 data.(binary).warn_on_absence = false; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
539 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
540 endif |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
541 |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
542 bin = data.(binary).bin; |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
543 |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
544 endfunction |
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
545 |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
546 function [papersize, paperposition] = gs_papersize (hfig, paperorientation) |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
547 persistent papertypes papersizes |
10834
05ba991794d4
Improvements for fltk printing.
Ben Abbott <bpabbott@mac.com>
parents:
10727
diff
changeset
|
548 |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
549 if (isempty (papertypes)) |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
550 papertypes = {"usletter", "uslegal", "a0", "a1", ... |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
551 "a2", "a3", "a4", "a5", ... |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
552 "b0", "b1", "b2", "b3", ... |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
553 "b4", "b5", "arch-a", "arch-b", ... |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
554 "arch-c", "arch-d", "arch-e", "a", ... |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
555 "b", "c", "d", "e", ... |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
556 "tabloid"}; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
557 papersizes = [ 8.5, 11.0; 8.5, 14.0; 33.1, 46.8; 23.4, 33.1; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
558 16.5, 23.4; 11.7, 16.5; 8.3, 11.7; 5.8, 8.3; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
559 39.4, 55.7; 27.8, 39.4; 19.7, 27.8; 13.9, 19.7; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
560 9.8, 13.9; 6.9, 9.8; 9.0, 12.0; 12.0, 18.0; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
561 18.0, 24.0; 24.0, 36.0; 36.0, 48.0; 8.5, 11.0; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
562 11.0, 17.0; 18.0, 24.0; 24.0, 36.0; 36.0, 48.0; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
563 11.0, 17.0] * 72; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
564 endif |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
565 |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
566 papertype = get (hfig, "papertype"); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
567 paperunits = get (hfig, "paperunits"); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
568 paperposition = get (hfig, "paperposition"); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
569 if (strcmp (papertype, "<custom>")) |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
570 papersize = get (hfig, "papersize"); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
571 papersize = convert2points (papersize , paperunits); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
572 else |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
573 papersize = papersizes (strcmp (papertypes, papertype), :); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
574 endif |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
575 |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
576 if (strcmp (paperunits, "normalized")) |
20441
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20248
diff
changeset
|
577 paperposition .*= papersize([1,2,1,2]); |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
578 else |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
579 paperposition = convert2points (paperposition, paperunits); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
580 endif |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
581 |
19047
7bbe3658c5ef
maint: Use "FIXME:" coding convention in m-files.
Rik <rik@octave.org>
parents:
18749
diff
changeset
|
582 ## FIXME: This will be obsoleted by listeners for paper properties. |
7bbe3658c5ef
maint: Use "FIXME:" coding convention in m-files.
Rik <rik@octave.org>
parents:
18749
diff
changeset
|
583 ## Papersize is tall when portrait,and wide when landscape. |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
584 if ((papersize(1) > papersize(2) && strcmpi (paperorientation, "portrait")) |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
585 || (papersize(1) < papersize(2) && strcmpi (paperorientation, "landscape"))) |
14872
c2dbdeaa25df
maint: use rows() and columns() to clarify m-files.
Rik <octave@nomad.inbox5.com>
parents:
14868
diff
changeset
|
586 papersize = papersize([2,1]); |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
587 paperposition = paperposition([2,1,4,3]); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
588 endif |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
589 |
20038
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
590 if (! strcmp (papertype, "<custom>") |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
591 && (strcmp (paperorientation, "portrait"))) |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
592 ## For portrait use the ghostscript name |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
593 papersize = papertype; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
594 papersize(papersize=="-") = ""; |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
595 papersize = strrep (papersize, "us", ""); |
11120
a44f979a35ce
style fixes for some .m files
John W. Eaton <jwe@octave.org>
parents:
11113
diff
changeset
|
596 switch (papersize) |
17174
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
16488
diff
changeset
|
597 case "a" |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
16488
diff
changeset
|
598 papersize = "letter"; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
16488
diff
changeset
|
599 case {"b", "tabloid"} |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
16488
diff
changeset
|
600 papersize = "11x17"; |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
16488
diff
changeset
|
601 case {"c", "d", "e"} |
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
16488
diff
changeset
|
602 papersize = strcat ("arch", papersize); |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
603 endswitch |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
604 if (strncmp (papersize, "arch", 4)) |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
605 papersize(end) = upper (papersize(end)); |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
606 endif |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
607 endif |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
608 |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
609 endfunction |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
610 |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
611 function value = convert2points (value, units) |
17174
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
16488
diff
changeset
|
612 switch (units) |
11120
a44f979a35ce
style fixes for some .m files
John W. Eaton <jwe@octave.org>
parents:
11113
diff
changeset
|
613 case "inches" |
20441
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20248
diff
changeset
|
614 value *= 72; |
11120
a44f979a35ce
style fixes for some .m files
John W. Eaton <jwe@octave.org>
parents:
11113
diff
changeset
|
615 case "centimeters" |
20441
83792dd9bcc1
Use in-place operators in m-files where possible.
Rik <rik@octave.org>
parents:
20248
diff
changeset
|
616 value *= 72 / 2.54; |
11120
a44f979a35ce
style fixes for some .m files
John W. Eaton <jwe@octave.org>
parents:
11113
diff
changeset
|
617 case "normalized" |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
618 error ("print:customnormalized", |
11589
b0084095098e
missing semicolons in script files
John W. Eaton <jwe@octave.org>
parents:
11587
diff
changeset
|
619 "print.m: papersize=='<custom>' and paperunits='normalized' may not be combined"); |
17174
c3c1ebfaa7dc
maint: Use common indentation for switch statement.
Rik <rik@octave.org>
parents:
16488
diff
changeset
|
620 endswitch |
10854
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
621 endfunction |
d5a7db05d591
Add PS and PDF output for the fltk backend.
Ben Abbott <bpabbott@mac.com>
parents:
10834
diff
changeset
|
622 |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
623 function device_list = gs_device_list (); |
19765
f88ee85d4da9
Restore valid uses of pswrite device in cset a402493c0605.
Rik <rik@octave.org>
parents:
19764
diff
changeset
|
624 ## Graphics formats/languages, not printers. |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
625 device_list = {"bmp16"; "bmp16m"; "bmp256"; "bmp32b"; "bmpgray"; ... |
20038
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
626 "epswrite"; "eps2write"; "jpeg"; "jpegcymk"; "jpeggray"; |
9fc020886ae9
maint: Clean up m-files to follow Octave coding conventions.
Rik <rik@octave.org>
parents:
19898
diff
changeset
|
627 "pbm"; "pbmraw"; "pcx16"; "pcx24b"; "pcx256"; "pcx2up"; ... |
11022
a5bee81bb69f
__print_parse_opts__.m: Recongize gs devices {eps/pdf/ps}write.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
628 "pcxcmyk"; "pcxgray"; "pcxmono"; "pdfwrite"; "pgm"; ... |
a5bee81bb69f
__print_parse_opts__.m: Recongize gs devices {eps/pdf/ps}write.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
629 "pgmraw"; "pgnm"; "pgnmraw"; "png16"; "png16m"; ... |
a5bee81bb69f
__print_parse_opts__.m: Recongize gs devices {eps/pdf/ps}write.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
630 "png256"; "png48"; "pngalpha"; "pnggray"; "pngmono"; ... |
19765
f88ee85d4da9
Restore valid uses of pswrite device in cset a402493c0605.
Rik <rik@octave.org>
parents:
19764
diff
changeset
|
631 "pnm"; "pnmraw"; "ppm"; "ppmraw"; "pswrite"; ... |
19764
6a9bde1ba0ea
Stop using deprecated and removed ghostscript device pswrite (bug #41141)
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
632 "ps2write"; "tiff12nc"; "tiff24nc"; "tiff32nc"; ... |
11022
a5bee81bb69f
__print_parse_opts__.m: Recongize gs devices {eps/pdf/ps}write.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
633 "tiffcrle"; "tiffg3"; "tiffg32d"; "tiffg4"; ... |
a5bee81bb69f
__print_parse_opts__.m: Recongize gs devices {eps/pdf/ps}write.
Ben Abbott <bpabbott@mac.com>
parents:
11009
diff
changeset
|
634 "tiffgray"; "tifflzw"; "tiffpack"; "tiffsep"}; |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
635 endfunction |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
636 |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
637 function aliases = gs_aliases (); |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
638 ## Aliases for other devices: "bmp", "png", "tiff", "tiffn", "pdf", |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
639 ## "ps", "ps2", "psc", "psc2" |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
640 ## |
11587
c792872f8942
all script files: untabify and strip trailing whitespace
John W. Eaton <jwe@octave.org>
parents:
11576
diff
changeset
|
641 ## eps, epsc, eps2, epsc2 are not included here because those are |
11576
8ac9687dbe9f
rename backend to graphics_toolkit
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
642 ## are generated by the graphics toolkit. |
19765
f88ee85d4da9
Restore valid uses of pswrite device in cset a402493c0605.
Rik <rik@octave.org>
parents:
19764
diff
changeset
|
643 aliases.bmp = "bmp32b"; |
f88ee85d4da9
Restore valid uses of pswrite device in cset a402493c0605.
Rik <rik@octave.org>
parents:
19764
diff
changeset
|
644 aliases.pdf = "pdfwrite"; |
f88ee85d4da9
Restore valid uses of pswrite device in cset a402493c0605.
Rik <rik@octave.org>
parents:
19764
diff
changeset
|
645 aliases.png = "png16m"; |
f88ee85d4da9
Restore valid uses of pswrite device in cset a402493c0605.
Rik <rik@octave.org>
parents:
19764
diff
changeset
|
646 aliases.ps = "ps2write"; |
f88ee85d4da9
Restore valid uses of pswrite device in cset a402493c0605.
Rik <rik@octave.org>
parents:
19764
diff
changeset
|
647 aliases.ps2 = "ps2write"; |
f88ee85d4da9
Restore valid uses of pswrite device in cset a402493c0605.
Rik <rik@octave.org>
parents:
19764
diff
changeset
|
648 aliases.psc = "ps2write"; |
f88ee85d4da9
Restore valid uses of pswrite device in cset a402493c0605.
Rik <rik@octave.org>
parents:
19764
diff
changeset
|
649 aliases.psc2 = "ps2write"; |
f88ee85d4da9
Restore valid uses of pswrite device in cset a402493c0605.
Rik <rik@octave.org>
parents:
19764
diff
changeset
|
650 aliases.tiff = "tiff24nc"; |
10954
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
651 aliases.tiffn = "tiff24nc"; |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
652 endfunction |
ee9d74048827
Consolidate gs code into print.m.
Ben Abbott <bpabbott@mac.com>
parents:
10918
diff
changeset
|
653 |