annotate lisp/ps-print.el @ 19485:eab8baa19dfa

(ps-zebra-stripes): Renamed from ps-zebra-stripe. (ps-zebra-stripe-height): Renamed from ps-number-of-zebra.
author Richard M. Stallman <rms@gnu.org>
date Sat, 23 Aug 1997 06:51:42 +0000
parents 15ecd855fec8
children 24853e0e38d6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19485
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
1 ;;; ps-print.el --- Print text from the buffer as PostScript
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2
19011
96c53acede23 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17681
diff changeset
3 ;; Copyright (C) 1993, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
5 ;; Author: Jim Thompson (was <thompson@wg2.waii.com>)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
6 ;; Author: Jacques Duthen <duthen@cegelec-red.fr>
19011
96c53acede23 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 17681
diff changeset
7 ;; Maintainer: Vinicius Jose Latorre <vinicius@cpqd.br>
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
8 ;; Keywords: print, PostScript
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
9 ;; Time-stamp: <97/08/09 1:30:17 vinicius>
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
10 ;; Version: 3.05
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
11
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
12 (defconst ps-print-version "3.05"
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
13 "ps-print.el, v 3.05 <97/08/09 vinicius>
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
14
19485
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
15 Vinicius's last change version -- this file may have been edited as part of
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
16 Emacs without changes to the version number. When reporting bugs,
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
17 please also report the version of Emacs, if any, that ps-print was
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
18 distributed with.
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
19
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
20 Please send all bug fixes and enhancements to
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
21 Jacques Duthen <duthen@cegelec-red.fr>.
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
22 ")
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23
10493
ed52763e77d6 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 10492
diff changeset
24 ;; This file is part of GNU Emacs.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26 ;; GNU Emacs is free software; you can redistribute it and/or modify
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27 ;; it under the terms of the GNU General Public License as published by
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;; the Free Software Foundation; either version 2, or (at your option)
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29 ;; any later version.
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 ;; GNU Emacs is distributed in the hope that it will be useful,
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 ;; GNU General Public License for more details.
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
37 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
38 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
39 ;; Boston, MA 02111-1307, USA.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
41 ;;; Commentary:
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
45 ;; About ps-print
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46 ;; --------------
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
47 ;;
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 ;; This package provides printing of Emacs buffers on PostScript
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 ;; printers; the buffer's bold and italic text attributes are
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 ;; preserved in the printer output. Ps-print is intended for use with
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
51 ;; Emacs 19 or Lucid Emacs, together with a fontifying package such as
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
52 ;; font-lock or hilit.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
53 ;;
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
54 ;; ps-print uses the same face attributes defined through font-lock or hilit
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
55 ;; to print a PostScript file, but some faces are better seeing on the screen
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
56 ;; than on paper, specially when you have a black/white PostScript printer.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
57 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
58 ;; ps-print allows a remap of face to another one that it is better to print,
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
59 ;; for example, the face font-lock-comment-face (if you are using font-lock)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
60 ;; could have bold or italic attribute when printing, besides foreground color.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
61 ;; This remap improves printing look (see How Ps-Print Maps Faces).
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
62 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
63 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
64 ;; Using ps-print
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 ;; --------------
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
66 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
67 ;; The Commands
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
68 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
69 ;; Ps-print provides eight commands for generating PostScript images
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
70 ;; of Emacs buffers:
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
71 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
72 ;; ps-print-buffer
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
73 ;; ps-print-buffer-with-faces
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
74 ;; ps-print-region
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
75 ;; ps-print-region-with-faces
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
76 ;; ps-spool-buffer
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
77 ;; ps-spool-buffer-with-faces
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
78 ;; ps-spool-region
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
79 ;; ps-spool-region-with-faces
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
81 ;; These commands all perform essentially the same function: they
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
82 ;; generate PostScript images suitable for printing on a PostScript
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
83 ;; printer or displaying with GhostScript. These commands are
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
84 ;; collectively referred to as "ps-print- commands".
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
85 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
86 ;; The word "print" or "spool" in the command name determines when the
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
87 ;; PostScript image is sent to the printer:
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
88 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
89 ;; print - The PostScript image is immediately sent to the
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
90 ;; printer;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
91 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
92 ;; spool - The PostScript image is saved temporarily in an
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
93 ;; Emacs buffer. Many images may be spooled locally
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
94 ;; before printing them. To send the spooled images
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
95 ;; to the printer, use the command `ps-despool'.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
97 ;; The spooling mechanism was designed for printing lots of small
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
98 ;; files (mail messages or netnews articles) to save paper that would
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
99 ;; otherwise be wasted on banner pages, and to make it easier to find
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
100 ;; your output at the printer (it's easier to pick up one 50-page
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
101 ;; printout than to find 50 single-page printouts).
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
102 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
103 ;; Ps-print has a hook in the `kill-emacs-hooks' so that you won't
14040
187735b53d52 Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 13886
diff changeset
104 ;; accidentally quit from Emacs while you have unprinted PostScript
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
105 ;; waiting in the spool buffer. If you do attempt to exit with
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
106 ;; spooled PostScript, you'll be asked if you want to print it, and if
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
107 ;; you decline, you'll be asked to confirm the exit; this is modeled
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
108 ;; on the confirmation that Emacs uses for modified buffers.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
109 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
110 ;; The word "buffer" or "region" in the command name determines how
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
111 ;; much of the buffer is printed:
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
113 ;; buffer - Print the entire buffer.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
114 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
115 ;; region - Print just the current region.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
116 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
117 ;; The -with-faces suffix on the command name means that the command
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
118 ;; will include font, color, and underline information in the
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
119 ;; PostScript image, so the printed image can look as pretty as the
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
120 ;; buffer. The ps-print- commands without the -with-faces suffix
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
121 ;; don't include font, color, or underline information; images printed
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
122 ;; with these commands aren't as pretty, but are faster to generate.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
123 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
124 ;; Two ps-print- command examples:
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
125 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
126 ;; ps-print-buffer - print the entire buffer,
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
127 ;; without font, color, or
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
128 ;; underline information, and
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
129 ;; send it immediately to the
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
130 ;; printer.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
132 ;; ps-spool-region-with-faces - print just the current region;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
133 ;; include font, color, and
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
134 ;; underline information, and
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
135 ;; spool the image in Emacs to
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
136 ;; send to the printer later.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
137 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
138 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
139 ;; Invoking Ps-Print
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
140 ;; -----------------
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
141 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
142 ;; To print your buffer, type
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
143 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
144 ;; M-x ps-print-buffer
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
145 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
146 ;; or substitute one of the other seven ps-print- commands. The
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
147 ;; command will generate the PostScript image and print or spool it as
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
148 ;; specified. By giving the command a prefix argument
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
150 ;; C-u M-x ps-print-buffer
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
151 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
152 ;; it will save the PostScript image to a file instead of sending it
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
153 ;; to the printer; you will be prompted for the name of the file to
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
154 ;; save the image to. The prefix argument is ignored by the commands
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
155 ;; that spool their images, but you may save the spooled images to a
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
156 ;; file by giving a prefix argument to `ps-despool':
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
157 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
158 ;; C-u M-x ps-despool
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
159 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
160 ;; When invoked this way, `ps-despool' will prompt you for the name of
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
161 ;; the file to save to.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
162 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
163 ;; Any of the `ps-print-' commands can be bound to keys; I recommend
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
164 ;; binding `ps-spool-buffer-with-faces', `ps-spool-region-with-faces',
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
165 ;; and `ps-despool'. Here are the bindings I use on my Sun 4 keyboard:
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
166 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
167 ;; (global-set-key 'f22 'ps-spool-buffer-with-faces) ;f22 is prsc
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 ;; (global-set-key '(shift f22) 'ps-spool-region-with-faces)
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 ;; (global-set-key '(control f22) 'ps-despool)
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
171 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
172 ;; The Printer Interface
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
173 ;; ---------------------
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
174 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
175 ;; The variables `ps-lpr-command' and `ps-lpr-switches' determine what
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
176 ;; command is used to send the PostScript images to the printer, and
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
177 ;; what arguments to give the command. These are analogous to
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
178 ;; `lpr-command' and `lpr-switches'.
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
179 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
180 ;; Make sure that they contain appropriate values for your system;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
181 ;; see the usage notes below and the documentation of these variables.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
182 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
183 ;; NOTE: `ps-lpr-command' and `ps-lpr-switches' take their initial values
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
184 ;; from the variables `lpr-command' and `lpr-switches'. If you have
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
185 ;; `lpr-command' set to invoke a pretty-printer such as `enscript',
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
186 ;; then ps-print won't work properly. `ps-lpr-command' must name
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
187 ;; a program that does not format the files it prints.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
188 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
189 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
190 ;; The Page Layout
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
191 ;; ---------------
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
192 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
193 ;; All dimensions are floats in PostScript points.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
194 ;; 1 inch == 2.54 cm == 72 points
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
195 ;; 1 cm == (/ 1 2.54) inch == (/ 72 2.54) points
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
196 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
197 ;; The variable `ps-paper-type' determines the size of paper ps-print
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
198 ;; formats for; it should contain one of the symbols:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
199 ;; `a4' `a3' `letter' `legal' `letter-small' `tabloid'
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
200 ;; `ledger' `statement' `executive' `a4small' `b4' `b5'
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
201 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
202 ;; The variable `ps-landscape-mode' determines the orientation
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
203 ;; of the printing on the page:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
204 ;; nil means `portrait' mode, non-nil means `landscape' mode.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
205 ;; There is no oblique mode yet, though this is easy to do in ps.
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
206 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
207 ;; In landscape mode, the text is NOT scaled: you may print 70 lines
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
208 ;; in portrait mode and only 50 lignes in landscape mode.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
209 ;; The margins represent margins in the printed paper:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
210 ;; the top margin is the margin between the top of the page
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
211 ;; and the printed header, whatever the orientation is.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
212 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
213 ;; The variable `ps-number-of-columns' determines the number of columns
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
214 ;; both in landscape and portrait mode.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
215 ;; You can use:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
216 ;; - (the standard) one column portrait mode
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
217 ;; - (my favorite) two columns landscape mode (which spares trees)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
218 ;; but also
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
219 ;; - one column landscape mode for files with very long lines.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
220 ;; - multi-column portrait or landscape mode
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
221 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
222 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
223 ;; Horizontal layout
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
224 ;; -----------------
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
225 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
226 ;; The horizontal layout is determined by the variables
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
227 ;; `ps-left-margin' `ps-inter-column' `ps-right-margin'
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
228 ;; as follows:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
229 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
230 ;; ------------------------------------------
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
231 ;; | | | | | | | |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
232 ;; | lm | text | ic | text | ic | text | rm |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
233 ;; | | | | | | | |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
234 ;; ------------------------------------------
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
235 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
236 ;; If `ps-number-of-columns' is 1, `ps-inter-column' is not relevant.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
237 ;; Usually, lm = rm > 0 and ic = lm
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
238 ;; If (ic < 0), the text of adjacent columns can overlap.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
239 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
240 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
241 ;; Vertical layout
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
242 ;; ---------------
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
243 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
244 ;; The vertical layout is determined by the variables
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
245 ;; `ps-bottom-margin' `ps-top-margin' `ps-header-offset'
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
246 ;; as follows:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
247 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
248 ;; |--------| |--------|
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
249 ;; | tm | | tm |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
250 ;; |--------| |--------|
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
251 ;; | header | | |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
252 ;; |--------| | |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
253 ;; | ho | | |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
254 ;; |--------| or | text |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
255 ;; | | | |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
256 ;; | text | | |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
257 ;; | | | |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
258 ;; |--------| |--------|
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
259 ;; | bm | | bm |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
260 ;; |--------| |--------|
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
261 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
262 ;; If `ps-print-header' is nil, `ps-header-offset' is not relevant.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
263 ;; The margins represent margins in the printed paper:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
264 ;; the top margin is the margin between the top of the page
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
265 ;; and the printed header, whatever the orientation is.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
266 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
267 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
268 ;; Headers
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
269 ;; -------
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
270 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
271 ;; Ps-print can print headers at the top of each column; the default
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
272 ;; headers contain the following four items: on the left, the name of
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
273 ;; the buffer and, if the buffer is visiting a file, the file's
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
274 ;; directory; on the right, the page number and date of printing.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
275 ;; The default headers look something like this:
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
276 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
277 ;; ps-print.el 1/21
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
278 ;; /home/jct/emacs-lisp/ps/new 94/12/31
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
279 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
280 ;; When printing on duplex printers, left and right are reversed so
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
281 ;; that the page numbers are toward the outside (cf. `ps-spool-duplex').
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
282 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
283 ;; Headers are configurable:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
284 ;; To turn them off completely, set `ps-print-header' to nil.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
285 ;; To turn off the header's gaudy framing box,
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
286 ;; set `ps-print-header-frame' to nil.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
287 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
288 ;; The font family and size of text in the header are determined
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
289 ;; by the variables `ps-header-font-family', `ps-header-font-size' and
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
290 ;; `ps-header-title-font-size' (see below).
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
291 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
292 ;; The variable `ps-header-line-pad' determines the portion of a header
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
293 ;; title line height to insert between the header frame and the text
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
294 ;; it contains, both in the vertical and horizontal directions:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
295 ;; .5 means half a line.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
296
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
297 ;; Page numbers are printed in `n/m' format, indicating page n of m pages;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
298 ;; to omit the total page count and just print the page number,
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
299 ;; set `ps-show-n-of-n' to nil.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
300 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
301 ;; The amount of information in the header can be changed by changing
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
302 ;; the number of lines. To show less, set `ps-header-lines' to 1, and
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
303 ;; the header will show only the buffer name and page number. To show
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
304 ;; more, set `ps-header-lines' to 3, and the header will show the time of
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
305 ;; printing below the date.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
306 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
307 ;; To change the content of the headers, change the variables
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
308 ;; `ps-left-header' and `ps-right-header'.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
309 ;; These variables are lists, specifying top-to-bottom the text
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
310 ;; to display on the left or right side of the header.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
311 ;; Each element of the list should be a string or a symbol.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
312 ;; Strings are inserted directly into the PostScript arrays,
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
313 ;; and should contain the PostScript string delimiters '(' and ')'.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
314 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
315 ;; Symbols in the header format lists can either represent functions
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
316 ;; or variables. Functions are called, and should return a string to
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
317 ;; show in the header. Variables should contain strings to display in
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
318 ;; the header. In either case, function or variable, the PostScript
14040
187735b53d52 Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 13886
diff changeset
319 ;; string delimiters are added by ps-print, and should not be part of
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
320 ;; the returned value.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
321 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
322 ;; Here's an example: say we want the left header to display the text
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
323 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
324 ;; Moe
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
325 ;; Larry
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
326 ;; Curly
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
327 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
328 ;; where we have a function to return "Moe"
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
329 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
330 ;; (defun moe-func ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
331 ;; "Moe")
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
332 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
333 ;; a variable specifying "Larry"
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
334 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
335 ;; (setq larry-var "Larry")
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
336 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
337 ;; and a literal for "Curly". Here's how `ps-left-header' should be
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
338 ;; set:
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
339 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
340 ;; (setq ps-left-header (list 'moe-func 'larry-var "(Curly)"))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
341 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
342 ;; Note that Curly has the PostScript string delimiters inside his
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
343 ;; quotes -- those aren't misplaced lisp delimiters!
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
344 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
345 ;; Without them, PostScript would attempt to call the undefined
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
346 ;; function Curly, which would result in a PostScript error.
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
347 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
348 ;; Since most printers don't report PostScript errors except by
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
349 ;; aborting the print job, this kind of error can be hard to track down.
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
350 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
351 ;; Consider yourself warned!
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
352 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
353 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
354 ;; Duplex Printers
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
355 ;; ---------------
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
356 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
357 ;; If you have a duplex-capable printer (one that prints both sides of
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
358 ;; the paper), set `ps-spool-duplex' to t.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
359 ;; Ps-print will insert blank pages to make sure each buffer starts
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
360 ;; on the correct side of the paper.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
361 ;; Don't forget to set `ps-lpr-switches' to select duplex printing
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
362 ;; for your printer.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
363 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
364 ;;
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
365 ;; Line Number
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
366 ;; -----------
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
367 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
368 ;; The variable `ps-line-number' determines if lines will be
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
369 ;; numerated (non-nil value) or not (nil value).
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
370 ;; The default is not numerated (nil value).
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
371 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
372 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
373 ;; Zebra Stripes
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
374 ;; -------------
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
375 ;;
19485
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
376 ;; Zebra stripes are a kind of background which you can request
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
377 ;; to appear "underneath" the text. They look like this:
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
378 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
379 ;; XXXXXXXXXXXXXXXXXXXXXXXX
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
380 ;; XXXXXXXXXXXXXXXXXXXXXXXX
19485
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
381 ;; XXXXXXXXXXXXXXXXXXXXXXXX
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
382 ;;
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
383 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
384 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
385 ;; XXXXXXXXXXXXXXXXXXXXXXXX
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
386 ;; XXXXXXXXXXXXXXXXXXXXXXXX
19485
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
387 ;; XXXXXXXXXXXXXXXXXXXXXXXX
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
388 ;;
19485
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
389 ;; The X's here represent a rectangle area filled with a light gray color.
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
390 ;; The height, in lines, of the gray area pis controlled by
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
391 ;; the variable `ps-zebra-stripe-height', which is 3 by default.
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
392 ;; The distance between stripes equals the height of a stripe.
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
393 ;;
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
394 ;; The variable `ps-zebra-stripe' determines if zebra stripe lines will be
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
395 ;; printed (non-nil value) or not (nil value).
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
396 ;; The default is not print zebra stripes (nil value).
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
397 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
398 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
399 ;; Font managing
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
400 ;; -------------
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
401 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
402 ;; Ps-print now knows rather precisely some fonts:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
403 ;; the variable `ps-font-info-database' contains information
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
404 ;; for a list of font families (currently mainly `Courier' `Helvetica'
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
405 ;; `Times' `Palatino' `Helvetica-Narrow' `NewCenturySchlbk').
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
406 ;; Each font family contains the font names for standard, bold, italic
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
407 ;; and bold-italic characters, a reference size (usually 10) and the
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
408 ;; corresponding line height, width of a space and average character width.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
409 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
410 ;; The variable `ps-font-family' determines which font family
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
411 ;; is to be used for ordinary text.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
412 ;; If its value does not correspond to a known font family,
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
413 ;; an error message is printed into the `*Messages*' buffer,
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
414 ;; which lists the currently available font families.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
415 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
416 ;; The variable `ps-font-size' determines the size (in points)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
417 ;; of the font for ordinary text, when generating Postscript.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
418 ;; Its value is a float.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
419 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
420 ;; Similarly, the variable `ps-header-font-family' determines
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
421 ;; which font family is to be used for text in the header.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
422 ;; The variable `ps-header-font-size' determines the font size,
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
423 ;; in points, for text in the header.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
424 ;; The variable `ps-header-title-font-size' determines the font size,
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
425 ;; in points, for the top line of text in the header.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
426 ;;
10738
e7d5b119b583 (ps-print-version): Add caveat about version number.
Richard M. Stallman <rms@gnu.org>
parents: 10683
diff changeset
427 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
428 ;; Adding a new font family
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
429 ;; ------------------------
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
430 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
431 ;; To use a new font family, you MUST first teach ps-print
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
432 ;; this font, i.e., add its information to `ps-font-info-database',
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
433 ;; otherwise ps-print cannot correctly place line and page breaks.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
434 ;;
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
435 ;; For example, assuming `Helvetica' is unknown,
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
436 ;; you first need to do the following ONLY ONCE:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
437 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
438 ;; - create a new buffer
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
439 ;; - generate the PostScript image to a file (C-u M-x ps-print-buffer)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
440 ;; - open this file and find the line:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
441 ;; `% 3 cm 20 cm moveto 10 /Courier ReportFontInfo showpage'
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
442 ;; - delete the leading `%' (which is the Postscript comment character)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
443 ;; - replace in this line `Courier' by the new font (say `Helvetica')
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
444 ;; to get the line:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
445 ;; `3 cm 20 cm moveto 10 /Helvetica ReportFontInfo showpage'
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
446 ;; - send this file to the printer (or to ghostscript).
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
447 ;; You should read the following on the output page:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
448 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
449 ;; For Helvetica 10 point, the line height is 11.56, the space width is 2.78
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
450 ;; and a crude estimate of average character width is 5.09243
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
451 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
452 ;; - Add these values to the `ps-font-info-database':
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
453 ;; (setq ps-font-info-database
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
454 ;; (append
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
455 ;; '((Helvetica ; the family name
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
456 ;; "Helvetica" "Helvetica-Bold" "Helvetica-Oblique" "Helvetica-BoldOblique"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
457 ;; 10.0 11.56 2.78 5.09243))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
458 ;; ps-font-info-database))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
459 ;; - Now you can use this font family with any size:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
460 ;; (setq ps-font-family 'Helvetica)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
461 ;; - if you want to use this family in another emacs session, you must
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
462 ;; put into your `~/.emacs':
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
463 ;; (require 'ps-print)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
464 ;; (setq ps-font-info-database (append ...)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
465 ;; if you don't want to load ps-print, you have to copy the whole value:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
466 ;; (setq ps-font-info-database '(<your stuff> <the standard stuff>))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
467 ;; or, if you can wait until the `ps-print-hook' is implemented, do:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
468 ;; (add-hook 'ps-print-hook '(setq ps-font-info-database (append ...)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
469 ;; This does not work yet, since there is no `ps-print-hook' yet.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
470 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
471 ;; You can create new `mixed' font families like:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
472 ;; (my-mixed-family
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
473 ;; "Courier-Bold" "Helvetica"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
474 ;; "Zapf-Chancery-MediumItalic" "NewCenturySchlbk-BoldItalic"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
475 ;; 10.0 10.55 6.0 6.0)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
476 ;; Now you can use your new font family with any size:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
477 ;; (setq ps-font-family 'my-mixed-family)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
478 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
479 ;; You can get information on all the fonts resident in YOUR printer
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
480 ;; by uncommenting the line:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
481 ;; % 3 cm 20 cm moveto ReportAllFontInfo showpage
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
482 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
483 ;; The postscript file should be sent to YOUR postscript printer.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
484 ;; If you send it to ghostscript or to another postscript printer,
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
485 ;; you may get slightly different results.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
486 ;; Anyway, as ghostscript fonts are autoload, you won't get
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
487 ;; much font info.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
488 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
489 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
490 ;; How Ps-Print Deals With Faces
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
491 ;; -----------------------------
10738
e7d5b119b583 (ps-print-version): Add caveat about version number.
Richard M. Stallman <rms@gnu.org>
parents: 10683
diff changeset
492 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
493 ;; The ps-print-*-with-faces commands attempt to determine which faces
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
494 ;; should be printed in bold or italic, but their guesses aren't
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
495 ;; always right. For example, you might want to map colors into faces
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
496 ;; so that blue faces print in bold, and red faces in italic.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
497 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
498 ;; It is possible to force ps-print to consider specific faces bold or
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
499 ;; italic, no matter what font they are displayed in, by setting the
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
500 ;; variables `ps-bold-faces' and `ps-italic-faces'. These variables
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
501 ;; contain lists of faces that ps-print should consider bold or
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
502 ;; italic; to set them, put code like the following into your .emacs
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
503 ;; file:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
504 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
505 ;; (setq ps-bold-faces '(my-blue-face))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
506 ;; (setq ps-italic-faces '(my-red-face))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
507 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
508 ;; Faces like bold-italic that are both bold and italic should go in
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
509 ;; *both* lists.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
510 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
511 ;; Ps-print keeps internal lists of which fonts are bold and which are
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
512 ;; italic; these lists are built the first time you invoke ps-print.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
513 ;; For the sake of efficiency, the lists are built only once; the same
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
514 ;; lists are referred in later invocations of ps-print.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
515 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
516 ;; Because these lists are built only once, it's possible for them to
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
517 ;; get out of sync, if a face changes, or if new faces are added. To
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
518 ;; get the lists back in sync, you can set the variable
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
519 ;; `ps-build-face-reference' to t, and the lists will be rebuilt the
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
520 ;; next time ps-print is invoked.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
521 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
522 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
523 ;; How Ps-Print Deals With Color
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
524 ;; -----------------------------
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
525 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
526 ;; Ps-print detects faces with foreground and background colors
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
527 ;; defined and embeds color information in the PostScript image.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
528 ;; The default foreground and background colors are defined by the
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
529 ;; variables `ps-default-fg' and `ps-default-bg'.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
530 ;; On black-and-white printers, colors are displayed in grayscale.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
531 ;; To turn off color output, set `ps-print-color-p' to nil.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
532 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
533 ;;
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
534 ;; How Ps-Print Maps Faces
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
535 ;; -----------------------
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
536 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
537 ;; As ps-print uses PostScript to print buffers, it is possible to have
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
538 ;; other attributes associated with faces. So the new attributes used
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
539 ;; by ps-print are:
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
540 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
541 ;; strikeout - like underline, but the line is in middle of text.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
542 ;; overline - like underline, but the line is over the text.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
543 ;; shadow - text will have a shadow.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
544 ;; box - text will be surrounded by a box.
19485
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
545 ;; outline - only the contour of the characters will be printed.
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
546 ;;
19446
15ecd855fec8 (ps-print-face-extension-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 19445
diff changeset
547 ;; See the documentation for `ps-extend-face' and `ps-extend-face-list'.
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
548 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
549 ;; Let's, for example, remap font-lock-keyword-face to another foreground color
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
550 ;; and bold attribute:
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
551 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
552 ;; (ps-extend-face '(font-lock-keyword-face "RoyalBlue" nil bold))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
553 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
554 ;; Note: the only attributes that have effect on screen are: bold, italic and
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
555 ;; underline. All other screen effect is ignored.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
556 ;;
19446
15ecd855fec8 (ps-print-face-extension-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 19445
diff changeset
557 ;; If you want to use a new face, define it first with `defface',
15ecd855fec8 (ps-print-face-extension-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 19445
diff changeset
558 ;; and then call `ps-extend-face' to specify how to print it.
15ecd855fec8 (ps-print-face-extension-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 19445
diff changeset
559 ;;
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
560 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
561 ;; How Ps-Print Has A Text And/Or Image On Background
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
562 ;; --------------------------------------------------
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
563 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
564 ;; Ps-print can print texts and/or EPS PostScript images on background; it is
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
565 ;; possible to define the following text attributes: font name, font size,
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
566 ;; initial position, angle, gray scale and pages to print.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
567 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
568 ;; It has the following EPS PostScript images attributes: file name containing
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
569 ;; the image, initial position, X and Y scales, angle and pages to print.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
570 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
571 ;; See documentation for `ps-print-background-text' and
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
572 ;; `ps-print-background-image'.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
573 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
574 ;; For example, if we wish to print text "preliminary" on all pages and text
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
575 ;; "special" on page 5 and from page 11 to page 17, we could specify:
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
576 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
577 ;; (setq ps-print-background-text
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
578 ;; '(("preliminary")
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
579 ;; ("special"
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
580 ;; "LeftMargin" "BottomMargin PrintHeight add" ; X and Y position
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
581 ;; ; (upper left corner)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
582 ;; nil nil nil
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
583 ;; "PrintHeight neg PrintWidth atan" ; angle
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
584 ;; 5 (11 . 17)) ; page list
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
585 ;; ))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
586 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
587 ;; Similarly, we could print image "~/images/EPS-image1.ps" on all pages and
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
588 ;; image "~/images/EPS-image2.ps" on page 5 and from page 11 to page 17, we
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
589 ;; specify:
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
590 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
591 ;; (setq ps-print-background-image
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
592 ;; '(("~/images/EPS-image1.ps"
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
593 ;; "LeftMargin" "BottomMargin") ; X and Y position (lower left corner)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
594 ;; ("~/images/EPS-image2.ps"
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
595 ;; "LeftMargin" "BottomMargin PrintHeight 2 div add" ; X and Y position
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
596 ;; ; (upper left corner)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
597 ;; nil nil nil
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
598 ;; 5 (11 . 17)) ; page list
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
599 ;; ))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
600 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
601 ;; If it is not possible to read (or does not exist) an image file, that file
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
602 ;; is ignored.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
603 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
604 ;; The printing order is:
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
605 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
606 ;; 1. Print zebra stripes
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
607 ;; 2. Print background texts that it should be on all pages
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
608 ;; 3. Print background images that it should be on all pages
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
609 ;; 4. Print background texts only for current page (if any)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
610 ;; 5. Print background images only for current page (if any)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
611 ;; 6. Print header
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
612 ;; 7. Print buffer text (with faces, if specified) with line number
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
613 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
614 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
615 ;; Utilities
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
616 ;; ---------
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
617 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
618 ;; Some tools are provided to help you customize your font setup.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
619 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
620 ;; `ps-setup' returns (some part of) the current setup.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
621 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
622 ;; To avoid wrapping too many lines, you may want to adjust the
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
623 ;; left and right margins and the font size. On UN*X systems, do:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
624 ;; pr -t file | awk '{printf "%3d %s\n", length($0), $0}' | sort -r | head
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
625 ;; to determine the longest lines of your file.
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
626 ;; Then, the command `ps-line-lengths' will give you the correspondence
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
627 ;; between a line length (number of characters) and the maximum font
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
628 ;; size which doesn't wrap such a line with the current ps-print setup.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
629 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
630 ;; The commands `ps-nb-pages-buffer' and `ps-nb-pages-region' display
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
631 ;; the correspondence between a number of pages and the maximum font
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
632 ;; size which allow the number of lines of the current buffer or of
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
633 ;; its current region to fit in this number of pages.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
634 ;; Note: line folding is not taken into account in this process
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
635 ;; and could change the results.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
636 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
637 ;;
10738
e7d5b119b583 (ps-print-version): Add caveat about version number.
Richard M. Stallman <rms@gnu.org>
parents: 10683
diff changeset
638 ;; New since version 1.5
e7d5b119b583 (ps-print-version): Add caveat about version number.
Richard M. Stallman <rms@gnu.org>
parents: 10683
diff changeset
639 ;; ---------------------
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
640 ;;
10738
e7d5b119b583 (ps-print-version): Add caveat about version number.
Richard M. Stallman <rms@gnu.org>
parents: 10683
diff changeset
641 ;; Color output capability.
e7d5b119b583 (ps-print-version): Add caveat about version number.
Richard M. Stallman <rms@gnu.org>
parents: 10683
diff changeset
642 ;; Automatic detection of font attributes (bold, italic).
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
643 ;; Configurable headers with page numbers.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
644 ;; Slightly faster.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
645 ;; Support for different paper sizes.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
646 ;; Better conformance to PostScript Document Structure Conventions.
10738
e7d5b119b583 (ps-print-version): Add caveat about version number.
Richard M. Stallman <rms@gnu.org>
parents: 10683
diff changeset
647 ;;
e7d5b119b583 (ps-print-version): Add caveat about version number.
Richard M. Stallman <rms@gnu.org>
parents: 10683
diff changeset
648 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
649 ;; New since version 2.8
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
650 ;; ---------------------
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
651 ;;
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
652 ;; [vinicius] 970809 Vinicius Jose Latorre <vinicius@cpqd.br>
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
653 ;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
654 ;; Handle control characters.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
655 ;; Face remapping.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
656 ;; New face attributes.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
657 ;; Line number.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
658 ;; Zebra stripes.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
659 ;; Text and/or image on background.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
660 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
661 ;; [jack] 960517 Jacques Duthen <duthen@cegelec-red.fr>
10738
e7d5b119b583 (ps-print-version): Add caveat about version number.
Richard M. Stallman <rms@gnu.org>
parents: 10683
diff changeset
662 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
663 ;; Font familiy and float size for text and header.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
664 ;; Landscape mode.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
665 ;; Multiple columns.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
666 ;; Tools for page setup.
10738
e7d5b119b583 (ps-print-version): Add caveat about version number.
Richard M. Stallman <rms@gnu.org>
parents: 10683
diff changeset
667 ;;
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
668 ;;
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
669 ;; Known bugs and limitations of ps-print:
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
670 ;; --------------------------------------
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
671 ;;
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
672 ;; Although color printing will work in XEmacs 19.12, it doesn't work
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
673 ;; well; in particular, bold or italic fonts don't print in the right
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
674 ;; background color.
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
675 ;;
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
676 ;; Invisible properties aren't correctly ignored in XEmacs 19.12.
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
677 ;;
10738
e7d5b119b583 (ps-print-version): Add caveat about version number.
Richard M. Stallman <rms@gnu.org>
parents: 10683
diff changeset
678 ;; Automatic font-attribute detection doesn't work well, especially
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
679 ;; with hilit19 and older versions of get-create-face. Users having
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
680 ;; problems with auto-font detection should use the lists
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
681 ;; `ps-italic-faces' and `ps-bold-faces' and/or turn off automatic
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
682 ;; detection by setting `ps-auto-font-detect' to nil.
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
683 ;;
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
684 ;; Automatic font-attribute detection doesn't work with XEmacs 19.12
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
685 ;; in tty mode; use the lists `ps-italic-faces' and `ps-bold-faces'
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
686 ;; instead.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
687 ;;
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
688 ;; Still too slow; could use some hand-optimization.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
689 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
690 ;; Default background color isn't working.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
691 ;;
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
692 ;; Faces are always treated as opaque.
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
693 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
694 ;; Epoch and Emacs 18 not supported. At all.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
695 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
696 ;; Fixed-pitch fonts work better for line folding, but are not required.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
697 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
698 ;; `ps-nb-pages-buffer' and `ps-nb-pages-region' don't take care
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
699 ;; of folding lines.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
700 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
701 ;;
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
702 ;; Things to change:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
703 ;; ----------------
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
704 ;;
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
705 ;; Add `ps-print-hook' (I don't know how to do that (yet!)).
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
706 ;; Add 4-up capability (really needed?).
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
707 ;; Add line numbers (should not be too hard).
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
708 ;; Add `ps-non-bold-faces' and `ps-non-italic-faces' (should be easy).
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
709 ;; Put one header per page over the columns (easy but needed?).
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
710 ;; Improve the memory management for big files (hard?).
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
711 ;; `ps-nb-pages-buffer' and `ps-nb-pages-region' should take care
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
712 ;; of folding lines.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
713 ;;
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
714 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
715 ;; Acknowledgements
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
716 ;; ----------------
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
717 ;; Thanks to Jim Thompson <?@?> for the 2.8 version I started from.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
718 ;; [jack]
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
719 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
720 ;; Thanks to Kevin Rodgers <kevinr@ihs.com> for adding support for
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
721 ;; color and the invisible property.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
722 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
723 ;; Thanks to Avishai Yacobi, avishaiy@mcil.comm.mot.com, for writing
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
724 ;; the initial port to Emacs 19. His code is no longer part of
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
725 ;; ps-print, but his work is still appreciated.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
726 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
727 ;; Thanks to Remi Houdaille and Michel Train, michel@metasoft.fdn.org,
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
728 ;; for adding underline support. Their code also is no longer part of
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
729 ;; ps-print, but their efforts are not forgotten.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
730 ;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
731 ;; Thanks also to all of you who mailed code to add features to
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
732 ;; ps-print; although I didn't use your code, I still appreciate your
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
733 ;; sharing it with me.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
734 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
735 ;; Thanks to all who mailed comments, encouragement, and criticism.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
736 ;; Thanks also to all who responded to my survey; I had too many
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
737 ;; responses to reply to them all, but I greatly appreciate your
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
738 ;; interest.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
739 ;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
740 ;; Jim
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
741 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
742
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
743 ;;; Code:
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
744
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
745 (eval-when-compile
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
746 (require 'cl))
10738
e7d5b119b583 (ps-print-version): Add caveat about version number.
Richard M. Stallman <rms@gnu.org>
parents: 10683
diff changeset
747
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
748 (unless (featurep 'lisp-float-type)
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
749 (error "`ps-print' requires floating point support"))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
750
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
751 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
752 ;; User Variables:
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
753
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
754 ;;; Interface to the command system
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
755
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
756 (defgroup ps-print nil
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
757 "Postscript generator for Emacs 19"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
758 :prefix "ps-"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
759 :group 'wp)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
760
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
761 (defgroup ps-print-horizontal nil
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
762 "Horizontal page layout"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
763 :prefix "ps-"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
764 :tag "Horizontal"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
765 :group 'ps-print)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
766
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
767 (defgroup ps-print-vertical nil
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
768 "Vertical page layout"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
769 :prefix "ps-"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
770 :tag "Vertical"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
771 :group 'ps-print)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
772
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
773 (defgroup ps-print-header nil
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
774 "Headers layout"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
775 :prefix "ps-"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
776 :tag "Header"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
777 :group 'ps-print)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
778
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
779 (defgroup ps-print-font nil
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
780 "Fonts customization"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
781 :prefix "ps-"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
782 :tag "Font"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
783 :group 'ps-print)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
784
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
785 (defgroup ps-print-color nil
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
786 "Color customization"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
787 :prefix "ps-"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
788 :tag "Color"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
789 :group 'ps-print)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
790
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
791 (defgroup ps-print-face nil
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
792 "Faces customization"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
793 :prefix "ps-"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
794 :tag "PS Faces"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
795 :group 'ps-print
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
796 :group 'faces)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
797
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
798
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
799 (defcustom ps-lpr-command lpr-command
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
800 "*The shell command for printing a PostScript file."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
801 :type 'string
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
802 :group 'ps-print)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
803
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
804 (defcustom ps-lpr-switches lpr-switches
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
805 "*A list of extra switches to pass to `ps-lpr-command'."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
806 :type '(repeat string)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
807 :group 'ps-print)
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
808
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
809 ;;; Page layout
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
810
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
811 ;; All page dimensions are in PostScript points.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
812 ;; 1 inch == 2.54 cm == 72 points
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
813 ;; 1 cm == (/ 1 2.54) inch == (/ 72 2.54) points
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
814
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
815 ;; Letter 8.5 inch x 11.0 inch
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
816 ;; Legal 8.5 inch x 14.0 inch
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
817 ;; A4 8.26 inch x 11.69 inch = 21.0 cm x 29.7 cm
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
818
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
819 ;; LetterSmall 7.68 inch x 10.16 inch
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
820 ;; Tabloid 11.0 inch x 17.0 inch
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
821 ;; Ledger 17.0 inch x 11.0 inch
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
822 ;; Statement 5.5 inch x 8.5 inch
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
823 ;; Executive 7.5 inch x 10.0 inch
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
824 ;; A3 11.69 inch x 16.5 inch = 29.7 cm x 42.0 cm
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
825 ;; A4Small 7.47 inch x 10.85 inch
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
826 ;; B4 10.125 inch x 14.33 inch
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
827 ;; B5 7.16 inch x 10.125 inch
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
828
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
829 (defcustom ps-page-dimensions-database
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
830 (list (list 'a4 (/ (* 72 21.0) 2.54) (/ (* 72 29.7) 2.54))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
831 (list 'a3 (/ (* 72 29.7) 2.54) (/ (* 72 42.0) 2.54))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
832 (list 'letter (* 72 8.5) (* 72 11.0))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
833 (list 'legal (* 72 8.5) (* 72 14.0))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
834 (list 'letter-small (* 72 7.68) (* 72 10.16))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
835 (list 'tabloid (* 72 11.0) (* 72 17.0))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
836 (list 'ledger (* 72 17.0) (* 72 11.0))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
837 (list 'statement (* 72 5.5) (* 72 8.5))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
838 (list 'executive (* 72 7.5) (* 72 10.0))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
839 (list 'a4small (* 72 7.47) (* 72 10.85))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
840 (list 'b4 (* 72 10.125) (* 72 14.33))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
841 (list 'b5 (* 72 7.16) (* 72 10.125)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
842 "*List associating a symbolic paper type to its width and height.
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
843 see `ps-paper-type'."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
844 :type '(repeat (list :tag "Paper Type"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
845 (symbol :tag "Name")
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
846 (number :tag "Width")
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
847 (number :tag "Height")))
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
848 :group 'ps-print)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
849
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
850 (defcustom ps-paper-type 'letter
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
851 "*Specifies the size of paper to format for.
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
852 Should be one of the paper types defined in `ps-page-dimensions-database', for
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
853 example `letter', `legal' or `a4'."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
854 :type '(symbol :validate (lambda (wid)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
855 (if (assq (widget-value wid)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
856 ps-page-dimensions-database)
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
857 nil
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
858 (widget-put wid :error "Unknown paper size")
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
859 wid)))
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
860 :group 'ps-print)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
861
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
862 (defcustom ps-landscape-mode nil
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
863 "*Non-nil means print in landscape mode."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
864 :type 'boolean
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
865 :group 'ps-print)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
866
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
867 (defcustom ps-number-of-columns (if ps-landscape-mode 2 1)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
868 "*Specifies the number of columns"
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
869 :type 'number
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
870 :group 'ps-print)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
871
19485
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
872 (defcustom ps-zebra-stripes nil
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
873 "*Non-nil means print zebra stripes.
19485
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
874 See also documentation for `ps-print-n-zebra'."
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
875 :type 'boolean
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
876 :group 'ps-print)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
877
19485
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
878 (defcustom ps-zebra-stripe-height 3
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
879 "*Number of zebra stripe lines.
19485
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
880 See also documentation for `ps-print-zebra'."
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
881 :type 'number
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
882 :group 'ps-print)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
883
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
884 (defcustom ps-line-number nil
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
885 "*Non-nil means print line number."
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
886 :type 'boolean
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
887 :group 'ps-print)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
888
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
889 (defcustom ps-print-background-image nil
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
890 "*EPS image list to be printed on background.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
891
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
892 The elements are:
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
893
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
894 (FILENAME X Y XSCALE YSCALE ROTATION PAGES...)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
895
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
896 FILENAME is a file name which contains an EPS image or some PostScript
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
897 programming like EPS.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
898 FILENAME is ignored, if it doesn't exist or is read protected.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
899
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
900 X and Y are relative positions on paper to put the image.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
901 If X and Y are nil, the image is centralized on paper.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
902
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
903 XSCALE and YSCALE are scale factor to be applied to image before printing.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
904 If XSCALE and YSCALE are nil, the original size is used.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
905
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
906 ROTATION is the image rotation angle; if nil, the default is 0.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
907
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
908 PAGES designates the page to print background image.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
909 PAGES may be a number or a cons cell (FROM . TO) designating FROM page
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
910 to TO page.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
911 If PAGES is nil, print background image on all pages.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
912
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
913 X, Y, XSCALE, YSCALE and ROTATION may be a floating point number,
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
914 an integer number or a string. If it is a string, the string should contain
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
915 PostScript programming that returns a float or integer value.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
916
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
917 For example, if you wish to print an EPS image on all pages do:
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
918
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
919 '((\"~/images/EPS-image.ps\"))"
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
920 :type 'list
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
921 :group 'ps-print)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
922
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
923 (defcustom ps-print-background-text nil
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
924 "*Text list to be printed on background.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
925
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
926 The elements are:
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
927
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
928 (STRING X Y FONT FONTSIZE GRAY ROTATION PAGES...)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
929
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
930 STRING is the text to be printed on background.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
931
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
932 X and Y are positions on paper to put the text.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
933 If X and Y are nil, the text is positioned at lower left corner.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
934
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
935 FONT is a font name to be used on printing the text.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
936 If nil, \"Times-Roman\" is used.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
937
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
938 FONTSIZE is font size to be used, if nil, 200 is used.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
939
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
940 GRAY is the text gray factor (should be very light like 0.8).
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
941 If nil, the default is 0.85.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
942
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
943 ROTATION is the text rotation angle; if nil, the angle is given by
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
944 the diagonal from lower left corner to upper right corner.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
945
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
946 PAGES designates the page to print background text.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
947 PAGES may be a number or a cons cell (FROM . TO) designating FROM page
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
948 to TO page.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
949 If PAGES is nil, print background text on all pages.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
950
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
951 X, Y, FONTSIZE, GRAY and ROTATION may be a floating point number,
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
952 an integer number or a string. If it is a string, the string should contain
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
953 PostScript programming that returns a float or integer value.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
954
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
955 For example, if you wish to print text \"Preliminary\" on all pages do:
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
956
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
957 '((\"Preliminary\"))"
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
958 :type 'list
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
959 :group 'ps-print)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
960
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
961 ;;; Horizontal layout
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
962
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
963 ;; ------------------------------------------
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
964 ;; | | | | | | | |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
965 ;; | lm | text | ic | text | ic | text | rm |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
966 ;; | | | | | | | |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
967 ;; ------------------------------------------
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
968
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
969 (defcustom ps-left-margin (/ (* 72 2.0) 2.54) ; 2 cm
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
970 "*Left margin in points (1/72 inch)."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
971 :type 'number
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
972 :group 'ps-print-horizontal)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
973
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
974 (defcustom ps-right-margin (/ (* 72 2.0) 2.54) ; 2 cm
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
975 "*Right margin in points (1/72 inch)."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
976 :type 'number
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
977 :group 'ps-print-horizontal)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
978
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
979 (defcustom ps-inter-column (/ (* 72 2.0) 2.54) ; 2 cm
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
980 "*Horizontal space between columns in points (1/72 inch)."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
981 :type 'number
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
982 :group 'ps-print-horizontal)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
983
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
984 ;;; Vertical layout
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
985
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
986 ;; |--------|
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
987 ;; | tm |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
988 ;; |--------|
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
989 ;; | header |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
990 ;; |--------|
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
991 ;; | ho |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
992 ;; |--------|
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
993 ;; | text |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
994 ;; |--------|
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
995 ;; | bm |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
996 ;; |--------|
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
997
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
998 (defcustom ps-bottom-margin (/ (* 72 1.5) 2.54) ; 1.5 cm
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
999 "*Bottom margin in points (1/72 inch)."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1000 :type 'number
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1001 :group 'ps-print-vertical)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1002
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1003 (defcustom ps-top-margin (/ (* 72 1.5) 2.54) ; 1.5 cm
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1004 "*Top margin in points (1/72 inch)."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1005 :type 'number
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1006 :group 'ps-print-vertical)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1007
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1008 (defcustom ps-header-offset (/ (* 72 1.0) 2.54) ; 1.0 cm
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1009 "*Vertical space in points (1/72 inch) between the main text and the header."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1010 :type 'number
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1011 :group 'ps-print-vertical)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1012
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1013 (defcustom ps-header-line-pad 0.15
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1014 "*Portion of a header title line height to insert between the header frame
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1015 and the text it contains, both in the vertical and horizontal directions."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1016 :type 'number
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1017 :group 'ps-print-vertical)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1018
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1019 ;;; Header setup
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1020
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1021 (defcustom ps-print-header t
10493
ed52763e77d6 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 10492
diff changeset
1022 "*Non-nil means print a header at the top of each page.
ed52763e77d6 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 10492
diff changeset
1023 By default, the header displays the buffer name, page number, and, if
ed52763e77d6 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 10492
diff changeset
1024 the buffer is visiting a file, the file's directory. Headers are
16949
18731f7e2c73 (ps-print-header): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 16870
diff changeset
1025 customizable by changing variables `ps-left-header' and
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1026 `ps-right-header'."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1027 :type 'boolean
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1028 :group 'ps-print-header)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1029
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1030 (defcustom ps-print-header-frame t
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1031 "*Non-nil means draw a gaudy frame around the header."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1032 :type 'boolean
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1033 :group 'ps-print-header)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1034
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1035 (defcustom ps-header-lines 2
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1036 "*Number of lines to display in page header, when generating Postscript."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1037 :type 'integer
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1038 :group 'ps-print-header)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1039 (make-variable-buffer-local 'ps-header-lines)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1040
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1041 (defcustom ps-show-n-of-n t
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1042 "*Non-nil means show page numbers as N/M, meaning page N of M.
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1043 Note: page numbers are displayed as part of headers, see variable
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1044 `ps-print-headers'."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1045 :type 'boolean
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1046 :group 'ps-print-header)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1047
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1048 (defcustom ps-spool-duplex nil ; Not many people have duplex
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1049 ; printers, so default to nil.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1050 "*Non-nil indicates spooling is for a two-sided printer.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1051 For a duplex printer, the `ps-spool-*' commands will insert blank pages
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1052 as needed between print jobs so that the next buffer printed will
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1053 start on the right page. Also, if headers are turned on, the headers
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1054 will be reversed on duplex printers so that the page numbers fall to
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1055 the left on even-numbered pages."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1056 :type 'boolean
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1057 :group 'ps-print-header)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1058
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1059 ;;; Fonts
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1060
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1061 (defcustom ps-font-info-database
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1062 '((Courier ; the family key
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1063 "Courier" "Courier-Bold" "Courier-Oblique" "Courier-BoldOblique"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1064 10.0 10.55 6.0 6.0)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1065 (Helvetica ; the family key
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1066 "Helvetica" "Helvetica-Bold" "Helvetica-Oblique" "Helvetica-BoldOblique"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1067 10.0 11.56 2.78 5.09243)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1068 (Times
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1069 "Times-Roman" "Times-Bold" "Times-Italic" "Times-BoldItalic"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1070 10.0 11.0 2.5 4.71432)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1071 (Palatino
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1072 "Palatino-Roman" "Palatino-Bold" "Palatino-Italic" "Palatino-BoldItalic"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1073 10.0 12.1 2.5 5.08676)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1074 (Helvetica-Narrow
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1075 "Helvetica-Narrow" "Helvetica-Narrow-Bold"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1076 "Helvetica-Narrow-Oblique" "Helvetica-Narrow-BoldOblique"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1077 10.0 11.56 2.2796 4.17579)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1078 (NewCenturySchlbk
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1079 "NewCenturySchlbk-Roman" "NewCenturySchlbk-Bold"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1080 "NewCenturySchlbk-Italic" "NewCenturySchlbk-BoldItalic"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1081 10.0 12.15 2.78 5.31162)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1082 ;; got no bold for the next ones
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1083 (AvantGarde-Book
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1084 "AvantGarde-Book" "AvantGarde-Book"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1085 "AvantGarde-BookOblique" "AvantGarde-BookOblique"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1086 10.0 11.77 2.77 5.45189)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1087 (AvantGarde-Demi
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1088 "AvantGarde-Demi" "AvantGarde-Demi"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1089 "AvantGarde-DemiOblique" "AvantGarde-DemiOblique"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1090 10.0 12.72 2.8 5.51351)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1091 (Bookman-Demi
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1092 "Bookman-Demi" "Bookman-Demi"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1093 "Bookman-DemiItalic" "Bookman-DemiItalic"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1094 10.0 11.77 3.4 6.05946)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1095 (Bookman-Light
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1096 "Bookman-Light" "Bookman-Light"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1097 "Bookman-LightItalic" "Bookman-LightItalic"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1098 10.0 11.79 3.2 5.67027)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1099 ;; got no bold and no italic for the next ones
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1100 (Symbol
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1101 "Symbol" "Symbol" "Symbol" "Symbol"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1102 10.0 13.03 2.5 3.24324)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1103 (Zapf-Dingbats
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1104 "Zapf-Dingbats" "Zapf-Dingbats" "Zapf-Dingbats" "Zapf-Dingbats"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1105 10.0 9.63 2.78 2.78)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1106 (Zapf-Chancery-MediumItalic
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1107 "Zapf-Chancery-MediumItalic" "Zapf-Chancery-MediumItalic"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1108 "Zapf-Chancery-MediumItalic" "Zapf-Chancery-MediumItalic"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1109 10.0 11.45 2.2 4.10811)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1110 )
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1111 "*Font info database: font family (the key), name, bold, italic, bold-italic,
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1112 reference size, line height, space width, average character width.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1113 To get the info for another specific font (say Helvetica), do the following:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1114 - create a new buffer
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1115 - generate the PostScript image to a file (C-u M-x ps-print-buffer)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1116 - open this file and delete the leading `%' (which is the Postscript
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1117 comment character) from the line
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1118 `% 3 cm 20 cm moveto 10 /Courier ReportFontInfo showpage'
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1119 to get the line
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1120 `3 cm 20 cm moveto 10 /Helvetica ReportFontInfo showpage'
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1121 - add the values to `ps-font-info-database'.
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1122 You can get all the fonts of YOUR printer using `ReportAllFontInfo'."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1123 :type '(repeat (list :tag "Font Definition"
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1124 (symbol :tag "Font")
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1125 (string :tag "Name")
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1126 (string :tag "Bold")
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1127 (string :tag "Italic")
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1128 (string :tag "Bold-Italic")
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1129 (number :tag "Reference Size")
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1130 (number :tag "Line Height")
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1131 (number :tag "Space Width")
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1132 (number :tag "Average Character Width")))
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1133 :group 'ps-print-font)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1134
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1135 (defcustom ps-font-family 'Courier
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1136 "Font family name for ordinary text, when generating Postscript."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1137 :type 'symbol
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1138 :group 'ps-print-font)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1139
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1140 (defcustom ps-font-size (if ps-landscape-mode 7 8.5)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1141 "Font size, in points, for ordinary text, when generating Postscript."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1142 :type 'number
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1143 :group 'ps-print-font)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1144
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1145 (defcustom ps-header-font-family 'Helvetica
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1146 "Font family name for text in the header, when generating Postscript."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1147 :type 'symbol
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1148 :group 'ps-print-font)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1149
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1150 (defcustom ps-header-font-size (if ps-landscape-mode 10 12)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1151 "Font size, in points, for text in the header, when generating Postscript."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1152 :type 'number
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1153 :group 'ps-print-font)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1154
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1155 (defcustom ps-header-title-font-size (if ps-landscape-mode 12 14)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1156 "Font size, in points, for the top line of text in the header,
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1157 when generating Postscript."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1158 :type 'number
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1159 :group 'ps-print-font)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1160
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1161 ;;; Colors
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1162
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1163 ;; Printing color requires x-color-values.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1164 (defcustom ps-print-color-p (or (fboundp 'x-color-values) ; Emacs
17440
03d612dba255 (ps-print-color-p): Fix minor error.
Richard M. Stallman <rms@gnu.org>
parents: 17406
diff changeset
1165 (fboundp 'pixel-components)) ; XEmacs
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1166 "*If non-nil, print the buffer's text in color."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1167 :type 'boolean
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1168 :group 'ps-print-color)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1169
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1170 (defcustom ps-default-fg '(0.0 0.0 0.0)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1171 "*RGB values of the default foreground color. Defaults to black."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1172 :type '(list (number :tag "Red") (number :tag "Green") (number :tag "Blue"))
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1173 :group 'ps-print-color)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1174
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1175 (defcustom ps-default-bg '(1.0 1.0 1.0)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1176 "*RGB values of the default background color. Defaults to white."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1177 :type '(list (number :tag "Red") (number :tag "Green") (number :tag "Blue"))
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1178 :group 'ps-print-color)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1179
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1180 (defcustom ps-auto-font-detect t
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1181 "*Non-nil means automatically detect bold/italic face attributes.
10493
ed52763e77d6 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 10492
diff changeset
1182 nil means rely solely on the lists `ps-bold-faces', `ps-italic-faces',
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1183 and `ps-underlined-faces'."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1184 :type 'boolean
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1185 :group 'ps-print-font)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1186
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1187 (defcustom ps-bold-faces
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1188 (unless ps-print-color-p
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1189 '(font-lock-function-name-face
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1190 font-lock-builtin-face
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1191 font-lock-variable-name-face
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1192 font-lock-keyword-face
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1193 font-lock-warning-face))
10493
ed52763e77d6 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 10492
diff changeset
1194 "*A list of the \(non-bold\) faces that should be printed in bold font.
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1195 This applies to generating Postscript."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1196 :type '(repeat face)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1197 :group 'ps-print-face)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1198
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1199 (defcustom ps-italic-faces
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1200 (unless ps-print-color-p
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1201 '(font-lock-variable-name-face
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1202 font-lock-string-face
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1203 font-lock-comment-face
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1204 font-lock-warning-face))
10493
ed52763e77d6 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 10492
diff changeset
1205 "*A list of the \(non-italic\) faces that should be printed in italic font.
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1206 This applies to generating Postscript."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1207 :type '(repeat face)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1208 :group 'ps-print-face)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1209
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1210 (defcustom ps-underlined-faces
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1211 (unless ps-print-color-p
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1212 '(font-lock-function-name-face
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1213 font-lock-type-face
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1214 font-lock-reference-face
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1215 font-lock-warning-face))
10493
ed52763e77d6 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 10492
diff changeset
1216 "*A list of the \(non-underlined\) faces that should be printed underlined.
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1217 This applies to generating Postscript."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1218 :type '(repeat face)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1219 :group 'ps-print-face)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1220
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1221 (defcustom ps-left-header
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1222 (list 'ps-get-buffer-name 'ps-header-dirpart)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1223 "*The items to display (each on a line) on the left part of the page header.
10493
ed52763e77d6 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 10492
diff changeset
1224 This applies to generating Postscript.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1225
10493
ed52763e77d6 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 10492
diff changeset
1226 The value should be a list of strings and symbols, each representing an
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1227 entry in the PostScript array HeaderLinesLeft.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1228
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1229 Strings are inserted unchanged into the array; those representing
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1230 PostScript string literals should be delimited with PostScript string
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1231 delimiters '(' and ')'.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1232
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1233 For symbols with bound functions, the function is called and should
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1234 return a string to be inserted into the array. For symbols with bound
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1235 values, the value should be a string to be inserted into the array.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1236 In either case, function or variable, the string value has PostScript
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1237 string delimiters added to it."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1238 :type '(repeat (choice string symbol))
17681
59c4c8125906 Quote :group names.
Simon Marshall <simon@gnu.org>
parents: 17588
diff changeset
1239 :group 'ps-print-header)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1240 (make-variable-buffer-local 'ps-left-header)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1241
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1242 (defcustom ps-right-header
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
1243 (list "/pagenumberstring load" 'time-stamp-mon-dd-yyyy 'time-stamp-hh:mm:ss)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1244 "*The items to display (each on a line) on the right part of the page header.
10493
ed52763e77d6 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 10492
diff changeset
1245 This applies to generating Postscript.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1246
10493
ed52763e77d6 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 10492
diff changeset
1247 See the variable `ps-left-header' for a description of the format of
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1248 this variable."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1249 :type '(repeat (choice string symbol))
17681
59c4c8125906 Quote :group names.
Simon Marshall <simon@gnu.org>
parents: 17588
diff changeset
1250 :group 'ps-print-header)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1251 (make-variable-buffer-local 'ps-right-header)
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1252
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1253 (defcustom ps-razzle-dazzle t
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1254 "*Non-nil means report progress while formatting buffer."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1255 :type 'boolean
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1256 :group 'ps-print)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1257
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1258 (defvar ps-adobe-tag "%!PS-Adobe-3.0\n"
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1259 "*Contains the header line identifying the output as PostScript.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1260 By default, `ps-adobe-tag' contains the standard identifier. Some
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1261 printers require slightly different versions of this line.")
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1262
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1263 (defcustom ps-build-face-reference t
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1264 "*Non-nil means build the reference face lists.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1265
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1266 Ps-print sets this value to nil after it builds its internal reference
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1267 lists of bold and italic faces. By settings its value back to t, you
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1268 can force ps-print to rebuild the lists the next time you invoke one
10493
ed52763e77d6 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 10492
diff changeset
1269 of the ...-with-faces commands.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1270
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1271 You should set this value back to t after you change the attributes of
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1272 any face, or create new faces. Most users shouldn't have to worry
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1273 about its setting, though."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1274 :type 'boolean
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1275 :group 'ps-print-face)
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1276
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1277 (defcustom ps-always-build-face-reference nil
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1278 "*Non-nil means always rebuild the reference face lists.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1279
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1280 If this variable is non-nil, ps-print will rebuild its internal
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1281 reference lists of bold and italic faces *every* time one of the
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1282 -with-faces commands is called. Most users shouldn't need to set this
17405
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1283 variable."
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1284 :type 'boolean
1c2363f760ef Add defgroup's; change use defcustom for user vars.
Richard M. Stallman <rms@gnu.org>
parents: 17377
diff changeset
1285 :group 'ps-print-face)
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1286
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1287 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1288 ;; User commands
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1289
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1290 ;;;###autoload
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1291 (defun ps-print-buffer (&optional filename)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1292 "Generate and print a PostScript image of the buffer.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1293
10493
ed52763e77d6 entered into RCS
Richard M. Stallman <rms@gnu.org>
parents: 10492
diff changeset
1294 When called with a numeric prefix argument (C-u), prompts the user for
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1295 the name of a file to save the PostScript image in, instead of sending
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1296 it to the printer.
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1297
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1298 More specifically, the FILENAME argument is treated as follows: if it
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1299 is nil, send the image to the printer. If FILENAME is a string, save
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1300 the PostScript image in a file with that name. If FILENAME is a
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1301 number, prompt the user for the name of the file to save in."
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1302 (interactive (list (ps-print-preprint current-prefix-arg)))
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1303 (ps-print-without-faces (point-min) (point-max) filename))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1304
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1305
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1306 ;;;###autoload
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1307 (defun ps-print-buffer-with-faces (&optional filename)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1308 "Generate and print a PostScript image of the buffer.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1309 Like `ps-print-buffer', but includes font, color, and underline
13807
2042acfaf58b Doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 12769
diff changeset
1310 information in the generated image. This command works only if you
2042acfaf58b Doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 12769
diff changeset
1311 are using a window system, so it has a way to determine color values."
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1312 (interactive (list (ps-print-preprint current-prefix-arg)))
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1313 (ps-print-with-faces (point-min) (point-max) filename))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1314
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1315
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1316 ;;;###autoload
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1317 (defun ps-print-region (from to &optional filename)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1318 "Generate and print a PostScript image of the region.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1319 Like `ps-print-buffer', but prints just the current region."
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1320 (interactive (list (point) (mark) (ps-print-preprint current-prefix-arg)))
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1321 (ps-print-without-faces from to filename))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1322
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1323
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1324 ;;;###autoload
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1325 (defun ps-print-region-with-faces (from to &optional filename)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1326 "Generate and print a PostScript image of the region.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1327 Like `ps-print-region', but includes font, color, and underline
13807
2042acfaf58b Doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 12769
diff changeset
1328 information in the generated image. This command works only if you
2042acfaf58b Doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 12769
diff changeset
1329 are using a window system, so it has a way to determine color values."
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1330 (interactive (list (point) (mark) (ps-print-preprint current-prefix-arg)))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1331 (ps-generate (current-buffer) from to
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1332 'ps-generate-postscript-with-faces)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1333 (ps-print-with-faces from to filename))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1334
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1335
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1336 ;;;###autoload
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1337 (defun ps-spool-buffer ()
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1338 "Generate and spool a PostScript image of the buffer.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1339 Like `ps-print-buffer' except that the PostScript image is saved in a
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1340 local buffer to be sent to the printer later.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1341
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1342 Use the command `ps-despool' to send the spooled images to the printer."
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1343 (interactive)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1344 (ps-spool-without-faces (point-min) (point-max)))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1345
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1346
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1347 ;;;###autoload
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1348 (defun ps-spool-buffer-with-faces ()
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1349 "Generate and spool a PostScript image of the buffer.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1350 Like `ps-spool-buffer', but includes font, color, and underline
13807
2042acfaf58b Doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 12769
diff changeset
1351 information in the generated image. This command works only if you
13828
612d7bd4b5d1 (ps-spool-buffer-with-faces): Fix typo in previous chg.
Richard M. Stallman <rms@gnu.org>
parents: 13807
diff changeset
1352 are using a window system, so it has a way to determine color values.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1353
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1354 Use the command `ps-despool' to send the spooled images to the printer."
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1355 (interactive)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1356 (ps-spool-with-faces (point-min) (point-max)))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1357
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1358
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1359 ;;;###autoload
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1360 (defun ps-spool-region (from to)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1361 "Generate a PostScript image of the region and spool locally.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1362 Like `ps-spool-buffer', but spools just the current region.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1363
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1364 Use the command `ps-despool' to send the spooled images to the printer."
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1365 (interactive "r")
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1366 (ps-spool-without-faces from to))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1367
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1368
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1369 ;;;###autoload
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1370 (defun ps-spool-region-with-faces (from to)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1371 "Generate a PostScript image of the region and spool locally.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1372 Like `ps-spool-region', but includes font, color, and underline
13807
2042acfaf58b Doc fixes.
Karl Heuer <kwzh@gnu.org>
parents: 12769
diff changeset
1373 information in the generated image. This command works only if you
13828
612d7bd4b5d1 (ps-spool-buffer-with-faces): Fix typo in previous chg.
Richard M. Stallman <rms@gnu.org>
parents: 13807
diff changeset
1374 are using a window system, so it has a way to determine color values.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1375
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1376 Use the command `ps-despool' to send the spooled images to the printer."
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1377 (interactive "r")
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1378 (ps-spool-with-faces from to))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1379
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1380 ;;;###autoload
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1381 (defun ps-despool (&optional filename)
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1382 "Send the spooled PostScript to the printer.
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1383
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1384 When called with a numeric prefix argument (C-u), prompt the user for
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1385 the name of a file to save the spooled PostScript in, instead of sending
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1386 it to the printer.
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1387
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1388 More specifically, the FILENAME argument is treated as follows: if it
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1389 is nil, send the image to the printer. If FILENAME is a string, save
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1390 the PostScript image in a file with that name. If FILENAME is a
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1391 number, prompt the user for the name of the file to save in."
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1392 (interactive (list (ps-print-preprint current-prefix-arg)))
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
1393 (ps-do-despool filename))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1394
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1395 ;;;###autoload
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1396 (defun ps-line-lengths ()
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1397 "*Display the correspondence between a line length and a font size,
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1398 using the current ps-print setup.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1399 Try: pr -t file | awk '{printf \"%3d %s\n\", length($0), $0}' | sort -r | head"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1400 (interactive)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1401 (ps-line-lengths-internal))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1402
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1403 ;;;###autoload
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1404 (defun ps-nb-pages-buffer (nb-lines)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1405 "*Display an approximate correspondence between a font size and the number
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1406 of pages the current buffer would require to print
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1407 using the current ps-print setup."
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1408 (interactive (list (count-lines (point-min) (point-max))))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1409 (ps-nb-pages nb-lines))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1410
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1411 ;;;###autoload
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1412 (defun ps-nb-pages-region (nb-lines)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1413 "*Display an approximate correspondence between a font size and the number
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1414 of pages the current region would require to print
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1415 using the current ps-print setup."
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1416 (interactive (list (count-lines (mark) (point))))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1417 (ps-nb-pages nb-lines))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1418
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1419 ;;;###autoload
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1420 (defun ps-setup ()
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1421 "*Return the current setup"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1422 (format "
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1423 (setq ps-print-color-p %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1424 ps-lpr-command \"%s\"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1425 ps-lpr-switches %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1426
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1427 ps-paper-type '%s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1428 ps-landscape-mode %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1429 ps-number-of-columns %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1430
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1431 ps-left-margin %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1432 ps-right-margin %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1433 ps-inter-column %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1434 ps-bottom-margin %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1435 ps-top-margin %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1436 ps-header-offset %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1437 ps-header-line-pad %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1438 ps-print-header %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1439 ps-print-header-frame %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1440 ps-header-lines %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1441 ps-show-n-of-n %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1442 ps-spool-duplex %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1443
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1444 ps-font-family '%s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1445 ps-font-size %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1446 ps-header-font-family '%s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1447 ps-header-font-size %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1448 ps-header-title-font-size %s)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1449 "
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1450 ps-print-color-p
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1451 ps-lpr-command
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1452 ps-lpr-switches
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1453 ps-paper-type
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1454 ps-landscape-mode
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1455 ps-number-of-columns
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1456 ps-left-margin
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1457 ps-right-margin
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1458 ps-inter-column
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1459 ps-bottom-margin
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1460 ps-top-margin
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1461 ps-header-offset
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1462 ps-header-line-pad
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1463 ps-print-header
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1464 ps-print-header-frame
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1465 ps-header-lines
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1466 ps-show-n-of-n
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1467 ps-spool-duplex
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1468 ps-font-family
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1469 ps-font-size
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1470 ps-header-font-family
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1471 ps-header-font-size
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1472 ps-header-title-font-size))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1473
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1474 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1475 ;; Utility functions and variables:
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1476
12769
4a905565cfa6 (ps-print-emacs-type): Renamed from emacs-type.
Richard M. Stallman <rms@gnu.org>
parents: 12768
diff changeset
1477 (defvar ps-print-emacs-type
4a905565cfa6 (ps-print-emacs-type): Renamed from emacs-type.
Richard M. Stallman <rms@gnu.org>
parents: 12768
diff changeset
1478 (cond ((string-match "XEmacs" emacs-version) 'xemacs)
4a905565cfa6 (ps-print-emacs-type): Renamed from emacs-type.
Richard M. Stallman <rms@gnu.org>
parents: 12768
diff changeset
1479 ((string-match "Lucid" emacs-version) 'lucid)
4a905565cfa6 (ps-print-emacs-type): Renamed from emacs-type.
Richard M. Stallman <rms@gnu.org>
parents: 12768
diff changeset
1480 ((string-match "Epoch" emacs-version) 'epoch)
4a905565cfa6 (ps-print-emacs-type): Renamed from emacs-type.
Richard M. Stallman <rms@gnu.org>
parents: 12768
diff changeset
1481 (t 'emacs)))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1482
12769
4a905565cfa6 (ps-print-emacs-type): Renamed from emacs-type.
Richard M. Stallman <rms@gnu.org>
parents: 12768
diff changeset
1483 (if (or (eq ps-print-emacs-type 'lucid)
4a905565cfa6 (ps-print-emacs-type): Renamed from emacs-type.
Richard M. Stallman <rms@gnu.org>
parents: 12768
diff changeset
1484 (eq ps-print-emacs-type 'xemacs))
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
1485 (if (< emacs-minor-version 12)
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
1486 (setq ps-print-color-p nil))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1487 (require 'faces)) ; face-font, face-underline-p,
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1488 ; x-font-regexp
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1489
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1490 (require 'time-stamp)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1491
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1492 (defvar ps-font nil
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1493 "Font family name for ordinary text, when generating Postscript.")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1494
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1495 (defvar ps-font-bold nil
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1496 "Font family name for bold text, when generating Postscript.")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1497
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1498 (defvar ps-font-italic nil
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1499 "Font family name for italic text, when generating Postscript.")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1500
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1501 (defvar ps-font-bold-italic nil
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1502 "Font family name for bold italic text, when generating Postscript.")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1503
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1504 (defvar ps-avg-char-width nil
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1505 "The average width, in points, of a character, for generating Postscript.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1506 This is the value that ps-print uses to determine the length,
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1507 x-dimension, of the text it has printed, and thus affects the point at
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1508 which long lines wrap around.")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1509
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1510 (defvar ps-space-width nil
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1511 "The width of a space character, for generating Postscript.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1512 This value is used in expanding tab characters.")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1513
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1514 (defvar ps-line-height nil
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1515 "The height of a line, for generating Postscript.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1516 This is the value that ps-print uses to determine the height,
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1517 y-dimension, of the lines of text it has printed, and thus affects the
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1518 point at which page-breaks are placed.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1519 The line-height is *not* the same as the point size of the font.")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1520
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1521 (defvar ps-print-prologue-1
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1522 "% ISOLatin1Encoding stolen from ps_init.ps in GhostScript 2.6.1.4:
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1523 /ISOLatin1Encoding where { pop } {
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1524 % -- The ISO Latin-1 encoding vector isn't known, so define it.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1525 % -- The first half is the same as the standard encoding,
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1526 % -- except for minus instead of hyphen at code 055.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1527 /ISOLatin1Encoding
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1528 StandardEncoding 0 45 getinterval aload pop
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1529 /minus
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1530 StandardEncoding 46 82 getinterval aload pop
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1531 %*** NOTE: the following are missing in the Adobe documentation,
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1532 %*** but appear in the displayed table:
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1533 %*** macron at 0225, dieresis at 0230, cedilla at 0233, space at 0240.
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1534 % 0200 (128)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1535 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1536 /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1537 /dotlessi /grave /acute /circumflex /tilde /macron /breve /dotaccent
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1538 /dieresis /.notdef /ring /cedilla /.notdef /hungarumlaut /ogonek /caron
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1539 % 0240 (160)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1540 /space /exclamdown /cent /sterling
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1541 /currency /yen /brokenbar /section
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1542 /dieresis /copyright /ordfeminine /guillemotleft
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1543 /logicalnot /hyphen /registered /macron
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1544 /degree /plusminus /twosuperior /threesuperior
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1545 /acute /mu /paragraph /periodcentered
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1546 /cedilla /onesuperior /ordmasculine /guillemotright
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1547 /onequarter /onehalf /threequarters /questiondown
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1548 % 0300 (192)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1549 /Agrave /Aacute /Acircumflex /Atilde
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1550 /Adieresis /Aring /AE /Ccedilla
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1551 /Egrave /Eacute /Ecircumflex /Edieresis
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1552 /Igrave /Iacute /Icircumflex /Idieresis
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1553 /Eth /Ntilde /Ograve /Oacute
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1554 /Ocircumflex /Otilde /Odieresis /multiply
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1555 /Oslash /Ugrave /Uacute /Ucircumflex
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1556 /Udieresis /Yacute /Thorn /germandbls
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1557 % 0340 (224)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1558 /agrave /aacute /acircumflex /atilde
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1559 /adieresis /aring /ae /ccedilla
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1560 /egrave /eacute /ecircumflex /edieresis
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1561 /igrave /iacute /icircumflex /idieresis
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1562 /eth /ntilde /ograve /oacute
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1563 /ocircumflex /otilde /odieresis /divide
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1564 /oslash /ugrave /uacute /ucircumflex
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1565 /udieresis /yacute /thorn /ydieresis
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1566 256 packedarray def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1567 } ifelse
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1568
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1569 /reencodeFontISO { %def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1570 dup
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1571 length 12 add dict % Make a new font (a new dict the same size
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1572 % as the old one) with room for our new symbols.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1573
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1574 begin % Make the new font the current dictionary.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1575
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1576
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1577 { 1 index /FID ne
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1578 { def } { pop pop } ifelse
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1579 } forall % Copy each of the symbols from the old dictionary
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1580 % to the new one except for the font ID.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1581
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1582 /Encoding ISOLatin1Encoding def % Override the encoding with
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1583 % the ISOLatin1 encoding.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1584
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1585 % Use the font's bounding box to determine the ascent, descent,
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1586 % and overall height; don't forget that these values have to be
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1587 % transformed using the font's matrix.
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1588
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1589 % ^ (x2 y2)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1590 % | |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1591 % | v
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1592 % | +----+ - -
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1593 % | | | ^
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1594 % | | | | Ascent (usually > 0)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1595 % | | | |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1596 % (0 0) -> +--+----+-------->
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1597 % | | |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1598 % | | v Descent (usually < 0)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1599 % (x1 y1) --> +----+ - -
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1600
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1601 FontBBox % -- x1 y1 x2 y2
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1602 FontMatrix transform /Ascent exch def pop
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1603 FontMatrix transform /Descent exch def pop
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1604 /FontHeight Ascent Descent sub def % use `sub' because descent < 0
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1605
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1606 % Define these in case they're not in the FontInfo
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1607 % (also, here they're easier to get to).
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1608 /UnderlinePosition Descent 0.70 mul def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1609 /OverlinePosition Descent UnderlinePosition sub Ascent add def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1610 /StrikeoutPosition Ascent 0.30 mul def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1611 /LineThickness 0 50 FontMatrix transform exch pop def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1612 /Xshadow 0 80 FontMatrix transform exch pop def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1613 /Yshadow 0 -90 FontMatrix transform exch pop def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1614 /SpaceBackground Descent neg UnderlinePosition add def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1615 /XBox Descent neg def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1616 /YBox LineThickness 0.7 mul def
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1617
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1618 currentdict % Leave the new font on the stack
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1619 end % Stop using the font as the current dictionary.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1620 definefont % Put the font into the font dictionary
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1621 pop % Discard the returned font.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1622 } bind def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1623
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1624 /DefFont { % Font definition
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1625 findfont exch scalefont reencodeFontISO
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1626 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1627
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1628 /F { % Font selection
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1629 findfont
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1630 dup /Ascent get /Ascent exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1631 dup /Descent get /Descent exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1632 dup /FontHeight get /FontHeight exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1633 dup /UnderlinePosition get /UnderlinePosition exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1634 dup /OverlinePosition get /OverlinePosition exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1635 dup /StrikeoutPosition get /StrikeoutPosition exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1636 dup /LineThickness get /LineThickness exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1637 dup /Xshadow get /Xshadow exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1638 dup /Yshadow get /Yshadow exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1639 dup /SpaceBackground get /SpaceBackground exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1640 dup /XBox get /XBox exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1641 dup /YBox get /YBox exch def
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1642 setfont
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1643 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1644
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1645 /FG /setrgbcolor load def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1646
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1647 /bg false def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1648 /BG {
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1649 dup /bg exch def
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1650 {mark 4 1 roll ]}
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1651 {[ 1.0 1.0 1.0 ]}
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1652 ifelse
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1653 /bgcolor exch def
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1654 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1655
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1656 % B width C
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1657 % +-----------+
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1658 % | Ascent (usually > 0)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1659 % A + +
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1660 % | Descent (usually < 0)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1661 % +-----------+
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1662 % E width D
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1663
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1664 /dobackground { % width --
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1665 currentpoint % -- width x y
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1666 gsave
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1667 newpath
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1668 moveto % A (x y)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1669 0 Ascent rmoveto % B
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1670 dup 0 rlineto % C
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1671 0 Descent Ascent sub rlineto % D
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1672 neg 0 rlineto % E
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1673 closepath
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1674 bgcolor aload pop setrgbcolor
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1675 fill
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1676 grestore
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1677 } def
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1678
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1679 /eolbg { % dobackground until right margin
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1680 PrintWidth % -- x-eol
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1681 currentpoint pop % -- cur-x
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1682 sub % -- width until eol
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1683 dobackground
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1684 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1685
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1686 /PLN {PrintLineNumber {doLineNumber}if} def
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1687
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1688 /SL { % Soft Linefeed
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1689 bg { eolbg } if
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1690 0 currentpoint exch pop LineHeight sub moveto
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1691 } def
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1692
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1693 /HL {SL PLN} def % Hard Linefeed
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1694
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1695 % Some debug
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1696 /dcp { currentpoint exch 40 string cvs print (, ) print = } def
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1697 /dp { print 2 copy exch 40 string cvs print (, ) print = } def
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1698
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1699 /W {
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1700 ( ) stringwidth % Get the width of a space in the current font.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1701 pop % Discard the Y component.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1702 mul % Multiply the width of a space
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1703 % by the number of spaces to plot
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1704 bg { dup dobackground } if
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1705 0 rmoveto
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1706 } def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1707
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1708 /Effect 0 def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1709 /EF {/Effect exch def} def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1710
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1711 % stack: string |- --
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1712 % effect: 1 - underline 2 - strikeout 4 - overline
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1713 % 8 - shadow 16 - box 32 - outline
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1714 /S {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1715 /xx currentpoint dup Descent add /yy exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1716 Ascent add /YY exch def def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1717 dup stringwidth pop xx add /XX exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1718 Effect 8 and 0 ne {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1719 /yy yy Yshadow add def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1720 /XX XX Xshadow add def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1721 } if
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1722 bg {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1723 true
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1724 Effect 16 and 0 ne
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1725 {SpaceBackground doBox}
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1726 {xx yy XX YY doRect}
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1727 ifelse
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1728 } if % background
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1729 Effect 16 and 0 ne {false 0 doBox}if % box
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1730 Effect 8 and 0 ne {dup doShadow}if % shadow
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1731 Effect 32 and 0 ne
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1732 {true doOutline} % outline
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1733 {show} % normal text
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1734 ifelse
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1735 Effect 1 and 0 ne {UnderlinePosition Hline}if % underline
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1736 Effect 2 and 0 ne {StrikeoutPosition Hline}if % strikeout
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1737 Effect 4 and 0 ne {OverlinePosition Hline}if % overline
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1738 } bind def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1739
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1740 % stack: position |- --
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1741 /Hline {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1742 currentpoint exch pop add dup
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1743 gsave
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1744 newpath
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1745 xx exch moveto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1746 XX exch lineto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1747 closepath
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1748 LineThickness setlinewidth stroke
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1749 grestore
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1750 } bind def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1751
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1752 % stack: fill-or-not delta |- --
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1753 /doBox {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1754 /dd exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1755 xx XBox sub dd sub yy YBox sub dd sub
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1756 XX XBox add dd add YY YBox add dd add
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1757 doRect
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1758 } bind def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1759
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1760 % stack: fill-or-not lower-x lower-y upper-x upper-y |- --
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1761 /doRect {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1762 /rYY exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1763 /rXX exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1764 /ryy exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1765 /rxx exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1766 gsave
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1767 newpath
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1768 rXX rYY moveto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1769 rxx rYY lineto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1770 rxx ryy lineto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1771 rXX ryy lineto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1772 closepath
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1773 % top of stack: fill-or-not
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1774 {FillBgColor}
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1775 {LineThickness setlinewidth stroke}
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1776 ifelse
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1777 grestore
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1778 } bind def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1779
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1780 % stack: string |- --
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1781 /doShadow {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1782 gsave
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1783 Xshadow Yshadow rmoveto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1784 false doOutline
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1785 grestore
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1786 } bind def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1787
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1788 /st 1 string def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1789
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1790 % stack: string fill-or-not |- --
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1791 /doOutline {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1792 /-fillp- exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1793 /-ox- currentpoint /-oy- exch def def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1794 gsave
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1795 LineThickness setlinewidth
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1796 {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1797 st 0 3 -1 roll put
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1798 st dup true charpath
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1799 -fillp- {gsave FillBgColor grestore}if
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1800 stroke stringwidth
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1801 -oy- add /-oy- exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1802 -ox- add /-ox- exch def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1803 -ox- -oy- moveto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1804 } forall
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1805 grestore
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1806 -ox- -oy- moveto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1807 } bind def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1808
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1809 % stack: --
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1810 /FillBgColor {bgcolor aload pop setrgbcolor fill} bind def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1811
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1812 /L0 6 /Times-Italic DefFont
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1813
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1814 % stack: --
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1815 /doLineNumber {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1816 currentfont
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1817 gsave
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1818 0.0 0.0 0.0 setrgbcolor
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1819 /L0 findfont setfont
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1820 LineNumber Lines ge
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1821 {(end )}
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1822 {LineNumber 6 string cvs ( ) strcat}
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1823 ifelse
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1824 dup stringwidth pop neg 0 rmoveto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1825 show
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1826 grestore
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1827 setfont
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1828 /LineNumber LineNumber 1 add def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1829 } def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1830
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1831 % stack: --
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1832 /printZebra {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1833 gsave
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1834 0.985 setgray
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1835 /double-zebra NumberOfZebra NumberOfZebra add def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1836 /yiter double-zebra LineHeight mul neg def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1837 /xiter PrintWidth InterColumn add def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1838 NumberOfColumns {LinesPerColumn doColumnZebra xiter 0 rmoveto}repeat
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1839 grestore
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1840 } def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1841
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1842 % stack: lines-per-column |- --
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1843 /doColumnZebra {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1844 gsave
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1845 dup double-zebra idiv {NumberOfZebra doZebra 0 yiter rmoveto}repeat
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1846 double-zebra mod
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1847 dup 0 le {pop}{dup NumberOfZebra gt {pop NumberOfZebra}if doZebra}ifelse
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1848 grestore
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1849 } def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1850
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1851 % stack: zebra-height (in lines) |- --
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1852 /doZebra {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1853 /zh exch 0.05 sub LineHeight mul def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1854 gsave
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1855 0 LineHeight 0.65 mul rmoveto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1856 PrintWidth 0 rlineto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1857 0 zh neg rlineto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1858 PrintWidth neg 0 rlineto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1859 0 zh rlineto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1860 fill
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1861 grestore
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1862 } def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1863
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1864 % tx ty rotation xscale yscale xpos ypos BeginBackImage
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1865 /BeginBackImage {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1866 /-save-image- save def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1867 /showpage {}def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1868 translate
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1869 scale
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1870 rotate
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1871 translate
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1872 } def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1873
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1874 /EndBackImage {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1875 -save-image- restore
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1876 } def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1877
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1878 % string fontsize fontname rotation gray xpos ypos ShowBackText
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1879 /ShowBackText {
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1880 gsave
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1881 translate
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1882 setgray
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1883 rotate
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1884 findfont exch dup /-offset- exch -0.25 mul def scalefont setfont
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1885 0 -offset- moveto
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1886 /-saveLineThickness- LineThickness def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1887 /LineThickness 1 def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1888 false doOutline
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1889 /LineThickness -saveLineThickness- def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1890 grestore
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1891 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1892
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1893 /BeginDoc {
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1894 % ---- save the state of the document (useful for ghostscript!)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1895 /docState save def
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1896 % ---- [jack] Kludge: my ghostscript window is 21x27.7 instead of 21x29.7
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1897 /JackGhostscript where {
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1898 pop 1 27.7 29.7 div scale
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1899 } if
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1900 LandscapeMode {
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1901 % ---- translate to bottom-right corner of Portrait page
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1902 LandscapePageHeight 0 translate
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1903 90 rotate
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1904 } if
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1905 /ColumnWidth PrintWidth InterColumn add def
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1906 % ---- translate to lower left corner of TEXT
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1907 LeftMargin BottomMargin translate
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1908 % ---- define where printing will start
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1909 /f0 F % this installs Ascent
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1910 /PrintStartY PrintHeight Ascent sub def
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1911 /ColumnIndex 1 def
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1912 } def
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1913
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1914 /EndDoc {
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1915 % ---- on last page but not last column, spit out the page
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1916 ColumnIndex 1 eq not { showpage } if
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1917 % ---- restore the state of the document (useful for ghostscript!)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1918 docState restore
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1919 } def
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1920
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1921 /BeginDSCPage {
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1922 % ---- when 1st column, save the state of the page
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1923 ColumnIndex 1 eq { /pageState save def
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1924 0 PrintStartY moveto % move to where printing will start
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1925 Zebra {printZebra}if
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1926 printGlobalBackground
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1927 printLocalBackground
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1928 } if
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1929 % ---- save the state of the column
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1930 /columnState save def
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1931 } def
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1932
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1933 /BeginPage {
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1934 PrintHeader {
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1935 PrintHeaderFrame { HeaderFrame } if
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1936 HeaderText
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1937 } if
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1938 0 PrintStartY moveto % move to where printing will start
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
1939 PLN
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1940 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1941
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1942 /EndPage {
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1943 bg { eolbg } if
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1944 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1945
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1946 /EndDSCPage {
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1947 ColumnIndex NumberOfColumns eq {
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1948 % ---- on last column, spit out the page
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1949 showpage
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1950 % ---- restore the state of the page
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1951 pageState restore
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1952 /ColumnIndex 1 def
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1953 } { % else
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1954 % ---- restore the state of the current column
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1955 columnState restore
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1956 % ---- and translate to the next column
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1957 ColumnWidth 0 translate
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1958 /ColumnIndex ColumnIndex 1 add def
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1959 } ifelse
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1960 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1961
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1962 /SetHeaderLines { % nb-lines --
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1963 /HeaderLines exch def
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1964 % ---- bottom up
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1965 HeaderPad
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1966 HeaderLines 1 sub HeaderLineHeight mul add
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1967 HeaderTitleLineHeight add
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1968 HeaderPad add
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1969 /HeaderHeight exch def
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1970 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1971
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1972 % |---------|
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1973 % | tm |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1974 % |---------|
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1975 % | header |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1976 % |-+-------| <-- (x y)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1977 % | ho |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1978 % |---------|
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1979 % | text |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1980 % |-+-------| <-- (0 0)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1981 % | bm |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1982 % |---------|
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1983
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1984 /HeaderFrameStart { % -- x y
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1985 0 PrintHeight HeaderOffset add
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1986 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1987
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1988 /HeaderFramePath {
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1989 PrintWidth 0 rlineto
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1990 0 HeaderHeight rlineto
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1991 PrintWidth neg 0 rlineto
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1992 0 HeaderHeight neg rlineto
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1993 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1994
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1995 /HeaderFrame {
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1996 gsave
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1997 0.4 setlinewidth
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
1998 % ---- fill a black rectangle (the shadow of the next one)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
1999 HeaderFrameStart moveto
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2000 1 -1 rmoveto
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2001 HeaderFramePath
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2002 0 setgray fill
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2003 % ---- do the next rectangle ...
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2004 HeaderFrameStart moveto
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2005 HeaderFramePath
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2006 gsave 0.9 setgray fill grestore % filled with grey
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2007 gsave 0 setgray stroke grestore % drawn with black
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2008 grestore
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2009 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2010
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2011 /HeaderStart {
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2012 HeaderFrameStart
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2013 exch HeaderPad add exch % horizontal pad
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2014 % ---- bottom up
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2015 HeaderPad add % vertical pad
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2016 HeaderDescent sub
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2017 HeaderLineHeight HeaderLines 1 sub mul add
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2018 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2019
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2020 /strcat {
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2021 dup length 3 -1 roll dup length dup 4 -1 roll add string dup
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2022 0 5 -1 roll putinterval
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2023 dup 4 2 roll exch putinterval
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2024 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2025
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2026 /pagenumberstring {
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2027 PageNumber 32 string cvs
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2028 ShowNofN {
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2029 (/) strcat
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2030 PageCount 32 string cvs strcat
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2031 } if
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2032 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2033
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2034 /HeaderText {
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2035 HeaderStart moveto
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2036
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2037 HeaderLinesRight HeaderLinesLeft % -- rightLines leftLines
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2038
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2039 % ---- hack: `PN 1 and' == `PN 2 modulo'
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2040
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2041 % ---- if duplex and even page number, then exchange left and right
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2042 Duplex PageNumber 1 and 0 eq and { exch } if
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2043
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2044 { % ---- process the left lines
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2045 aload pop
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2046 exch F
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2047 gsave
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2048 dup xcheck { exec } if
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2049 show
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2050 grestore
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2051 0 HeaderLineHeight neg rmoveto
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2052 } forall
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2053
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2054 HeaderStart moveto
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2055
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2056 { % ---- process the right lines
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2057 aload pop
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2058 exch F
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2059 gsave
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2060 dup xcheck { exec } if
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2061 dup stringwidth pop
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2062 PrintWidth exch sub HeaderPad 2 mul sub 0 rmoveto
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2063 show
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2064 grestore
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2065 0 HeaderLineHeight neg rmoveto
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2066 } forall
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2067 } def
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2068
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2069 /ReportFontInfo {
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2070 2 copy
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2071 /t0 3 1 roll DefFont
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2072 /t0 F
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
2073 /lh FontHeight def
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2074 /sw ( ) stringwidth pop def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2075 /aw (01234567890abcdefghijklmnopqrstuvwxyz) dup length exch
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2076 stringwidth pop exch div def
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2077 /t1 12 /Helvetica-Oblique DefFont
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2078 /t1 F
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2079 gsave
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2080 (For ) show
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2081 128 string cvs show
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2082 ( ) show
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2083 32 string cvs show
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2084 ( point, the line height is ) show
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2085 lh 32 string cvs show
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2086 (, the space width is ) show
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2087 sw 32 string cvs show
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2088 (,) show
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2089 grestore
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
2090 0 FontHeight neg rmoveto
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2091 gsave
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2092 (and a crude estimate of average character width is ) show
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2093 aw 32 string cvs show
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2094 (.) show
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2095 grestore
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2096 0 FontHeight neg rmoveto
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2097 } def
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2098
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2099 /cm { % cm to point
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2100 72 mul 2.54 div
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2101 } def
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2102
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2103 /ReportAllFontInfo {
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2104 FontDirectory
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2105 { % key = font name value = font dictionary
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2106 pop 10 exch ReportFontInfo
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2107 } forall
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2108 } def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2109
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2110 % 3 cm 20 cm moveto 10 /Courier ReportFontInfo showpage
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2111 % 3 cm 20 cm moveto ReportAllFontInfo showpage
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2112
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2113 ")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2114
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2115 (defvar ps-print-prologue-2
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2116 "
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2117 % ---- These lines must be kept together because...
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2118
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2119 /h0 F
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2120 /HeaderTitleLineHeight FontHeight def
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2121
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2122 /h1 F
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2123 /HeaderLineHeight FontHeight def
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2124 /HeaderDescent Descent def
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2125
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2126 % ---- ...because `F' has a side-effect on `FontHeight' and `Descent'
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2127
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2128 ")
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2129
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2130 ;; Start Editing Here:
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2131
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2132 (defvar ps-source-buffer nil)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2133 (defvar ps-spool-buffer-name "*PostScript*")
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2134 (defvar ps-spool-buffer nil)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2135
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2136 (defvar ps-output-head nil)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2137 (defvar ps-output-tail nil)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2138
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2139 (defvar ps-page-count 0)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2140 (defvar ps-showpage-count 0)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2141 (defvar ps-showline-count 1)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2142
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2143 (defvar ps-background-pages nil)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2144 (defvar ps-background-all-pages nil)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2145 (defvar ps-background-text-count 0)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2146 (defvar ps-background-image-count 0)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2147
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2148 (defvar ps-current-font 0)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2149 (defvar ps-default-color (if ps-print-color-p ps-default-fg)) ; black
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2150 (defvar ps-current-color ps-default-color)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2151 (defvar ps-current-bg nil)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2152
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2153 (defvar ps-razchunk 0)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2154
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2155 (defvar ps-color-format
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2156 (if (eq ps-print-emacs-type 'emacs)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2157
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2158 ;;Emacs understands the %f format; we'll
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2159 ;;use it to limit color RGB values to
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2160 ;;three decimals to cut down some on the
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2161 ;;size of the PostScript output.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2162 "%0.3f %0.3f %0.3f"
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2163
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2164 ;; Lucid emacsen will have to make do with
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2165 ;; %s (princ) for floats.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2166 "%s %s %s"))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2167
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2168 ;; These values determine how much print-height to deduct when headers
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2169 ;; are turned on. This is a pretty clumsy way of handling it, but
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2170 ;; it'll do for now.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2171
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2172 (defvar ps-header-font nil)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2173 (defvar ps-header-title-font nil)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2174
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2175 (defvar ps-header-line-height nil)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2176 (defvar ps-header-title-line-height nil)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2177 (defvar ps-header-pad 0
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2178 "Vertical and horizontal space in points (1/72 inch) between the header frame
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2179 and the text it contains.")
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2180
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2181 ;; Define accessors to the dimensions list.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2182
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2183 (defmacro ps-page-dimensions-get-width (dims) `(nth 0 ,dims))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2184 (defmacro ps-page-dimensions-get-height (dims) `(nth 1 ,dims))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2185
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2186 (defvar ps-landscape-page-height nil)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2187
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2188 (defvar ps-print-width nil)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2189 (defvar ps-print-height nil)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2190
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2191 (defvar ps-height-remaining)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2192 (defvar ps-width-remaining)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2193
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2194 (defvar ps-ref-bold-faces nil)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2195 (defvar ps-ref-italic-faces nil)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2196 (defvar ps-ref-underlined-faces nil)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2197
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2198 (defvar ps-print-color-scale nil)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2199
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2200
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2201 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2202 ;; Internal Variables
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2203
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2204
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2205 (defvar ps-print-face-extension-alist nil
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2206 "Alist of symbolic faces with extension features (box, outline, etc).
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2207 An element of this list has the following form:
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2208
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2209 (FACE . [BITS FG BG])
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2210
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2211 FACE is a symbol denoting a face name
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2212 BITS is a bit vector, where each bit correspond
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2213 to a feature (bold, underline, etc)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2214 (see documentation for `ps-print-face-map-alist')
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2215 FG foreground color (string or nil)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2216 BG background color (string or nil)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2217
19446
15ecd855fec8 (ps-print-face-extension-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 19445
diff changeset
2218 Don't change this list directly; instead, use
15ecd855fec8 (ps-print-face-extension-alist): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 19445
diff changeset
2219 `ps-extend-face' and `ps-extend-face-list' to change it.
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2220 See documentation for `ps-extend-face' for valid extension symbol.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2221 See also `font-lock-face-attributes'.")
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2222
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2223
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2224 (defconst ps-print-face-map-alist
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2225 '((bold . 1)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2226 (italic . 2)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2227 (underline . 4)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2228 (strikeout . 8)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2229 (overline . 16)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2230 (shadow . 32)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2231 (box . 64)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2232 (outline . 128))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2233 "Alist of all features and the corresponding bit mask.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2234 Each symbol correspond to one bit in a bit vector.")
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2235
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2236
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2237 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2238 ;; Creating and Remapping Faces
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2239
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2240
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2241 (require 'font-lock)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2242
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2243
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2244 ;; The definition below is necessary because some emacs variant does not
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2245 ;; define it on font-lock package.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2246
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2247 (defvar font-lock-face-attributes nil)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2248
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2249
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2250
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2251 (defun ps-override-list (sym-list element)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2252 (let ((maplist (assq (car element) (symbol-value sym-list))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2253 (if maplist
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2254 (setcdr maplist (cdr element))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2255 (set sym-list (cons element (symbol-value sym-list)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2256 )))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2257
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2258
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2259 (defun ps-extension-to-bit-face (face-extension)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2260 (cons (nth 0 face-extension)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2261 (vector (ps-extension-bit face-extension)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2262 (nth 1 face-extension)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2263 (nth 2 face-extension))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2264
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2265
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2266 (defun ps-extension-to-screen-face (face)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2267 (let ((face-name (nth 0 face))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2268 (face-foreground (nth 1 face))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2269 (face-background (nth 2 face))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2270 (face-attributes (nthcdr 3 face)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2271 (list face-name face-foreground face-background
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2272 (and (memq 'bold face-attributes) t)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2273 (and (memq 'italic face-attributes) t)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2274 (and (memq 'underline face-attributes) t))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2275
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2276
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2277 ;;;###autoload
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2278 (defun ps-extend-face-list (face-extension-list &optional merge-p)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2279 "Extend face in `ps-print-face-extension-alist'.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2280
19485
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
2281 If optional MERGE-P is non-nil, extensions in FACE-EXTENSION are merged with
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2282 face extension in `ps-print-face-extension-alist'; otherwise, overrides.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2283
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2284 The elements in FACE-EXTENSION-LIST is like those for `ps-extend-face'.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2285
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2286 See `ps-extend-face' for documentation."
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2287 (while face-extension-list
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2288 (ps-extend-face (car face-extension-list) merge-p)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2289 (setq face-extension-list (cdr face-extension-list))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2290
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2291
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2292 ;;;###autoload
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2293 (defun ps-extend-face (face-extension &optional merge-p)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2294 "Extend face in `ps-print-face-extension-alist'.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2295
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2296 If optional MERGE-p is non-nil, extensions in FACE-EXTENSION are merged with
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2297 face extensions in `ps-print-face-extension-alist'; otherwise, overrides.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2298
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2299 The elements of FACE-EXTENSION list have the form:
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2300
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2301 (FACE-NAME FOREGROUND BACKGROUND EXTENSION...)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2302
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2303 FACE-NAME is a face name symbol.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2304
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2305 FOREGROUND and BACKGROUND may be nil or a string that denotes the
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2306 foreground and background colors respectively.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2307
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2308 EXTENSION is one of the following symbols:
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2309 bold - use bold font.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2310 italic - use italic font.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2311 underline - put a line under text.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2312 strikeout - like underline, but the line is in middle of text.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2313 overline - like underline, but the line is over the text.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2314 shadow - text will have a shadow.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2315 box - text will be surrounded by a box.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2316 outline - only the text border font will be printed.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2317
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2318 If EXTENSION is any other symbol, it is ignored."
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2319 (let* ((face-name (nth 0 face-extension))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2320 (foreground (nth 1 face-extension))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2321 (background (nth 2 face-extension))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2322 (ps-face (cdr (assq face-name ps-print-face-extension-alist)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2323 (face-vector (or ps-face (vector 0 nil nil)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2324 (face-bit (ps-extension-bit face-extension)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2325 ;; extend face
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2326 (aset face-vector 0 (if merge-p
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2327 (logior (aref face-vector 0) face-bit)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2328 face-bit))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2329 (and foreground (stringp foreground) (aset face-vector 1 foreground))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2330 (and background (stringp background) (aset face-vector 2 background))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2331 ;; if face does not exist, insert it
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2332 (or ps-face
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2333 (setq ps-print-face-extension-alist
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2334 (cons (cons face-name face-vector)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2335 ps-print-face-extension-alist)))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2336
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2337
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2338 (defun ps-extension-bit (face-extension)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2339 (let ((face-bit 0))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2340 ;; map valid symbol extension to bit vector
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2341 (setq face-extension (cdr (cdr face-extension)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2342 (while (setq face-extension (cdr face-extension))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2343 (setq face-bit (logior face-bit
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2344 (or (cdr (assq (car face-extension)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2345 ps-print-face-map-alist))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2346 0))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2347 face-bit))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2348
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2349
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2350 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2351 ;; Internal functions and variables
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2352
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2353
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2354 (defun ps-print-without-faces (from to &optional filename)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2355 (ps-generate (current-buffer) from to 'ps-generate-postscript)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2356 (ps-do-despool filename))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2357
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2358
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2359 (defun ps-spool-without-faces (from to)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2360 (ps-generate (current-buffer) from to 'ps-generate-postscript))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2361
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2362
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2363 (defun ps-print-with-faces (from to &optional filename)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2364 (ps-initialize-faces)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2365 (ps-generate (current-buffer) from to 'ps-generate-postscript-with-faces)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2366 (ps-do-despool filename))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2367
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2368
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2369 (defun ps-spool-with-faces (from to)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2370 (ps-initialize-faces)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2371 (ps-generate (current-buffer) from to 'ps-generate-postscript-with-faces))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2372
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2373
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2374 (defvar ps-initialize-faces nil)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2375
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2376
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2377 (defun ps-initialize-faces ()
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2378 (or ps-initialize-faces
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2379 (progn
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2380 (setq ps-initialize-faces t)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2381 (mapcar 'ps-map-font-lock font-lock-face-attributes))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2382
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2383
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2384 (defun ps-map-font-lock (face)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2385 (let* ((face-map (ps-screen-to-bit-face face))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2386 (ps-face-bit (cdr (assq (car face-map)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2387 ps-print-face-extension-alist))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2388 (if ps-face-bit
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2389 ;; if face exists, merge both
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2390 (let ((face-bit (cdr face-map)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2391 (aset ps-face-bit 0 (logior (aref ps-face-bit 0) (aref face-bit 0)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2392 (or (aref ps-face-bit 1) (aset ps-face-bit 1 (aref face-bit 1)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2393 (or (aref ps-face-bit 2) (aset ps-face-bit 2 (aref face-bit 2))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2394 ;; if face does not exist, insert it
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2395 (setq ps-print-face-extension-alist
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2396 (cons face-map ps-print-face-extension-alist))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2397 )))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2398
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2399
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2400 (defun ps-screen-to-bit-face (face)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2401 (let ((face-name (car face))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2402 (face-foreground (nth 1 face))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2403 (face-background (nth 2 face))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2404 (face-bit (logior (if (nth 3 face) 1 0) ; bold
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2405 (if (nth 4 face) 2 0) ; italic
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2406 (if (nth 5 face) 4 0)))) ; underline
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2407 (cons face-name (vector face-bit face-foreground face-background))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2408
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2409
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2410 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2411 ;; Internal functions
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2412
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2413 (defun ps-line-lengths-internal ()
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2414 "Display the correspondence between a line length and a font size,
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2415 using the current ps-print setup.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2416 Try: pr -t file | awk '{printf \"%3d %s\n\", length($0), $0}' | sort -r | head"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2417 (let ((buf (get-buffer-create "*Line-lengths*"))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2418 (ifs ps-font-size) ; initial font size
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2419 (icw ps-avg-char-width) ; initial character width
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2420 (print-width (progn (ps-get-page-dimensions)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2421 ps-print-width))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2422 (ps-setup (ps-setup)) ; setup for the current buffer
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2423 (fs-min 5) ; minimum font size
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2424 cw-min ; minimum character width
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2425 nb-cpl-max ; maximum nb of characters per line
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2426 (fs-max 14) ; maximum font size
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2427 cw-max ; maximum character width
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2428 nb-cpl-min ; minimum nb of characters per line
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2429 fs ; current font size
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2430 cw ; current character width
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2431 nb-cpl ; current nb of characters per line
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2432 )
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2433 (setq cw-min (/ (* icw fs-min) ifs)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2434 nb-cpl-max (floor (/ print-width cw-min))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2435 cw-max (/ (* icw fs-max) ifs)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2436 nb-cpl-min (floor (/ print-width cw-max)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2437 (setq nb-cpl nb-cpl-min)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2438 (set-buffer buf)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2439 (goto-char (point-max))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2440 (if (not (bolp)) (insert "\n"))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2441 (insert ps-setup)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2442 (insert "nb char per line / font size\n")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2443 (while (<= nb-cpl nb-cpl-max)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2444 (setq cw (/ print-width (float nb-cpl))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2445 fs (/ (* ifs cw) icw))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2446 (insert (format "%3s %s\n" nb-cpl fs))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2447 (setq nb-cpl (1+ nb-cpl)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2448 (insert "\n")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2449 (display-buffer buf 'not-this-window)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2450
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2451 (defun ps-nb-pages (nb-lines)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2452 "Display an approximate correspondence between a font size and the number
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2453 of pages the number of lines would require to print
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2454 using the current ps-print setup."
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2455 (let ((buf (get-buffer-create "*Nb-Pages*"))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2456 (ifs ps-font-size) ; initial font size
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2457 (ilh ps-line-height) ; initial line height
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2458 (page-height (progn (ps-get-page-dimensions)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2459 ps-print-height))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2460 (ps-setup (ps-setup)) ; setup for the current buffer
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2461 (fs-min 4) ; minimum font size
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2462 lh-min ; minimum line height
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2463 nb-lpp-max ; maximum nb of lines per page
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2464 nb-page-min ; minimum nb of pages
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2465 (fs-max 14) ; maximum font size
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2466 lh-max ; maximum line height
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2467 nb-lpp-min ; minimum nb of lines per page
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2468 nb-page-max ; maximum nb of pages
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2469 fs ; current font size
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2470 lh ; current line height
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2471 nb-lpp ; current nb of lines per page
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2472 nb-page ; current nb of pages
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2473 )
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2474 (setq lh-min (/ (* ilh fs-min) ifs)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2475 nb-lpp-max (floor (/ page-height lh-min))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2476 nb-page-min (ceiling (/ (float nb-lines) nb-lpp-max))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2477 lh-max (/ (* ilh fs-max) ifs)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2478 nb-lpp-min (floor (/ page-height lh-max))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2479 nb-page-max (ceiling (/ (float nb-lines) nb-lpp-min)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2480 (setq nb-page nb-page-min)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2481 (set-buffer buf)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2482 (goto-char (point-max))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2483 (if (not (bolp)) (insert "\n"))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2484 (insert ps-setup)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2485 (insert (format "%d lines\n" nb-lines))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2486 (insert "nb page / font size\n")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2487 (while (<= nb-page nb-page-max)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2488 (setq nb-lpp (ceiling (/ nb-lines (float nb-page)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2489 lh (/ page-height nb-lpp)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2490 fs (/ (* ifs lh) ilh))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2491 (insert (format "%s %s\n" nb-page fs))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2492 (setq nb-page (1+ nb-page)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2493 (insert "\n")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2494 (display-buffer buf 'not-this-window)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2495
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2496 (defun ps-select-font ()
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2497 "Choose the font name and size (scaling data)."
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2498 (let ((assoc (assq ps-font-family ps-font-info-database))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2499 l fn fb fi bi sz lh sw aw)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2500 (if (null assoc)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2501 (error "Don't have data to scale font %s. Known fonts families are %s"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2502 ps-font-family
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2503 (mapcar 'car ps-font-info-database)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2504 (setq l (cdr assoc)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2505 fn (prog1 (car l) (setq l (cdr l))) ; need `pop'
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2506 fb (prog1 (car l) (setq l (cdr l)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2507 fi (prog1 (car l) (setq l (cdr l)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2508 bi (prog1 (car l) (setq l (cdr l)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2509 sz (prog1 (car l) (setq l (cdr l)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2510 lh (prog1 (car l) (setq l (cdr l)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2511 sw (prog1 (car l) (setq l (cdr l)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2512 aw (prog1 (car l) (setq l (cdr l))))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2513
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2514 (setq ps-font fn)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2515 (setq ps-font-bold fb)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2516 (setq ps-font-italic fi)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2517 (setq ps-font-bold-italic bi)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2518 ;; These data just need to be rescaled:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2519 (setq ps-line-height (/ (* lh ps-font-size) sz))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2520 (setq ps-space-width (/ (* sw ps-font-size) sz))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2521 (setq ps-avg-char-width (/ (* aw ps-font-size) sz))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2522 ps-font-family))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2523
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2524 (defun ps-select-header-font ()
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2525 "Choose the font name and size (scaling data) for the header."
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2526 (let ((assoc (assq ps-header-font-family ps-font-info-database))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2527 l fn fb fi bi sz lh sw aw)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2528 (if (null assoc)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2529 (error "Don't have data to scale font %s. Known fonts families are %s"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2530 ps-font-family
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2531 (mapcar 'car ps-font-info-database)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2532 (setq l (cdr assoc)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2533 fn (prog1 (car l) (setq l (cdr l))) ; need `pop'
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2534 fb (prog1 (car l) (setq l (cdr l)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2535 fi (prog1 (car l) (setq l (cdr l)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2536 bi (prog1 (car l) (setq l (cdr l)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2537 sz (prog1 (car l) (setq l (cdr l)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2538 lh (prog1 (car l) (setq l (cdr l)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2539 sw (prog1 (car l) (setq l (cdr l)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2540 aw (prog1 (car l) (setq l (cdr l))))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2541
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2542 ;; Font name
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2543 (setq ps-header-font fn)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2544 (setq ps-header-title-font fb)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2545 ;; Line height: These data just need to be rescaled:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2546 (setq ps-header-title-line-height (/ (* lh ps-header-title-font-size) sz))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2547 (setq ps-header-line-height (/ (* lh ps-header-font-size) sz))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2548 ps-header-font-family))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2549
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2550 (defun ps-get-page-dimensions ()
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2551 (let ((page-dimensions (cdr (assq ps-paper-type ps-page-dimensions-database)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2552 page-width page-height)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2553 (cond
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2554 ((null page-dimensions)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2555 (error "`ps-paper-type' must be one of:\n%s"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2556 (mapcar 'car ps-page-dimensions-database)))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2557 ((< ps-number-of-columns 1)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2558 (error "The number of columns %d should not be negative" ps-number-of-columns)))
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2559
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2560 (ps-select-font)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2561 (ps-select-header-font)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2562
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2563 (setq page-width (ps-page-dimensions-get-width page-dimensions)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2564 page-height (ps-page-dimensions-get-height page-dimensions))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2565
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2566 ;; Landscape mode
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2567 (if ps-landscape-mode
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2568 ;; exchange width and height
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2569 (setq page-width (prog1 page-height (setq page-height page-width))))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2570
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2571 ;; It is used to get the lower right corner (only in landscape mode)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2572 (setq ps-landscape-page-height page-height)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2573
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2574 ;; | lm | text | ic | text | ic | text | rm |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2575 ;; page-width == lm + n * pw + (n - 1) * ic + rm
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2576 ;; => pw == (page-width - lm -rm - (n - 1) * ic) / n
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2577 (setq ps-print-width
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2578 (/ (- page-width
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2579 ps-left-margin ps-right-margin
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2580 (* (1- ps-number-of-columns) ps-inter-column))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2581 ps-number-of-columns))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2582 (if (<= ps-print-width 0)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2583 (error "Bad horizontal layout:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2584 page-width == %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2585 ps-left-margin == %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2586 ps-right-margin == %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2587 ps-inter-column == %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2588 ps-number-of-columns == %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2589 | lm | text | ic | text | ic | text | rm |
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2590 page-width == lm + n * print-width + (n - 1) * ic + rm
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2591 => print-width == %d !"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2592 page-width
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2593 ps-left-margin
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2594 ps-right-margin
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2595 ps-inter-column
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2596 ps-number-of-columns
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2597 ps-print-width))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2598
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2599 (setq ps-print-height
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2600 (- page-height ps-bottom-margin ps-top-margin))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2601 (if (<= ps-print-height 0)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2602 (error "Bad vertical layout:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2603 ps-top-margin == %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2604 ps-bottom-margin == %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2605 page-height == bm + print-height + tm
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2606 => print-height == %d !"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2607 ps-top-margin
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2608 ps-bottom-margin
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2609 ps-print-height))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2610 ;; If headers are turned on, deduct the height of the header from
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2611 ;; the print height.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2612 (cond
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2613 (ps-print-header
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2614 (setq ps-header-pad
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2615 (* ps-header-line-pad ps-header-title-line-height))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2616 (setq ps-print-height
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2617 (- ps-print-height
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2618 ps-header-offset
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2619 ps-header-pad
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2620 ps-header-title-line-height
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2621 (* ps-header-line-height (- ps-header-lines 1))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2622 ps-header-pad))))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2623 (if (<= ps-print-height 0)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2624 (error "Bad vertical layout:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2625 ps-top-margin == %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2626 ps-bottom-margin == %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2627 ps-header-offset == %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2628 ps-header-pad == %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2629 header-height == %s
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2630 page-height == bm + print-height + tm - ho - hh
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2631 => print-height == %d !"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2632 ps-top-margin
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2633 ps-bottom-margin
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2634 ps-header-offset
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2635 ps-header-pad
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2636 (+ ps-header-pad
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2637 ps-header-title-line-height
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2638 (* ps-header-line-height (- ps-header-lines 1))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2639 ps-header-pad)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2640 ps-print-height))))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2641
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2642 (defun ps-print-preprint (&optional filename)
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2643 (if (and filename
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2644 (or (numberp filename)
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2645 (listp filename)))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2646 (let* ((name (concat (buffer-name) ".ps"))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2647 (prompt (format "Save PostScript to file: (default %s) "
15163
df250bc97b46 (ps-print-preprint): Special handling if
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
2648 name))
df250bc97b46 (ps-print-preprint): Special handling if
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
2649 (res (read-file-name prompt default-directory name nil)))
df250bc97b46 (ps-print-preprint): Special handling if
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
2650 (if (file-directory-p res)
df250bc97b46 (ps-print-preprint): Special handling if
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
2651 (expand-file-name name (file-name-as-directory res))
df250bc97b46 (ps-print-preprint): Special handling if
Richard M. Stallman <rms@gnu.org>
parents: 14734
diff changeset
2652 res))))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2653
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2654 ;; The following functions implement a simple list-buffering scheme so
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2655 ;; that ps-print doesn't have to repeatedly switch between buffers
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2656 ;; while spooling. The functions ps-output and ps-output-string build
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2657 ;; up the lists; the function ps-flush-output takes the lists and
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2658 ;; insert its contents into the spool buffer (*PostScript*).
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2659
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2660 (defun ps-output-string-prim (string)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2661 (insert "(") ;insert start-string delimiter
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2662 (save-excursion ;insert string
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2663 (insert string))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2664
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2665 ;; Find and quote special characters as necessary for PS
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2666 (while (re-search-forward "[()\\]" nil t)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2667 (save-excursion
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2668 (forward-char -1)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2669 (insert "\\")))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2670
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2671 (goto-char (point-max))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2672 (insert ")")) ;insert end-string delimiter
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2673
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2674 (defun ps-init-output-queue ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2675 (setq ps-output-head (list ""))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2676 (setq ps-output-tail ps-output-head))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2677
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2678 (defun ps-output (&rest args)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2679 (setcdr ps-output-tail args)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2680 (while (cdr ps-output-tail)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2681 (setq ps-output-tail (cdr ps-output-tail))))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2682
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2683 (defun ps-output-string (string)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2684 (ps-output t string))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2685
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2686 (defun ps-output-list (the-list)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2687 (mapcar 'ps-output the-list))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2688
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2689 (defun ps-flush-output ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2690 (save-excursion
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2691 (set-buffer ps-spool-buffer)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2692 (goto-char (point-max))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2693 (while ps-output-head
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2694 (let ((it (car ps-output-head)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2695 (if (not (eq t it))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2696 (insert it)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2697 (setq ps-output-head (cdr ps-output-head))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2698 (ps-output-string-prim (car ps-output-head))))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2699 (setq ps-output-head (cdr ps-output-head))))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2700 (ps-init-output-queue))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2701
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2702 (defun ps-insert-file (fname)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2703 (ps-flush-output)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2704 ;; Check to see that the file exists and is readable; if not, throw
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2705 ;; an error.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2706 (or (file-readable-p fname)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2707 (error "Could not read file `%s'" fname))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2708 (save-excursion
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2709 (set-buffer ps-spool-buffer)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2710 (goto-char (point-max))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2711 (insert-file fname)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2712
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2713 ;; These functions insert the arrays that define the contents of the
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2714 ;; headers.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2715
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2716 (defun ps-generate-header-line (fonttag &optional content)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2717 (ps-output " [ " fonttag " ")
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2718 (cond
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2719 ;; Literal strings should be output as is -- the string must
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2720 ;; contain its own PS string delimiters, '(' and ')', if necessary.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2721 ((stringp content)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2722 (ps-output content))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2723
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2724 ;; Functions are called -- they should return strings; they will be
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2725 ;; inserted as strings and the PS string delimiters added.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2726 ((and (symbolp content) (fboundp content))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2727 (ps-output-string (funcall content)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2728
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2729 ;; Variables will have their contents inserted. They should
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2730 ;; contain strings, and will be inserted as strings.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2731 ((and (symbolp content) (boundp content))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2732 (ps-output-string (symbol-value content)))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2733
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2734 ;; Anything else will get turned into an empty string.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2735 (t
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2736 (ps-output-string "")))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2737 (ps-output " ]\n"))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2738
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2739 (defun ps-generate-header (name contents)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2740 (ps-output "/" name " [\n")
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2741 (if (> ps-header-lines 0)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2742 (let ((count 1))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2743 (ps-generate-header-line "/h0" (car contents))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2744 (while (and (< count ps-header-lines)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2745 (setq contents (cdr contents)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2746 (ps-generate-header-line "/h1" (car contents))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2747 (setq count (+ count 1)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2748 (ps-output "] def\n"))))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2749
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2750 (defun ps-output-boolean (name bool)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2751 (ps-output (format "/%s %s def\n" name (if bool "true" "false"))))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2752
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2753 (defsubst ps-count-lines (from to)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2754 (+ (count-lines from to)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2755 (save-excursion (goto-char to)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2756 (if (= (current-column) 0) 1 0))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2757
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2758
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2759 (defun ps-background-pages (page-list func)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2760 (if page-list
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2761 (mapcar
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2762 '(lambda (pages)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2763 (let ((start (if (consp pages) (car pages) pages))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2764 (end (if (consp pages) (cdr pages) pages)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2765 (and (integerp start) (integerp end) (<= start end)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2766 (add-to-list 'ps-background-pages (vector start end func)))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2767 page-list)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2768 (setq ps-background-all-pages (cons func ps-background-all-pages))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2769
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2770
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2771 (defun ps-get-boundingbox ()
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2772 (save-excursion
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2773 (set-buffer ps-spool-buffer)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2774 (save-excursion
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2775 (if (re-search-forward
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2776 "^%%BoundingBox:\\s-+\\([0-9.]+\\)\\s-+\\([0-9.]+\\)\\s-+\\([0-9.]+\\)\\s-+\\([0-9.]+\\)"
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2777 nil t)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2778 (vector (string-to-number ; lower x
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2779 (buffer-substring (match-beginning 1) (match-end 1)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2780 (string-to-number ; lower y
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2781 (buffer-substring (match-beginning 2) (match-end 2)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2782 (string-to-number ; upper x
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2783 (buffer-substring (match-beginning 3) (match-end 3)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2784 (string-to-number ; upper y
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2785 (buffer-substring (match-beginning 4) (match-end 4))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2786 (vector 0 0 0 0)))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2787
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2788
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2789 ;; Emacs understands the %f format; we'll use it to limit color RGB values
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2790 ;; to three decimals to cut down some on the size of the PostScript output.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2791 ;; Lucid emacsen will have to make do with %s (princ) for floats.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2792
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2793 (defvar ps-float-format (if (eq ps-print-emacs-type 'emacs)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2794 "%0.3f " ; emacs
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2795 "%s ")) ; Lucid emacsen
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2796
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2797
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2798 (defun ps-float-format (value &optional default)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2799 (let ((literal (or value default)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2800 (if literal
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2801 (format (if (numberp literal)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2802 ps-float-format
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2803 "%s ")
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2804 literal)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2805 " ")))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2806
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2807
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2808 (defun ps-background-text ()
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2809 (mapcar
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2810 '(lambda (text)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2811 (setq ps-background-text-count (1+ ps-background-text-count))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2812 (ps-output (format "/ShowBackText-%d {\n" ps-background-text-count))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2813 (ps-output-string (nth 0 text)) ; text
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2814 (ps-output
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2815 "\n"
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2816 (ps-float-format (nth 4 text) 200.0) ; font size
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2817 (format "/%s " (or (nth 3 text) "Times-Roman")) ; font name
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2818 (ps-float-format (nth 6 text)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2819 "PrintHeight PrintPageWidth atan") ; rotation
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2820 (ps-float-format (nth 5 text) 0.85) ; gray
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2821 (ps-float-format (nth 1 text) "0") ; x position
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2822 (ps-float-format (nth 2 text) "BottomMargin") ; y position
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2823 "\nShowBackText} def\n")
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2824 (ps-background-pages (nthcdr 7 text) ; page list
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2825 (format "ShowBackText-%d\n"
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2826 ps-background-text-count)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2827 ps-print-background-text))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2828
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2829
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2830 (defun ps-background-image ()
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2831 (mapcar
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2832 '(lambda (image)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2833 (let ((image-file (expand-file-name (nth 0 image))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2834 (if (file-readable-p image-file)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2835 (progn
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2836 (setq ps-background-image-count (1+ ps-background-image-count))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2837 (ps-output
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2838 (format "/ShowBackImage-%d {\n--back-- " ps-background-image-count)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2839 (ps-float-format (nth 5 image) 0.0) ; rotation
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2840 (ps-float-format (nth 3 image) 1.0) ; x scale
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2841 (ps-float-format (nth 4 image) 1.0) ; y scale
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2842 (ps-float-format (nth 1 image) ; x position
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2843 "PrintPageWidth 2 div")
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2844 (ps-float-format (nth 2 image) ; y position
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2845 "PrintHeight 2 div BottomMargin add")
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2846 "\nBeginBackImage\n")
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2847 (ps-insert-file image-file)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2848 ;; coordinate adjustment to centralize image
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2849 ;; around x and y position
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2850 (let ((box (ps-get-boundingbox)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2851 (save-excursion
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2852 (set-buffer ps-spool-buffer)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2853 (save-excursion
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2854 (if (re-search-backward "^--back--" nil t)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2855 (replace-match
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2856 (format "%s %s"
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2857 (ps-float-format
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2858 (- (+ (/ (- (aref box 2) (aref box 0)) 2.0)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2859 (aref box 0))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2860 (ps-float-format
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2861 (- (+ (/ (- (aref box 3) (aref box 1)) 2.0)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2862 (aref box 1)))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2863 t)))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2864 (ps-output "\nEndBackImage} def\n")
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2865 (ps-background-pages (nthcdr 6 image) ; page list
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2866 (format "ShowBackImage-%d\n"
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2867 ps-background-image-count))))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2868 ps-print-background-image))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2869
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2870
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2871 (defun ps-background ()
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2872 (let (has-local-background)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2873 (mapcar '(lambda (range)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2874 (and (<= (aref range 0) ps-page-count)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2875 (<= ps-page-count (aref range 1))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2876 (if has-local-background
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2877 (ps-output (aref range 2))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2878 (setq has-local-background t)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2879 (ps-output "/printLocalBackground {\n"
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2880 (aref range 2)))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2881 ps-background-pages)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2882 (and has-local-background (ps-output "} def\n"))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2883
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2884
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2885 (defun ps-begin-file ()
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2886 (ps-get-page-dimensions)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2887 (setq ps-showpage-count 0
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2888 ps-showline-count 1
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2889 ps-background-text-count 0
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2890 ps-background-image-count 0
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2891 ps-background-pages nil
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2892 ps-background-all-pages nil)
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2893
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2894 (ps-output ps-adobe-tag)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2895 (ps-output "%%Title: " (buffer-name)) ;Take job name from name of
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2896 ;first buffer printed
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2897 (ps-output "\n%%Creator: " (user-full-name))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2898 (ps-output "\n%%CreationDate: "
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2899 (time-stamp-hh:mm:ss) " " (time-stamp-mon-dd-yyyy)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2900 "\n%%Orientation: "
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2901 (if ps-landscape-mode "Landscape" "Portrait"))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2902 (ps-output "\n%% DocumentFonts: Times-Roman Times-Italic "
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2903 ps-font " " ps-font-bold " " ps-font-italic " "
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2904 ps-font-bold-italic " "
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2905 ps-header-font " " ps-header-title-font)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2906 (ps-output "\n%%Pages: (atend)\n")
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2907 (ps-output "%%EndComments\n\n")
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2908
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2909 (ps-output-boolean "LandscapeMode" ps-landscape-mode)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2910 (ps-output (format "/NumberOfColumns %d def\n" ps-number-of-columns))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2911
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2912 (ps-output (format "/LandscapePageHeight %s def\n" ps-landscape-page-height))
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2913 (ps-output (format "/PrintPageWidth %s def\n"
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2914 (- (* (+ ps-print-width ps-inter-column)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2915 ps-number-of-columns)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2916 ps-inter-column)))
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2917 (ps-output (format "/PrintWidth %s def\n" ps-print-width))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2918 (ps-output (format "/PrintHeight %s def\n" ps-print-height))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2919
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2920 (ps-output (format "/LeftMargin %s def\n" ps-left-margin))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2921 (ps-output (format "/RightMargin %s def\n" ps-right-margin)) ; not used
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2922 (ps-output (format "/InterColumn %s def\n" ps-inter-column))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2923
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2924 (ps-output (format "/BottomMargin %s def\n" ps-bottom-margin))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2925 (ps-output (format "/TopMargin %s def\n" ps-top-margin)) ; not used
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2926 (ps-output (format "/HeaderOffset %s def\n" ps-header-offset))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2927 (ps-output (format "/HeaderPad %s def\n" ps-header-pad))
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
2928
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2929 (ps-output-boolean "PrintHeader" ps-print-header)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2930 (ps-output-boolean "PrintHeaderFrame" ps-print-header-frame)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2931 (ps-output-boolean "ShowNofN" ps-show-n-of-n)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2932 (ps-output-boolean "Duplex" ps-spool-duplex)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2933
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2934 (ps-output (format "/LineHeight %s def\n" ps-line-height)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2935 (format "/LinesPerColumn %d def\n"
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2936 (round (/ (+ (if ps-print-header
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2937 (- ps-print-height (ps-header-height))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2938 ps-print-height)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2939 (* ps-line-height 0.45))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2940 ps-line-height))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2941
19485
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
2942 (ps-output-boolean "Zebra" ps-zebra-stripes)
eab8baa19dfa (ps-zebra-stripes): Renamed from ps-zebra-stripe.
Richard M. Stallman <rms@gnu.org>
parents: 19446
diff changeset
2943 (ps-output (format "/NumberOfZebra %d def\n" ps-zebra-stripe-height))
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2944
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2945 (ps-output-boolean "PrintLineNumber" ps-line-number)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2946 (ps-output (format "/Lines %d def\n" (ps-count-lines (point-min) (point-max))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2947
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2948 (ps-background-text)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2949 (ps-background-image)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2950 (setq ps-background-all-pages (nreverse ps-background-all-pages)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2951 ps-background-pages (nreverse ps-background-pages))
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2952
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2953 (ps-output ps-print-prologue-1)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2954
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2955 (ps-output "/printGlobalBackground {\n")
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2956 (ps-output-list ps-background-all-pages)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2957 (ps-output "} def\n/printLocalBackground {\n} def\n")
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2958
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2959 ;; Header fonts
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2960 (ps-output ; /h0 14 /Helvetica-Bold Font
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2961 (format "/h0 %s /%s DefFont\n" ps-header-title-font-size ps-header-title-font))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2962 (ps-output ; /h1 12 /Helvetica Font
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2963 (format "/h1 %s /%s DefFont\n" ps-header-font-size ps-header-font))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2964
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2965 (ps-output ps-print-prologue-2)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2966
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2967 ;; Text fonts
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2968 (ps-output (format "/f0 %s /%s DefFont\n" ps-font-size ps-font))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2969 (ps-output (format "/f1 %s /%s DefFont\n" ps-font-size ps-font-bold))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2970 (ps-output (format "/f2 %s /%s DefFont\n" ps-font-size ps-font-italic))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2971 (ps-output (format "/f3 %s /%s DefFont\n" ps-font-size ps-font-bold-italic))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2972
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2973 (ps-output "\nBeginDoc\n\n")
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2974 (ps-output "%%EndPrologue\n"))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2975
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2976 (defun ps-header-dirpart ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2977 (let ((fname (buffer-file-name)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2978 (if fname
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2979 (if (string-equal (buffer-name) (file-name-nondirectory fname))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2980 (file-name-directory fname)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2981 fname)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2982 "")))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2983
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2984 (defun ps-get-buffer-name ()
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2985 (cond
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2986 ;; Indulge Jim this little easter egg:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2987 ((string= (buffer-name) "ps-print.el")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2988 "Hey, Cool! It's ps-print.el!!!")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2989 ;; Indulge Jack this other little easter egg:
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2990 ((string= (buffer-name) "sokoban.el")
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
2991 "Super! C'est sokoban.el!")
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2992 (t (concat
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2993 (buffer-name)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
2994 (and (buffer-modified-p) " (unsaved)")))))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2995
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2996 (defun ps-begin-job ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
2997 (setq ps-page-count 0))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2998
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2999 (defun ps-end-file ()
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3000 (ps-output "\n%%Trailer\n")
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
3001 (ps-output (format "%%%%Pages: %d\n" (1+ (/ (1- ps-page-count)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3002 ps-number-of-columns))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3003 (ps-output "\nEndDoc\n\n%%EOF\n"))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3004
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3005
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3006 (defun ps-header-height ()
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3007 (+ ps-header-title-line-height
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3008 (* ps-header-line-height (1- ps-header-lines))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3009 (* 2 ps-header-pad)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3010
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3011
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3012 (defun ps-next-page ()
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3013 (ps-end-page)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3014 (ps-flush-output)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3015 (ps-begin-page))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3016
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3017 (defun ps-begin-page (&optional dummypage)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3018 (ps-get-page-dimensions)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3019 (setq ps-width-remaining ps-print-width)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3020 (setq ps-height-remaining ps-print-height)
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3021
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
3022 ;; Print only when a new real page begins.
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
3023 (when (zerop (mod ps-page-count ps-number-of-columns))
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
3024 (ps-output (format "\n%%%%Page: %d %d\n"
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
3025 (1+ (/ ps-page-count ps-number-of-columns))
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
3026 (1+ (/ ps-page-count ps-number-of-columns)))))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3027
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3028 (ps-output "BeginDSCPage\n")
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3029 (ps-output (format "/LineNumber %d def\n" ps-showline-count)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3030 (format "/PageNumber %d def\n" (incf ps-page-count)))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3031 (ps-output "/PageCount 0 def\n")
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3032
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
3033 (when ps-print-header
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
3034 (ps-generate-header "HeaderLinesLeft" ps-left-header)
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
3035 (ps-generate-header "HeaderLinesRight" ps-right-header)
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
3036 (ps-output (format "%d SetHeaderLines\n" ps-header-lines)))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3037
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3038 (ps-background)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3039
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3040 (ps-output "BeginPage\n")
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3041 (ps-set-font ps-current-font)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3042 (ps-set-bg ps-current-bg)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3043 (ps-set-color ps-current-color))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3044
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3045 (defun ps-end-page ()
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3046 (setq ps-showpage-count (+ 1 ps-showpage-count))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3047 (ps-output "EndPage\n")
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3048 (ps-output "EndDSCPage\n"))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3049
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3050 (defun ps-dummy-page ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3051 (setq ps-showpage-count (+ 1 ps-showpage-count))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3052 (ps-output "%%Page: " (format "- %d\n" ps-showpage-count)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3053 "BeginDSCPage
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3054 /PrintHeader false def
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3055 BeginPage
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3056 EndPage
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3057 EndDSCPage\n"))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3058
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3059 (defun ps-next-line ()
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3060 (setq ps-showline-count (1+ ps-showline-count))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3061 (if (< ps-height-remaining ps-line-height)
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3062 (ps-next-page)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3063 (setq ps-width-remaining ps-print-width)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3064 (setq ps-height-remaining (- ps-height-remaining ps-line-height))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3065 (ps-hard-lf)))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3066
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3067 (defun ps-continue-line ()
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3068 (if (< ps-height-remaining ps-line-height)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3069 (ps-next-page)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3070 (setq ps-width-remaining ps-print-width)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3071 (setq ps-height-remaining (- ps-height-remaining ps-line-height))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3072 (ps-soft-lf)))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3073
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3074 ;; [jack] Why hard and soft ?
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3075
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3076 (defun ps-hard-lf ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3077 (ps-output "HL\n"))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3078
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3079 (defun ps-soft-lf ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3080 (ps-output "SL\n"))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3081
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3082 (defun ps-find-wrappoint (from to char-width)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3083 (let ((avail (truncate (/ ps-width-remaining char-width)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3084 (todo (- to from)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3085 (if (< todo avail)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3086 (cons to (* todo char-width))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3087 (cons (+ from avail) ps-width-remaining))))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3088
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3089 (defun ps-basic-plot-string (from to &optional bg-color)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3090 (let* ((wrappoint (ps-find-wrappoint from to ps-avg-char-width))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3091 (to (car wrappoint))
17588
0054114145ca change all buffer-substring to buffer-substring-no-properties.
Simon Marshall <simon@gnu.org>
parents: 17440
diff changeset
3092 (string (buffer-substring-no-properties from to)))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3093 (ps-output-string string)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3094 (ps-output " S\n")
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3095 wrappoint))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3096
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3097 (defun ps-basic-plot-whitespace (from to &optional bg-color)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3098 (let* ((wrappoint (ps-find-wrappoint from to ps-space-width))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3099 (to (car wrappoint)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3100 (ps-output (format "%d W\n" (- to from)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3101 wrappoint))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3102
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3103 (defun ps-plot (plotfunc from to &optional bg-color)
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3104 (while (< from to)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3105 (let* ((wrappoint (funcall plotfunc from to bg-color))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3106 (plotted-to (car wrappoint))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3107 (plotted-width (cdr wrappoint)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3108 (setq from plotted-to)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3109 (setq ps-width-remaining (- ps-width-remaining plotted-width))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3110 (if (< from to)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3111 (ps-continue-line))))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3112 (if ps-razzle-dazzle
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3113 (let* ((q-todo (- (point-max) (point-min)))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3114 (q-done (- (point) (point-min)))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3115 (chunkfrac (/ q-todo 8))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3116 (chunksize (if (> chunkfrac 1000) 1000 chunkfrac)))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3117 (if (> (- q-done ps-razchunk) chunksize)
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3118 (let (foo)
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3119 (setq ps-razchunk q-done)
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3120 (setq foo
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3121 (if (< q-todo 100)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3122 (/ (* 100 q-done) q-todo)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3123 (/ q-done (/ q-todo 100))))
16870
4a5fa29f79d6 (ps-print-version): Fix value.
Richard M. Stallman <rms@gnu.org>
parents: 16361
diff changeset
3124 (message "Formatting...%3d%%" foo))))))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3125
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3126 (defun ps-set-font (font)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3127 (setq ps-current-font font)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3128 (ps-output (format "/f%d F\n" ps-current-font)))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3129
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3130 (defun ps-set-bg (color)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3131 (if (setq ps-current-bg color)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3132 (ps-output (format ps-color-format (nth 0 color) (nth 1 color)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3133 (nth 2 color))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3134 " true BG\n")
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3135 (ps-output "false BG\n")))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3136
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3137 (defun ps-set-color (color)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3138 (if (setq ps-current-color color)
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3139 nil
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3140 (setq ps-current-color ps-default-fg))
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3141 (ps-output (format ps-color-format (nth 0 ps-current-color)
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3142 (nth 1 ps-current-color) (nth 2 ps-current-color))
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3143 " FG\n"))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3144
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3145
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3146 (defvar ps-current-effect 0)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3147
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3148
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3149 (defun ps-plot-region (from to font &optional fg-color bg-color effects)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3150 (if (not (equal font ps-current-font))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3151 (ps-set-font font))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3152
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3153 ;; Specify a foreground color only if one's specified and it's
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3154 ;; different than the current.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3155 (if (not (equal fg-color ps-current-color))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3156 (ps-set-color fg-color))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3157
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3158 (if (not (equal bg-color ps-current-bg))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3159 (ps-set-bg bg-color))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3160
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3161 ;; Specify effects (underline, overline, box, etc)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3162 (cond
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3163 ((not (integerp effects))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3164 (ps-output "0 EF\n")
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3165 (setq ps-current-effect 0))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3166 ((/= effects ps-current-effect)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3167 (ps-output (number-to-string effects) " EF\n")
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3168 (setq ps-current-effect effects)))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3169
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3170 ;; Starting at the beginning of the specified region...
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3171 (save-excursion
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3172 (goto-char from)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3173
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3174 ;; ...break the region up into chunks separated by tabs, linefeeds,
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3175 ;; pagefeeds, control characters, and plot each chunk.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3176 (while (< from to)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3177 (if (re-search-forward "[\000-\037\177-\377]" to t)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3178 ;; region whith some control characters
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3179 (let ((match (char-after (match-beginning 0))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3180 (if (= match ?\t) ; tab
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3181 (let ((linestart
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3182 (save-excursion (beginning-of-line) (point))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3183 (ps-plot 'ps-basic-plot-string from (- (point) 1)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3184 bg-color)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3185 (forward-char -1)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3186 (setq from (+ linestart (current-column)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3187 (if (re-search-forward "[ \t]+" to t)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3188 (ps-plot 'ps-basic-plot-whitespace
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3189 from (+ linestart (current-column))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3190 bg-color)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3191 ;; any other control character except tab
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3192 (ps-plot 'ps-basic-plot-string from (- (point) 1) bg-color)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3193 (cond
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3194 ((= match ?\n) ; newline
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3195 (ps-next-line))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3196
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3197 ((= match ?\f) ; form feed
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3198 (ps-next-page))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3199
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3200 ((<= match ?\037) ; characters from ^@ to ^_
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3201 (ps-control-character (format "^%c" (+ match ?@))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3202
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3203 ((= match ?\177) ; del (127) is printed ^?
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3204 (ps-control-character "^?"))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3205
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3206 (t ; characters from 128 to 255
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3207 (ps-control-character (format "\\%o" match)))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3208 (setq from (point)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3209 ;; region without control characters
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3210 (ps-plot 'ps-basic-plot-string from to bg-color)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3211 (setq from to)))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3212
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3213 (defun ps-control-character (str)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3214 (let* ((from (1- (point)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3215 (len (length str))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3216 (to (+ from len))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3217 (wrappoint (ps-find-wrappoint from to ps-avg-char-width)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3218 (if (< (car wrappoint) to)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3219 (ps-continue-line))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3220 (setq ps-width-remaining (- ps-width-remaining (* len ps-avg-char-width)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3221 (ps-output-string str)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3222 (ps-output " S\n")))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3223
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3224 (defun ps-color-value (x-color-value)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3225 ;; Scale 16-bit X-COLOR-VALUE to PostScript color value in [0, 1] interval.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3226 (/ x-color-value ps-print-color-scale))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3227
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3228 (defun ps-color-values (x-color)
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3229 (cond ((fboundp 'x-color-values)
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3230 (x-color-values x-color))
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3231 ((fboundp 'pixel-components)
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3232 (pixel-components x-color))
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3233 (t (error "No available function to determine X color values."))))
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3234
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3235
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3236 (defun ps-get-face (face)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3237 "Return face description on `ps-print-face-extension-alist'.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3238
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3239 If FACE is not in `ps-print-face-extension-alist',
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3240 insert it and return the description.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3241
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3242 If FACE is not a valid face name, it is used default face."
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3243 (or (assq face ps-print-face-extension-alist)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3244 (let* ((the-face (if (facep face) face 'default))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3245 (font (face-font the-face t))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3246 (new-face
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3247 (cons the-face
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3248 (vector
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3249 (logior (if (memq 'bold font) 1 0)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3250 (if (memq 'italic font) 2 0)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3251 (if (face-underline-p the-face) 4 0))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3252 (face-foreground the-face)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3253 (face-background the-face)))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3254 (or (and (eq the-face 'default)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3255 (assq the-face ps-print-face-extension-alist))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3256 (setq ps-print-face-extension-alist
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3257 (cons new-face
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3258 ps-print-face-extension-alist)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3259 new-face)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3260
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3261
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3262 (defun ps-face-attributes (face)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3263 (let* ((face-vector (cdr (ps-get-face face)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3264 (effects (logior (aref face-vector 0)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3265 (if (memq face ps-ref-bold-faces) 1 0)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3266 (if (memq face ps-ref-italic-faces) 2 0)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3267 (if (memq face ps-ref-underlined-faces) 4 0))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3268 (vector effects (aref face-vector 1) (aref face-vector 2))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3269
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3270
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3271 (defun ps-face-attribute-list (face-or-list)
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3272 (if (listp face-or-list)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3273 ;; list of faces
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3274 (let ((effects 0) foreground background face-attr face)
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3275 (while face-or-list
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3276 (setq face (car face-or-list)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3277 face-attr (ps-face-attributes face)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3278 effects (logior effects (aref face-attr 0)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3279 (or foreground (setq foreground (aref face-attr 1)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3280 (or background (setq background (aref face-attr 2)))
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3281 (setq face-or-list (cdr face-or-list)))
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3282 (vector effects foreground background))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3283 ;; simple face
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3284 (ps-face-attributes face-or-list)))
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3285
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3286
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3287 (defun ps-plot-with-face (from to face)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3288 (if face
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3289 (let* ((face-bit (ps-face-attribute-list face))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3290 (effect (aref face-bit 0))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3291 (foreground (aref face-bit 1))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3292 (background (aref face-bit 2))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3293 (fg-color (if (and ps-print-color-p foreground)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3294 (mapcar 'ps-color-value
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3295 (ps-color-values foreground))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3296 ps-default-color))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3297 (bg-color (if (and ps-print-color-p background)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3298 (mapcar 'ps-color-value
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3299 (ps-color-values background)))))
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3300 (ps-plot-region from to (logand effect 3)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3301 fg-color bg-color (lsh effect -2)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3302 (ps-plot-region from to 0))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3303 (goto-char to))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3304
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3305
12768
68b1359ecd66 Renamed `fsf' to `emacs' in all names.
Richard M. Stallman <rms@gnu.org>
parents: 11799
diff changeset
3306 (defun ps-emacs-face-kind-p (face kind kind-regex kind-list)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3307 (let ((frame-font (face-font face))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3308 (face-defaults (face-font face t)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3309 (or
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3310 ;; Check FACE defaults:
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3311 (and (listp face-defaults)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3312 (memq kind face-defaults))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3313 ;; Check the user's preferences
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3314 (memq face kind-list))))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3315
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3316 (defun ps-xemacs-face-kind-p (face kind kind-regex kind-list)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3317 (let* ((frame-font (or (face-font face) (face-font 'default)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3318 (kind-cons (assq kind (x-font-properties frame-font)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3319 (kind-spec (cdr-safe kind-cons))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3320 (case-fold-search t))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3321
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3322 (or (and kind-spec (string-match kind-regex kind-spec))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3323 ;; Kludge-compatible:
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3324 (memq face kind-list))))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3325
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3326 (defun ps-face-bold-p (face)
12769
4a905565cfa6 (ps-print-emacs-type): Renamed from emacs-type.
Richard M. Stallman <rms@gnu.org>
parents: 12768
diff changeset
3327 (if (eq ps-print-emacs-type 'emacs)
12768
68b1359ecd66 Renamed `fsf' to `emacs' in all names.
Richard M. Stallman <rms@gnu.org>
parents: 11799
diff changeset
3328 (ps-emacs-face-kind-p face 'bold "-\\(bold\\|demibold\\)-"
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3329 ps-bold-faces)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3330 (ps-xemacs-face-kind-p face 'WEIGHT_NAME "bold\\|demibold"
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3331 ps-bold-faces)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3332
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3333 (defun ps-face-italic-p (face)
12769
4a905565cfa6 (ps-print-emacs-type): Renamed from emacs-type.
Richard M. Stallman <rms@gnu.org>
parents: 12768
diff changeset
3334 (if (eq ps-print-emacs-type 'emacs)
12768
68b1359ecd66 Renamed `fsf' to `emacs' in all names.
Richard M. Stallman <rms@gnu.org>
parents: 11799
diff changeset
3335 (ps-emacs-face-kind-p face 'italic "-[io]-" ps-italic-faces)
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3336 (or
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3337 (ps-xemacs-face-kind-p face 'ANGLE_NAME "i\\|o" ps-italic-faces)
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3338 (ps-xemacs-face-kind-p face 'SLANT "i\\|o" ps-italic-faces))))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3339
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3340 (defun ps-face-underlined-p (face)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3341 (or (face-underline-p face)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3342 (memq face ps-underlined-faces)))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3343
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3344 ;; Ensure that face-list is fbound.
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3345 (or (fboundp 'face-list) (defalias 'face-list 'list-faces))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3346
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3347 (defun ps-build-reference-face-lists ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3348 (if ps-auto-font-detect
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3349 (let ((faces (face-list))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3350 the-face)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3351 (setq ps-ref-bold-faces nil
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3352 ps-ref-italic-faces nil
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3353 ps-ref-underlined-faces nil)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3354 (while faces
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3355 (setq the-face (car faces))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3356 (if (ps-face-italic-p the-face)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3357 (setq ps-ref-italic-faces
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3358 (cons the-face ps-ref-italic-faces)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3359 (if (ps-face-bold-p the-face)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3360 (setq ps-ref-bold-faces
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3361 (cons the-face ps-ref-bold-faces)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3362 (if (ps-face-underlined-p the-face)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3363 (setq ps-ref-underlined-faces
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3364 (cons the-face ps-ref-underlined-faces)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3365 (setq faces (cdr faces))))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3366 (setq ps-ref-bold-faces ps-bold-faces)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3367 (setq ps-ref-italic-faces ps-italic-faces)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3368 (setq ps-ref-underlined-faces ps-underlined-faces))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3369 (setq ps-build-face-reference nil))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3370
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3371 (defun ps-mapper (extent list)
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3372 (nconc list (list (list (extent-start-position extent) 'push extent)
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3373 (list (extent-end-position extent) 'pull extent)))
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3374 nil)
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3375
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3376 (defun ps-extent-sorter (a b)
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3377 (< (extent-priority a) (extent-priority b)))
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3378
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3379 (defun ps-print-ensure-fontified (start end)
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3380 (if (and (boundp 'lazy-lock-mode) lazy-lock-mode)
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3381 (if (fboundp 'lazy-lock-fontify-region)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3382 (lazy-lock-fontify-region start end) ; the new
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3383 (lazy-lock-fontify-buffer)))) ; the old
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3384
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3385 (defun ps-generate-postscript-with-faces (from to)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3386 ;; Some initialization...
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3387 (setq ps-current-effect 0)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3388
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3389 ;; Build the reference lists of faces if necessary.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3390 (if (or ps-always-build-face-reference
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3391 ps-build-face-reference)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3392 (progn
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3393 (message "Collecting face information...")
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3394 (ps-build-reference-face-lists)))
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3395 ;; Set the color scale. We do it here instead of in the defvar so
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3396 ;; that ps-print can be dumped into emacs. This expression can't be
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3397 ;; evaluated at dump-time because X isn't initialized.
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3398 (setq ps-print-color-scale
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3399 (if ps-print-color-p
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3400 (float (car (ps-color-values "white")))
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3401 1.0))
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3402 ;; Generate some PostScript.
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3403 (save-restriction
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3404 (narrow-to-region from to)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3405 (let ((face 'default)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3406 (position to))
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3407 (ps-print-ensure-fontified from to)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3408 (cond
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3409 ((or (eq ps-print-emacs-type 'lucid)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3410 (eq ps-print-emacs-type 'xemacs))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3411 ;; Build the list of extents...
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3412 (let ((a (cons 'dummy nil))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3413 record type extent extent-list)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3414 (map-extents 'ps-mapper nil from to a)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3415 (setq a (sort (cdr a) 'car-less-than-car))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3416
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3417 (setq extent-list nil)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3418
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3419 ;; Loop through the extents...
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3420 (while a
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3421 (setq record (car a))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3422
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3423 (setq position (car record))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3424 (setq record (cdr record))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3425
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3426 (setq type (car record))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3427 (setq record (cdr record))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3428
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3429 (setq extent (car record))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3430
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3431 ;; Plot up to this record.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3432 ;; XEmacs 19.12: for some reason, we're getting into a
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3433 ;; situation in which some of the records have
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3434 ;; positions less than 'from'. Since we've narrowed
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3435 ;; the buffer, this'll generate errors. This is a
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3436 ;; hack, but don't call ps-plot-with-face unless from >
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3437 ;; point-min.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3438 (if (and (>= from (point-min))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3439 (<= position (point-max)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3440 (ps-plot-with-face from position face))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3441
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3442 (cond
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3443 ((eq type 'push)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3444 (if (extent-face extent)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3445 (setq extent-list (sort (cons extent extent-list)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3446 'ps-extent-sorter))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3447
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3448 ((eq type 'pull)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3449 (setq extent-list (sort (delq extent extent-list)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3450 'ps-extent-sorter))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3451
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3452 (setq face
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3453 (if extent-list
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3454 (extent-face (car extent-list))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3455 'default))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3456
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3457 (setq from position)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3458 (setq a (cdr a)))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3459
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3460 ((eq ps-print-emacs-type 'emacs)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3461 (let ((property-change from)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3462 (overlay-change from))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3463 (while (< from to)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3464 (if (< property-change to) ; Don't search for property change
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3465 ; unless previous search succeeded.
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3466 (setq property-change
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3467 (next-property-change from nil to)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3468 (if (< overlay-change to) ; Don't search for overlay change
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3469 ; unless previous search succeeded.
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3470 (setq overlay-change
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3471 (min (next-overlay-change from) to)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3472 (setq position
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3473 (min property-change overlay-change))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3474 ;; The code below is not quite correct,
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3475 ;; because a non-nil overlay invisible property
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3476 ;; which is inactive according to the current value
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3477 ;; of buffer-invisibility-spec nonetheless overrides
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3478 ;; a face text property.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3479 (setq face
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3480 (cond ((let ((prop (get-text-property from 'invisible)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3481 ;; Decide whether this invisible property
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3482 ;; really makes the text invisible.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3483 (if (eq buffer-invisibility-spec t)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3484 (not (null prop))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3485 (or (memq prop buffer-invisibility-spec)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3486 (assq prop buffer-invisibility-spec))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3487 nil)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3488 ((get-text-property from 'face))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3489 (t 'default)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3490 (let ((overlays (overlays-at from))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3491 (face-priority -1)) ; text-property
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3492 (while overlays
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3493 (let* ((overlay (car overlays))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3494 (overlay-face (overlay-get overlay 'face))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3495 (overlay-invisible (overlay-get overlay 'invisible))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3496 (overlay-priority (or (overlay-get overlay
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3497 'priority)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3498 0)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3499 (if (and (or overlay-invisible overlay-face)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3500 (> overlay-priority face-priority))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3501 (setq face (cond ((if (eq buffer-invisibility-spec t)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3502 (not (null overlay-invisible))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3503 (or (memq overlay-invisible
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3504 buffer-invisibility-spec)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3505 (assq overlay-invisible
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3506 buffer-invisibility-spec)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3507 nil)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3508 ((and face overlay-face)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3509 face-priority overlay-priority)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3510 (setq overlays (cdr overlays))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3511 ;; Plot up to this record.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3512 (ps-plot-with-face from position face)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3513 (setq from position)))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3514 (ps-plot-with-face from to face))))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3515
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3516 (defun ps-generate-postscript (from to)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3517 (ps-plot-region from to 0 nil))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3518
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3519 (defun ps-generate (buffer from to genfunc)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3520 (save-excursion
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3521 (let ((from (min to from))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3522 (to (max to from))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3523 ;; This avoids trouble if chars with read-only properties
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3524 ;; are copied into ps-spool-buffer.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3525 (inhibit-read-only t))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3526 (save-restriction
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3527 (narrow-to-region from to)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3528 (if ps-razzle-dazzle
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3529 (message "Formatting...%3d%%" (setq ps-razchunk 0)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3530 (set-buffer buffer)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3531 (setq ps-source-buffer buffer)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3532 (setq ps-spool-buffer (get-buffer-create ps-spool-buffer-name))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3533 (ps-init-output-queue)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3534 (let (safe-marker completed-safely needs-begin-file)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3535 (unwind-protect
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3536 (progn
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3537 (set-buffer ps-spool-buffer)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3538
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3539 ;; Get a marker and make it point to the current end of the
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3540 ;; buffer, If an error occurs, we'll delete everything from
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3541 ;; the end of this marker onwards.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3542 (setq safe-marker (make-marker))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3543 (set-marker safe-marker (point-max))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3544
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3545 (goto-char (point-min))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3546 (if (looking-at (regexp-quote ps-adobe-tag))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3547 nil
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3548 (setq needs-begin-file t))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3549 (save-excursion
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3550 (set-buffer ps-source-buffer)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3551 (if needs-begin-file (ps-begin-file))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3552 (ps-begin-job)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3553 (ps-begin-page))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3554 (set-buffer ps-source-buffer)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3555 (funcall genfunc from to)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3556 (ps-end-page)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3557
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3558 (if (and ps-spool-duplex
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3559 (= (mod ps-page-count 2) 1))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3560 (ps-dummy-page))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3561 (ps-flush-output)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3562
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3563 ;; Back to the PS output buffer to set the page count
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3564 (set-buffer ps-spool-buffer)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3565 (goto-char (point-max))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3566 (while (re-search-backward "^/PageCount 0 def$" nil t)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3567 (replace-match (format "/PageCount %d def" ps-page-count) t))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3568
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3569 ;; Setting this variable tells the unwind form that the
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3570 ;; the postscript was generated without error.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3571 (setq completed-safely t))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3572
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3573 ;; Unwind form: If some bad mojo occurred while generating
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3574 ;; postscript, delete all the postscript that was generated.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3575 ;; This protects the previously spooled files from getting
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3576 ;; corrupted.
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3577 (if (and (markerp safe-marker) (not completed-safely))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3578 (progn
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3579 (set-buffer ps-spool-buffer)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3580 (delete-region (marker-position safe-marker) (point-max))))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3581
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3582 (if ps-razzle-dazzle
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3583 (message "Formatting...done"))))))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3584
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3585 (defun ps-do-despool (filename)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3586 (if (or (not (boundp 'ps-spool-buffer))
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3587 (not (symbol-value 'ps-spool-buffer)))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3588 (message "No spooled PostScript to print")
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3589 (ps-end-file)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3590 (ps-flush-output)
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3591 (if filename
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3592 (save-excursion
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3593 (if ps-razzle-dazzle
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3594 (message "Saving..."))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3595 (set-buffer ps-spool-buffer)
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3596 (setq filename (expand-file-name filename))
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3597 (write-region (point-min) (point-max) filename)
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3598 (if ps-razzle-dazzle
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3599 (message "Wrote %s" filename)))
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3600 ;; Else, spool to the printer
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3601 (if ps-razzle-dazzle
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3602 (message "Printing..."))
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3603 (save-excursion
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3604 (set-buffer ps-spool-buffer)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3605 (if (and (eq system-type 'ms-dos)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3606 (stringp (symbol-value 'dos-ps-printer)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3607 (write-region (point-min) (point-max)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3608 (symbol-value 'dos-ps-printer) t 0)
14190
395b22713872 (ps-do-despool): On MS-DOS, allow both the usual and
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
3609 (let ((binary-process-input t)) ; for MS-DOS
395b22713872 (ps-do-despool): On MS-DOS, allow both the usual and
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
3610 (apply 'call-process-region
395b22713872 (ps-do-despool): On MS-DOS, allow both the usual and
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
3611 (point-min) (point-max) ps-lpr-command nil
395b22713872 (ps-do-despool): On MS-DOS, allow both the usual and
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
3612 (if (fboundp 'start-process) 0 nil)
395b22713872 (ps-do-despool): On MS-DOS, allow both the usual and
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
3613 nil
395b22713872 (ps-do-despool): On MS-DOS, allow both the usual and
Richard M. Stallman <rms@gnu.org>
parents: 14169
diff changeset
3614 ps-lpr-switches))))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3615 (if ps-razzle-dazzle
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3616 (message "Printing...done")))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3617 (kill-buffer ps-spool-buffer)))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3618
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3619 (defun ps-kill-emacs-check ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3620 (let (ps-buffer)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3621 (if (and (setq ps-buffer (get-buffer ps-spool-buffer-name))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3622 (buffer-modified-p ps-buffer))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3623 (if (y-or-n-p "Unprinted PostScript waiting; print now? ")
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3624 (ps-despool)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3625 (if (and (setq ps-buffer (get-buffer ps-spool-buffer-name))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3626 (buffer-modified-p ps-buffer))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3627 (if (yes-or-no-p "Unprinted PostScript waiting; exit anyway? ")
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3628 nil
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3629 (error "Unprinted PostScript")))))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3630
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3631 (if (fboundp 'add-hook)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3632 (funcall 'add-hook 'kill-emacs-hook 'ps-kill-emacs-check)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3633 (if kill-emacs-hook
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3634 (message "Won't override existing kill-emacs-hook")
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3635 (setq kill-emacs-hook 'ps-kill-emacs-check)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3636
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3637 ;;; Sample Setup Code:
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3638
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3639 ;; This stuff is for anybody that's brave enough to look this far,
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3640 ;; and able to figure out how to use it. It isn't really part of
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3641 ;; ps-print, but I'll leave it here in hopes it might be useful:
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3642
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3643 ;; WARNING!!! The following code is *sample* code only. Don't use it
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3644 ;; unless you understand what it does!
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3645
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3646 (defmacro ps-prsc ()
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3647 `(if (eq ps-print-emacs-type 'emacs) [f22] 'f22))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3648 (defmacro ps-c-prsc ()
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3649 `(if (eq ps-print-emacs-type 'emacs) [C-f22] '(control f22)))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3650 (defmacro ps-s-prsc ()
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3651 `(if (eq ps-print-emacs-type 'emacs) [S-f22] '(shift f22)))
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3652
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3653 ;; Look in an article or mail message for the Subject: line. To be
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3654 ;; placed in `ps-left-headers'.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3655 (defun ps-article-subject ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3656 (save-excursion
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3657 (goto-char (point-min))
15620
7844c0f756d0 (ps-article-subject): Don't die if no subject header.
Karl Heuer <kwzh@gnu.org>
parents: 15163
diff changeset
3658 (if (re-search-forward "^Subject:[ \t]+\\(.*\\)$" nil t)
17588
0054114145ca change all buffer-substring to buffer-substring-no-properties.
Simon Marshall <simon@gnu.org>
parents: 17440
diff changeset
3659 (buffer-substring-no-properties (match-beginning 1) (match-end 1))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3660 "Subject ???")))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3661
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3662 ;; Look in an article or mail message for the From: line. Sorta-kinda
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3663 ;; understands RFC-822 addresses and can pull the real name out where
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3664 ;; it's provided. To be placed in `ps-left-headers'.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3665 (defun ps-article-author ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3666 (save-excursion
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3667 (goto-char (point-min))
15621
6be6d1990543 (ps-article-author, ps-info-file, ps-info-node): Don't die if header is missing.
Karl Heuer <kwzh@gnu.org>
parents: 15620
diff changeset
3668 (if (re-search-forward "^From:[ \t]+\\(.*\\)$" nil t)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3669 (let ((fromstring (buffer-substring-no-properties (match-beginning 1)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3670 (match-end 1))))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3671 (cond
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3672
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3673 ;; Try first to match addresses that look like
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3674 ;; thompson@wg2.waii.com (Jim Thompson)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3675 ((string-match ".*[ \t]+(\\(.*\\))" fromstring)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3676 (substring fromstring (match-beginning 1) (match-end 1)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3677
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3678 ;; Next try to match addresses that look like
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3679 ;; Jim Thompson <thompson@wg2.waii.com>
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3680 ((string-match "\\(.*\\)[ \t]+<.*>" fromstring)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3681 (substring fromstring (match-beginning 1) (match-end 1)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3682
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3683 ;; Couldn't find a real name -- show the address instead.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3684 (t fromstring)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3685 "From ???")))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3686
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3687 ;; A hook to bind to gnus-Article-prepare-hook. This will set the
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3688 ;; `ps-left-headers' specially for gnus articles. Unfortunately,
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3689 ;; `gnus-article-mode-hook' is called only once, the first time the *Article*
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3690 ;; buffer enters that mode, so it would only work for the first time
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3691 ;; we ran gnus. The second time, this hook wouldn't get set up. The
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3692 ;; only alternative is `gnus-article-prepare-hook'.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3693 (defun ps-gnus-article-prepare-hook ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3694 (setq ps-header-lines 3)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3695 (setq ps-left-header
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3696 ;; The left headers will display the article's subject, its
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3697 ;; author, and the newsgroup it was in.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3698 (list 'ps-article-subject 'ps-article-author 'gnus-newsgroup-name)))
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3699
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3700 ;; A hook to bind to vm-mode-hook to locally bind prsc and set the
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3701 ;; ps-left-headers specially for mail messages. This header setup would
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3702 ;; also work, I think, for RMAIL.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3703 (defun ps-vm-mode-hook ()
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3704 (local-set-key (ps-prsc) 'ps-vm-print-message-from-summary)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3705 (setq ps-header-lines 3)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3706 (setq ps-left-header
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3707 ;; The left headers will display the message's subject, its
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3708 ;; author, and the name of the folder it was in.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3709 (list 'ps-article-subject 'ps-article-author 'buffer-name)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3710
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3711 ;; Every now and then I forget to switch from the *Summary* buffer to
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3712 ;; the *Article* before hitting prsc, and a nicely formatted list of
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3713 ;; article subjects shows up at the printer. This function, bound to
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3714 ;; prsc for the gnus *Summary* buffer means I don't have to switch
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3715 ;; buffers first.
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3716 ;; sb: Updated for Gnus 5.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3717 (defun ps-gnus-print-article-from-summary ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3718 (interactive)
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3719 (let ((ps-buf (or (and (boundp 'gnus-article-buffer)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3720 (symbol-value 'gnus-article-buffer))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3721 "*Article*")))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3722 (if (get-buffer ps-buf)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3723 (save-excursion
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3724 (set-buffer ps-buf)
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3725 (ps-spool-buffer-with-faces)))))
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3726
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3727 ;; See `ps-gnus-print-article-from-summary'. This function does the
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3728 ;; same thing for vm.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3729 (defun ps-vm-print-message-from-summary ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3730 (interactive)
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3731 (if (and (boundp 'vm-mail-buffer) (symbol-value 'vm-mail-buffer))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3732 (save-excursion
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3733 (set-buffer (symbol-value 'vm-mail-buffer))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3734 (ps-spool-buffer-with-faces))))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3735
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3736 ;; A hook to bind to bind to `gnus-summary-setup-buffer' to locally bind
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3737 ;; prsc.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3738 (defun ps-gnus-summary-setup ()
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3739 (local-set-key (ps-prsc) 'ps-gnus-print-article-from-summary))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3740
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3741 ;; Look in an article or mail message for the Subject: line. To be
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3742 ;; placed in `ps-left-headers'.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3743 (defun ps-info-file ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3744 (save-excursion
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3745 (goto-char (point-min))
15621
6be6d1990543 (ps-article-author, ps-info-file, ps-info-node): Don't die if header is missing.
Karl Heuer <kwzh@gnu.org>
parents: 15620
diff changeset
3746 (if (re-search-forward "File:[ \t]+\\([^, \t\n]*\\)" nil t)
17588
0054114145ca change all buffer-substring to buffer-substring-no-properties.
Simon Marshall <simon@gnu.org>
parents: 17440
diff changeset
3747 (buffer-substring-no-properties (match-beginning 1) (match-end 1))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3748 "File ???")))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3749
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3750 ;; Look in an article or mail message for the Subject: line. To be
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3751 ;; placed in `ps-left-headers'.
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3752 (defun ps-info-node ()
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3753 (save-excursion
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3754 (goto-char (point-min))
15621
6be6d1990543 (ps-article-author, ps-info-file, ps-info-node): Don't die if header is missing.
Karl Heuer <kwzh@gnu.org>
parents: 15620
diff changeset
3755 (if (re-search-forward "Node:[ \t]+\\([^,\t\n]*\\)" nil t)
17588
0054114145ca change all buffer-substring to buffer-substring-no-properties.
Simon Marshall <simon@gnu.org>
parents: 17440
diff changeset
3756 (buffer-substring-no-properties (match-beginning 1) (match-end 1))
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3757 "Node ???")))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3758
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3759 (defun ps-info-mode-hook ()
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3760 (setq ps-left-header
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3761 ;; The left headers will display the node name and file name.
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3762 (list 'ps-info-node 'ps-info-file)))
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3763
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3764 ;; WARNING! The following function is a *sample* only, and is *not*
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3765 ;; meant to be used as a whole unless you understand what the effects
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3766 ;; will be! (In fact, this is a copy of Jim's setup for ps-print --
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3767 ;; I'd be very surprised if it was useful to *anybody*, without
11799
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3768 ;; modification.)
4a04c7799790 Miscellaneous fixes for better compatibility with
Karl Heuer <kwzh@gnu.org>
parents: 10738
diff changeset
3769
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3770 (defun ps-jts-ps-setup ()
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3771 (global-set-key (ps-prsc) 'ps-spool-buffer-with-faces) ;f22 is prsc
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3772 (global-set-key (ps-s-prsc) 'ps-spool-region-with-faces)
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3773 (global-set-key (ps-c-prsc) 'ps-despool)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3774 (add-hook 'gnus-article-prepare-hook 'ps-gnus-article-prepare-hook)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3775 (add-hook 'gnus-summary-mode-hook 'ps-gnus-summary-setup)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3776 (add-hook 'vm-mode-hook 'ps-vm-mode-hook)
10683
64e6021d0ba0 Various changes.
Richard M. Stallman <rms@gnu.org>
parents: 10493
diff changeset
3777 (add-hook 'vm-mode-hooks 'ps-vm-mode-hook)
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3778 (add-hook 'Info-mode-hook 'ps-info-mode-hook)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3779 (setq ps-spool-duplex t)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3780 (setq ps-print-color-p nil)
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3781 (setq ps-lpr-command "lpr")
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3782 (setq ps-lpr-switches '("-Jjct,duplex_long"))
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3783 'ps-jts-ps-setup)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3784
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3785 ;; WARNING! The following function is a *sample* only, and is *not*
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3786 ;; meant to be used as a whole unless it corresponds to your needs.
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3787 ;; (In fact, this is a copy of Jack's setup for ps-print --
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3788 ;; I would not be that surprised if it was useful to *anybody*,
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3789 ;; without modification.)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3790
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3791 (defun ps-jack-setup ()
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3792 (setq ps-print-color-p nil
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3793 ps-lpr-command "lpr"
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3794 ps-lpr-switches (list)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3795
19445
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3796 ps-paper-type 'a4
94a54fbffb3e A lot of comment and doc fixes.
Richard M. Stallman <rms@gnu.org>
parents: 19011
diff changeset
3797 ps-landscape-mode t
16361
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3798 ps-number-of-columns 2
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3799
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3800 ps-left-margin (/ (* 72 1.0) 2.54) ; 1.0 cm
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3801 ps-right-margin (/ (* 72 1.0) 2.54) ; 1.0 cm
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3802 ps-inter-column (/ (* 72 1.0) 2.54) ; 1.0 cm
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3803 ps-bottom-margin (/ (* 72 1.5) 2.54) ; 1.5 cm
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3804 ps-top-margin (/ (* 72 1.5) 2.54) ; 1.5 cm
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3805 ps-header-offset (/ (* 72 1.0) 2.54) ; 1.0 cm
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3806 ps-header-line-pad .15
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3807 ps-print-header t
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3808 ps-print-header-frame t
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3809 ps-header-lines 2
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3810 ps-show-n-of-n t
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3811 ps-spool-duplex nil
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3812
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3813 ps-font-family 'Courier
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3814 ps-font-size 5.5
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3815 ps-header-font-family 'Helvetica
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3816 ps-header-font-size 6
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3817 ps-header-title-font-size 8)
032601b9959b (ps-print-prologue-1): Fix bug in postscript comment lines.
Richard M. Stallman <rms@gnu.org>
parents: 16186
diff changeset
3818 'ps-jack-setup)
7257
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3819
3759ad84023b Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3820 (provide 'ps-print)
10738
e7d5b119b583 (ps-print-version): Add caveat about version number.
Richard M. Stallman <rms@gnu.org>
parents: 10683
diff changeset
3821
10492
a0f38717d82d *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 7257
diff changeset
3822 ;;; ps-print.el ends here