Mercurial > emacs
comparison lisp/ps-print.el @ 85711:b6f5dc84b2e1
Detect if text foreground and background are equals
author | Vinicius Jose Latorre <viniciusjl@ig.com.br> |
---|---|
date | Sun, 28 Oct 2007 04:58:17 +0000 |
parents | f873840f9fea |
children | 29e75576e47f |
comparison
equal
deleted
inserted
replaced
85710:beb909dfc54d | 85711:b6f5dc84b2e1 |
---|---|
8 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br> | 8 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br> |
9 ;; Kenichi Handa <handa@m17n.org> (multi-byte characters) | 9 ;; Kenichi Handa <handa@m17n.org> (multi-byte characters) |
10 ;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters) | 10 ;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters) |
11 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br> | 11 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br> |
12 ;; Keywords: wp, print, PostScript | 12 ;; Keywords: wp, print, PostScript |
13 ;; Version: 6.7.6 | 13 ;; Version: 6.8 |
14 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre | 14 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre |
15 | 15 |
16 (defconst ps-print-version "6.7.6" | 16 (defconst ps-print-version "6.8" |
17 "ps-print.el, v 6.7.6 <2007/10/10 vinicius> | 17 "ps-print.el, v 6.8 <2007/10/26 vinicius> |
18 | 18 |
19 Vinicius's last change version -- this file may have been edited as part of | 19 Vinicius's last change version -- this file may have been edited as part of |
20 Emacs without changes to the version number. When reporting bugs, please also | 20 Emacs without changes to the version number. When reporting bugs, please also |
21 report the version of Emacs, if any, that ps-print was distributed with. | 21 report the version of Emacs, if any, that ps-print was distributed with. |
22 | 22 |
1087 ;; On black/white printers, colors are displayed in gray scale. | 1087 ;; On black/white printers, colors are displayed in gray scale. |
1088 ;; To turn off color output, set `ps-print-color-p' to nil. | 1088 ;; To turn off color output, set `ps-print-color-p' to nil. |
1089 ;; You can also set `ps-print-color-p' to 'black-white to have a better looking | 1089 ;; You can also set `ps-print-color-p' to 'black-white to have a better looking |
1090 ;; on black/white printers. See also `ps-black-white-faces' for documentation. | 1090 ;; on black/white printers. See also `ps-black-white-faces' for documentation. |
1091 ;; | 1091 ;; |
1092 ;; ps-print also detects if the text foreground and background colors are | |
1093 ;; equals when `ps-fg-validate-p' is non-nil. In this case, if these colors | |
1094 ;; are used, no text will appear. You can use `ps-fg-list' to give a list of | |
1095 ;; foreground colors to be used when text foreground and background colors are | |
1096 ;; equals. It'll be used the first foreground color in `ps-fg-list' which is | |
1097 ;; different from the background color. If `ps-fg-list' is nil, the default | |
1098 ;; foreground color is used. | |
1099 ;; | |
1092 ;; | 1100 ;; |
1093 ;; How Ps-Print Maps Faces | 1101 ;; How Ps-Print Maps Faces |
1094 ;; ----------------------- | 1102 ;; ----------------------- |
1095 ;; | 1103 ;; |
1096 ;; As ps-print uses PostScript to print buffers, it is possible to have other | 1104 ;; As ps-print uses PostScript to print buffers, it is possible to have other |
1210 ;; New since version 2.8 | 1218 ;; New since version 2.8 |
1211 ;; --------------------- | 1219 ;; --------------------- |
1212 ;; | 1220 ;; |
1213 ;; [vinicius] Vinicius Jose Latorre <viniciusjl@ig.com.br> | 1221 ;; [vinicius] Vinicius Jose Latorre <viniciusjl@ig.com.br> |
1214 ;; | 1222 ;; |
1215 ;; 20040229 | 1223 ;; 2007-10-27 |
1224 ;; `ps-fg-validate-p', `ps-fg-list' | |
1225 ;; | |
1226 ;; 2004-02-29 | |
1216 ;; `ps-time-stamp-yyyy-mm-dd', `ps-time-stamp-iso8601' | 1227 ;; `ps-time-stamp-yyyy-mm-dd', `ps-time-stamp-iso8601' |
1217 ;; | 1228 ;; |
1218 ;; 20010619 | 1229 ;; 2001-06-19 |
1219 ;; `ps-time-stamp-locale-default' | 1230 ;; `ps-time-stamp-locale-default' |
1220 ;; | 1231 ;; |
1221 ;; 20010530 | 1232 ;; 2001-05-30 |
1222 ;; Handle before-string and after-string overlay properties. | 1233 ;; Handle before-string and after-string overlay properties. |
1223 ;; | 1234 ;; |
1224 ;; 20010407 | 1235 ;; 2001-04-07 |
1225 ;; `ps-line-number-color', `ps-print-footer', `ps-footer-offset', | 1236 ;; `ps-line-number-color', `ps-print-footer', `ps-footer-offset', |
1226 ;; `ps-print-footer-frame', `ps-footer-font-family', | 1237 ;; `ps-print-footer-frame', `ps-footer-font-family', |
1227 ;; `ps-footer-font-size', `ps-footer-line-pad', `ps-footer-lines', | 1238 ;; `ps-footer-font-size', `ps-footer-line-pad', `ps-footer-lines', |
1228 ;; `ps-left-footer', `ps-right-footer', `ps-footer-frame-alist' and | 1239 ;; `ps-left-footer', `ps-right-footer', `ps-footer-frame-alist' and |
1229 ;; `ps-header-frame-alist'. | 1240 ;; `ps-header-frame-alist'. |
1230 ;; | 1241 ;; |
1231 ;; 20010328 | 1242 ;; 2001-03-28 |
1232 ;; `ps-line-spacing', `ps-paragraph-spacing', `ps-paragraph-regexp', | 1243 ;; `ps-line-spacing', `ps-paragraph-spacing', `ps-paragraph-regexp', |
1233 ;; `ps-begin-cut-regexp' and `ps-end-cut-regexp'. | 1244 ;; `ps-begin-cut-regexp' and `ps-end-cut-regexp'. |
1234 ;; | 1245 ;; |
1235 ;; 20001122 | 1246 ;; 2000-11-22 |
1236 ;; `ps-line-number-font', `ps-line-number-font-size' and | 1247 ;; `ps-line-number-font', `ps-line-number-font-size' and |
1237 ;; `ps-end-with-control-d'. | 1248 ;; `ps-end-with-control-d'. |
1238 ;; | 1249 ;; |
1239 ;; 20000821 | 1250 ;; 2000-08-21 |
1240 ;; `ps-even-or-odd-pages' | 1251 ;; `ps-even-or-odd-pages' |
1241 ;; | 1252 ;; |
1242 ;; 20000617 | 1253 ;; 2000-06-17 |
1243 ;; `ps-manual-feed', `ps-warn-paper-type', `ps-print-upside-down', | 1254 ;; `ps-manual-feed', `ps-warn-paper-type', `ps-print-upside-down', |
1244 ;; `ps-selected-pages', `ps-last-selected-pages', | 1255 ;; `ps-selected-pages', `ps-last-selected-pages', |
1245 ;; `ps-restore-selected-pages', `ps-switch-header', | 1256 ;; `ps-restore-selected-pages', `ps-switch-header', |
1246 ;; `ps-line-number-step', `ps-line-number-start', | 1257 ;; `ps-line-number-step', `ps-line-number-start', |
1247 ;; `ps-zebra-stripe-follow' and `ps-use-face-background'. | 1258 ;; `ps-zebra-stripe-follow' and `ps-use-face-background'. |
1248 ;; | 1259 ;; |
1249 ;; 20000310 | 1260 ;; 2000-03-10 |
1250 ;; PostScript error handler. | 1261 ;; PostScript error handler. |
1251 ;; `ps-user-defined-prologue' and `ps-error-handler-message'. | 1262 ;; `ps-user-defined-prologue' and `ps-error-handler-message'. |
1252 ;; | 1263 ;; |
1253 ;; 19991211 | 1264 ;; 1999-12-11 |
1254 ;; `ps-print-customize'. | 1265 ;; `ps-print-customize'. |
1255 ;; | 1266 ;; |
1256 ;; 19990703 | 1267 ;; 1999-07-03 |
1257 ;; Better customization. | 1268 ;; Better customization. |
1258 ;; `ps-banner-page-when-duplexing' and `ps-zebra-color'. | 1269 ;; `ps-banner-page-when-duplexing' and `ps-zebra-color'. |
1259 ;; | 1270 ;; |
1260 ;; 19990513 | 1271 ;; 1999-05-13 |
1261 ;; N-up printing. | 1272 ;; N-up printing. |
1262 ;; Hook: `ps-print-begin-sheet-hook'. | 1273 ;; Hook: `ps-print-begin-sheet-hook'. |
1263 ;; | 1274 ;; |
1264 ;; [kenichi] 19990509 Ken'ichi Handa <handa@m17n.org> | 1275 ;; [kenichi] 1999-05-09 Ken'ichi Handa <handa@m17n.org> |
1265 ;; | 1276 ;; |
1266 ;; `ps-print-region-function' | 1277 ;; `ps-print-region-function' |
1267 ;; | 1278 ;; |
1268 ;; [vinicius] Vinicius Jose Latorre <viniciusjl@ig.com.br> | 1279 ;; [vinicius] Vinicius Jose Latorre <viniciusjl@ig.com.br> |
1269 ;; | 1280 ;; |
1270 ;; 19990301 | 1281 ;; 1999-03-01 |
1271 ;; PostScript tumble and setpagedevice. | 1282 ;; PostScript tumble and setpagedevice. |
1272 ;; | 1283 ;; |
1273 ;; 19980922 | 1284 ;; 1998-09-22 |
1274 ;; PostScript prologue header comment insertion. | 1285 ;; PostScript prologue header comment insertion. |
1275 ;; Skip invisible text better. | 1286 ;; Skip invisible text better. |
1276 ;; | 1287 ;; |
1277 ;; [kenichi] 19980819 Ken'ichi Handa <handa@m17n.org> | 1288 ;; [kenichi] 1998-08-19 Ken'ichi Handa <handa@m17n.org> |
1278 ;; | 1289 ;; |
1279 ;; Multi-byte buffer handling. | 1290 ;; Multi-byte buffer handling. |
1280 ;; | 1291 ;; |
1281 ;; [vinicius] Vinicius Jose Latorre <viniciusjl@ig.com.br> | 1292 ;; [vinicius] Vinicius Jose Latorre <viniciusjl@ig.com.br> |
1282 ;; | 1293 ;; |
1283 ;; 19980306 | 1294 ;; 1998-03-06 |
1284 ;; Skip invisible text. | 1295 ;; Skip invisible text. |
1285 ;; | 1296 ;; |
1286 ;; 19971130 | 1297 ;; 1997-11-30 |
1287 ;; Hooks: `ps-print-hook', `ps-print-begin-page-hook' and | 1298 ;; Hooks: `ps-print-hook', `ps-print-begin-page-hook' and |
1288 ;; `ps-print-begin-column-hook'. | 1299 ;; `ps-print-begin-column-hook'. |
1289 ;; Put one header per page over the columns. | 1300 ;; Put one header per page over the columns. |
1290 ;; Better database font management. | 1301 ;; Better database font management. |
1291 ;; Better control characters handling. | 1302 ;; Better control characters handling. |
1292 ;; | 1303 ;; |
1293 ;; 19971121 | 1304 ;; 1997-11-21 |
1294 ;; Dynamic evaluation at print time of `ps-lpr-switches'. | 1305 ;; Dynamic evaluation at print time of `ps-lpr-switches'. |
1295 ;; Handle control characters. | 1306 ;; Handle control characters. |
1296 ;; Face remapping. | 1307 ;; Face remapping. |
1297 ;; New face attributes. | 1308 ;; New face attributes. |
1298 ;; Line number. | 1309 ;; Line number. |
1299 ;; Zebra stripes. | 1310 ;; Zebra stripes. |
1300 ;; Text and/or image on background. | 1311 ;; Text and/or image on background. |
1301 ;; | 1312 ;; |
1302 ;; [jack] 19960517 Jacques Duthen <duthen@cegelec-red.fr> | 1313 ;; [jack] 1996-05-17 Jacques Duthen <duthen@cegelec-red.fr> |
1303 ;; | 1314 ;; |
1304 ;; Font family and float size for text and header. | 1315 ;; Font family and float size for text and header. |
1305 ;; Landscape mode. | 1316 ;; Landscape mode. |
1306 ;; Multiple columns. | 1317 ;; Multiple columns. |
1307 ;; Tools for page setup. | 1318 ;; Tools for page setup. |
1308 ;; | 1319 ;; |
1309 ;; | 1320 ;; |
1310 ;; Known bugs and limitations of ps-print | 1321 ;; Known bugs and limitations of ps-print |
1311 ;; -------------------------------------- | 1322 ;; -------------------------------------- |
1312 ;; | 1323 ;; |
1341 ;; | 1352 ;; |
1342 ;; Things to change | 1353 ;; Things to change |
1343 ;; ---------------- | 1354 ;; ---------------- |
1344 ;; | 1355 ;; |
1345 ;; Avoid page break inside a paragraph. | 1356 ;; Avoid page break inside a paragraph. |
1357 ;; | |
1346 ;; Add `ps-non-bold-faces' and `ps-non-italic-faces' (should be easy). | 1358 ;; Add `ps-non-bold-faces' and `ps-non-italic-faces' (should be easy). |
1359 ;; | |
1347 ;; Improve the memory management for big files (hard?). | 1360 ;; Improve the memory management for big files (hard?). |
1361 ;; | |
1348 ;; `ps-nb-pages-buffer' and `ps-nb-pages-region' should take care of folding | 1362 ;; `ps-nb-pages-buffer' and `ps-nb-pages-region' should take care of folding |
1349 ;; lines. | 1363 ;; lines. |
1350 ;; | 1364 ;; |
1351 ;; | 1365 ;; |
1352 ;; Acknowledgments | 1366 ;; Acknowledgments |
3012 \"yellow\". | 3026 \"yellow\". |
3013 | 3027 |
3014 LIST It's a list of RGB values, that is a list of three real values | 3028 LIST It's a list of RGB values, that is a list of three real values |
3015 of the form: | 3029 of the form: |
3016 | 3030 |
3017 (RED, GREEN, BLUE) | 3031 (RED GREEN BLUE) |
3018 | 3032 |
3019 Where RED, GREEN and BLUE are reals between 0.0 (no color) and | 3033 Where RED, GREEN and BLUE are reals between 0.0 (no color) and |
3020 1.0 (full color). | 3034 1.0 (full color). |
3021 | 3035 |
3022 Any other value is ignored and black color will be used. | 3036 Any other value is ignored and black color will be used. |
3056 \"yellow\". | 3070 \"yellow\". |
3057 | 3071 |
3058 LIST It's a list of RGB values, that is a list of three real values | 3072 LIST It's a list of RGB values, that is a list of three real values |
3059 of the form: | 3073 of the form: |
3060 | 3074 |
3061 (RED, GREEN, BLUE) | 3075 (RED GREEN BLUE) |
3062 | 3076 |
3063 Where RED, GREEN and BLUE are reals between 0.0 (no color) and | 3077 Where RED, GREEN and BLUE are reals between 0.0 (no color) and |
3064 1.0 (full color). | 3078 1.0 (full color). |
3065 | 3079 |
3066 Any other value is ignored and white color will be used. | 3080 Any other value is ignored and white color will be used. |
3078 (list :tag "RGB Color" :value (1.0 1.0 1.0) | 3092 (list :tag "RGB Color" :value (1.0 1.0 1.0) |
3079 (number :tag "Red") | 3093 (number :tag "Red") |
3080 (number :tag "Green") | 3094 (number :tag "Green") |
3081 (number :tag "Blue"))) | 3095 (number :tag "Blue"))) |
3082 :version "20" | 3096 :version "20" |
3097 :group 'ps-print-color) | |
3098 | |
3099 (defcustom ps-fg-list nil | |
3100 "*Specify foreground color list. | |
3101 | |
3102 This list is used to chose a text foreground color which is different than the | |
3103 background color. It'll be used the first foreground color in `ps-fg-list' | |
3104 which is different from the background color. | |
3105 | |
3106 If this list is nil, the default foreground color is used. See | |
3107 `ps-default-fg'. | |
3108 | |
3109 The list element valid values are: | |
3110 | |
3111 NUMBER It's a real value between 0.0 (black) and 1.0 (white) that | |
3112 indicate the gray color. | |
3113 | |
3114 COLOR-NAME It's a string which contains the color name. For example: | |
3115 \"yellow\". | |
3116 | |
3117 LIST It's a list of RGB values, that is a list of three real values | |
3118 of the form: | |
3119 | |
3120 (RED GREEN BLUE) | |
3121 | |
3122 Where RED, GREEN and BLUE are reals between 0.0 (no color) and | |
3123 1.0 (full color). | |
3124 | |
3125 Any other value is ignored and black color will be used. | |
3126 | |
3127 This variable is used only when `ps-fg-validate-p' (which see) is non-nil and | |
3128 when `ps-print-color-p' (which see) is neither nil nor black-white." | |
3129 :type '(repeat | |
3130 (choice :menu-tag "Foreground Gray/Color" | |
3131 :tag "Foreground Gray/Color" | |
3132 (number :tag "Gray Scale" :value 0.0) | |
3133 (string :tag "Color Name" :value "black") | |
3134 (list :tag "RGB Color" :value (0.0 0.0 0.0) | |
3135 (number :tag "Red") | |
3136 (number :tag "Green") | |
3137 (number :tag "Blue")))) | |
3138 :version "22" | |
3139 :group 'ps-print-color) | |
3140 | |
3141 (defcustom ps-fg-validate-p t | |
3142 "*Non-nil means validate if foreground color is different than background. | |
3143 | |
3144 If text foreground and background colors are equals, no text will appear. | |
3145 | |
3146 See also `ps-fg-list'." | |
3147 :type 'boolean | |
3148 :version "22" | |
3083 :group 'ps-print-color) | 3149 :group 'ps-print-color) |
3084 | 3150 |
3085 (defcustom ps-auto-font-detect t | 3151 (defcustom ps-auto-font-detect t |
3086 "*Non-nil means automatically detect bold/italic/underline face attributes. | 3152 "*Non-nil means automatically detect bold/italic/underline face attributes. |
3087 If nil, we rely solely on the lists `ps-bold-faces', `ps-italic-faces', and | 3153 If nil, we rely solely on the lists `ps-bold-faces', `ps-italic-faces', and |
3344 :group 'ps-print-headers) | 3410 :group 'ps-print-headers) |
3345 | 3411 |
3346 (defcustom ps-postscript-code-directory | 3412 (defcustom ps-postscript-code-directory |
3347 (or (if (featurep 'xemacs) | 3413 (or (if (featurep 'xemacs) |
3348 (cond ((fboundp 'locate-data-directory) ; XEmacs | 3414 (cond ((fboundp 'locate-data-directory) ; XEmacs |
3349 (locate-data-directory "ps-print")) | 3415 (funcall 'locate-data-directory "ps-print")) |
3350 ((boundp 'data-directory) ; XEmacs | 3416 ((boundp 'data-directory) ; XEmacs |
3351 data-directory) | 3417 (symbol-value 'data-directory)) |
3352 (t ; don't know what to do | 3418 (t ; don't know what to do |
3353 nil)) | 3419 nil)) |
3354 data-directory) ; Emacs | 3420 data-directory) ; Emacs |
3355 (error "`ps-postscript-code-directory' isn't set properly")) | 3421 (error "`ps-postscript-code-directory' isn't set properly")) |
3356 "*Directory where it's located the PostScript prologue file used by ps-print. | 3422 "*Directory where it's located the PostScript prologue file used by ps-print. |
3625 '(23 . ps-zebra-color) | 3691 '(23 . ps-zebra-color) |
3626 '(23 . ps-line-number) | 3692 '(23 . ps-line-number) |
3627 '(23 . ps-line-number-step) | 3693 '(23 . ps-line-number-step) |
3628 '(23 . ps-line-number-start) | 3694 '(23 . ps-line-number-start) |
3629 nil | 3695 nil |
3696 '(17 . ps-razzle-dazzle) | |
3697 '(17 . ps-default-bg) | |
3630 '(17 . ps-default-fg) | 3698 '(17 . ps-default-fg) |
3631 '(17 . ps-default-bg) | 3699 '(17 . ps-fg-validate-p) |
3632 '(17 . ps-razzle-dazzle) | 3700 '(17 . ps-fg-list) |
3633 nil | 3701 nil |
3634 '(23 . ps-use-face-background) | 3702 '(23 . ps-use-face-background) |
3635 nil | 3703 nil |
3636 '(28 . ps-print-control-characters) | 3704 '(28 . ps-print-control-characters) |
3637 nil | 3705 nil |
3707 '(20 . ps-bold-faces) | 3775 '(20 . ps-bold-faces) |
3708 '(20 . ps-italic-faces) | 3776 '(20 . ps-italic-faces) |
3709 '(20 . ps-underlined-faces) | 3777 '(20 . ps-underlined-faces) |
3710 '(20 . ps-black-white-faces) | 3778 '(20 . ps-black-white-faces) |
3711 " )\n | 3779 " )\n |
3712 ;; The following customized variables have long lists and are seldom modified: | 3780 \;; The following customized variables have long lists and are seldom modified: |
3713 ;; ps-page-dimensions-database | 3781 \;; ps-page-dimensions-database |
3714 ;; ps-font-info-database | 3782 \;; ps-font-info-database |
3715 | 3783 |
3716 \;;; ps-print - end of settings\n") | 3784 \;;; ps-print - end of settings\n") |
3717 "\n"))) | 3785 "\n"))) |
3718 | 3786 |
3719 | 3787 |
4018 (defvar ps-default-foreground nil) | 4086 (defvar ps-default-foreground nil) |
4019 (defvar ps-default-background nil) | 4087 (defvar ps-default-background nil) |
4020 (defvar ps-default-color nil) | 4088 (defvar ps-default-color nil) |
4021 (defvar ps-current-color nil) | 4089 (defvar ps-current-color nil) |
4022 (defvar ps-current-bg nil) | 4090 (defvar ps-current-bg nil) |
4091 (defvar ps-foreground-list nil) | |
4023 | 4092 |
4024 (defvar ps-zebra-stripe-full-p nil) | 4093 (defvar ps-zebra-stripe-full-p nil) |
4025 (defvar ps-razchunk 0) | 4094 (defvar ps-razchunk 0) |
4026 | 4095 |
4027 (defvar ps-color-p nil) | 4096 (defvar ps-color-p nil) |
5955 (ps-face-foreground-name 'default)) | 6024 (ps-face-foreground-name 'default)) |
5956 (t | 6025 (t |
5957 ps-default-fg)) | 6026 ps-default-fg)) |
5958 "unspecified-fg" | 6027 "unspecified-fg" |
5959 0.0) | 6028 0.0) |
6029 ps-foreground-list (mapcar | |
6030 #'(lambda (arg) | |
6031 (ps-rgb-color arg "unspecified-fg" 0.0)) | |
6032 (append (and (not (member ps-print-color-p | |
6033 '(nil back-white))) | |
6034 ps-fg-list) | |
6035 (list ps-default-foreground | |
6036 "black"))) | |
5960 ps-default-color (and (not (member ps-print-color-p | 6037 ps-default-color (and (not (member ps-print-color-p |
5961 '(nil back-white))) | 6038 '(nil back-white))) |
5962 ps-default-foreground) | 6039 ps-default-foreground) |
5963 ps-current-color ps-default-color) | 6040 ps-current-color ps-default-color) |
5964 ;; initialize page dimensions | 6041 ;; initialize page dimensions |
6198 | 6275 |
6199 (defun ps-plot-region (from to font &optional fg-color bg-color effects) | 6276 (defun ps-plot-region (from to font &optional fg-color bg-color effects) |
6200 (or (equal font ps-current-font) | 6277 (or (equal font ps-current-font) |
6201 (ps-set-font font)) | 6278 (ps-set-font font)) |
6202 | 6279 |
6203 ;; Specify a foreground color only if one's specified and it's | 6280 ;; Specify a foreground color only if: |
6204 ;; different than the current. | 6281 ;; one's specified, |
6282 ;; it's different than the background (if `ps-fg-validate-p' is non-nil) | |
6283 ;; and it's different than the current. | |
6205 (let ((fg (or fg-color ps-default-foreground))) | 6284 (let ((fg (or fg-color ps-default-foreground))) |
6285 (if ps-fg-validate-p | |
6286 (let ((bg (or bg-color ps-default-background)) | |
6287 (el ps-foreground-list)) | |
6288 (while (and el (equal fg bg)) | |
6289 (setq fg (car el) | |
6290 el (cdr el))))) | |
6206 (or (equal fg ps-current-color) | 6291 (or (equal fg ps-current-color) |
6207 (ps-set-color fg))) | 6292 (ps-set-color fg))) |
6208 | 6293 |
6209 (or (equal bg-color ps-current-bg) | 6294 (or (equal bg-color ps-current-bg) |
6210 (ps-set-bg bg-color)) | 6295 (ps-set-bg bg-color)) |
6211 | 6296 |
6212 ;; Specify effects (underline, overline, box, etc) | 6297 ;; Specify effects (underline, overline, box, etc.) |
6213 (cond | 6298 (cond |
6214 ((not (integerp effects)) | 6299 ((not (integerp effects)) |
6215 (ps-output "0 EF\n") | 6300 (ps-output "0 EF\n") |
6216 (setq ps-current-effect 0)) | 6301 (setq ps-current-effect 0)) |
6217 ((/= effects ps-current-effect) | 6302 ((/= effects ps-current-effect) |
6383 (t | 6468 (t |
6384 (vector 0 nil nil)))) | 6469 (vector 0 nil nil)))) |
6385 | 6470 |
6386 | 6471 |
6387 (defun ps-face-background (face background) | 6472 (defun ps-face-background (face background) |
6388 (and (cond ((eq ps-use-face-background t)) ; always | 6473 (and (cond ((eq ps-use-face-background t)) ; always |
6389 ((null ps-use-face-background) nil) ; never | 6474 ((null ps-use-face-background) nil) ; never |
6390 ;; ps-user-face-background is a symbol face list | 6475 ;; ps-user-face-background is a symbol face list |
6391 ((symbolp face) | 6476 ((symbolp face) |
6392 (memq face ps-use-face-background)) | 6477 (memq face ps-use-face-background)) |
6393 ((listp face) | 6478 ((listp face) |
7109 the same buffer. See `ps-font-family', | 7194 the same buffer. See `ps-font-family', |
7110 `ps-header-font-family' and `ps-font-info-database'. | 7195 `ps-header-font-family' and `ps-font-info-database'. |
7111 | 7196 |
7112 Any other value is treated as nil.") | 7197 Any other value is treated as nil.") |
7113 | 7198 |
7114 (custom-autoload (quote ps-multibyte-buffer) "ps-mule" t) | 7199 (custom-autoload 'ps-multibyte-buffer "ps-mule" t) |
7115 | 7200 |
7116 (autoload (quote ps-mule-prepare-ascii-font) "ps-mule" "\ | 7201 (autoload 'ps-mule-prepare-ascii-font "ps-mule" "\ |
7117 Setup special ASCII font for STRING. | 7202 Setup special ASCII font for STRING. |
7118 STRING should contain only ASCII characters. | 7203 STRING should contain only ASCII characters. |
7119 | 7204 |
7120 \(fn STRING)" nil nil) | 7205 \(fn STRING)" nil nil) |
7121 | 7206 |
7122 (autoload (quote ps-mule-set-ascii-font) "ps-mule" "\ | 7207 (autoload 'ps-mule-set-ascii-font "ps-mule" "\ |
7123 Not documented | 7208 Not documented |
7124 | 7209 |
7125 \(fn)" nil nil) | 7210 \(fn)" nil nil) |
7126 | 7211 |
7127 (autoload (quote ps-mule-plot-string) "ps-mule" "\ | 7212 (autoload 'ps-mule-plot-string "ps-mule" "\ |
7128 Generate PostScript code for plotting characters in the region FROM and TO. | 7213 Generate PostScript code for plotting characters in the region FROM and TO. |
7129 | 7214 |
7130 It is assumed that all characters in this region belong to the same charset. | 7215 It is assumed that all characters in this region belong to the same charset. |
7131 | 7216 |
7132 Optional argument BG-COLOR specifies background color. | 7217 Optional argument BG-COLOR specifies background color. |
7138 Where ENDPOS is the end position of the sequence and RUN-WIDTH is the width of | 7223 Where ENDPOS is the end position of the sequence and RUN-WIDTH is the width of |
7139 the sequence. | 7224 the sequence. |
7140 | 7225 |
7141 \(fn FROM TO &optional BG-COLOR)" nil nil) | 7226 \(fn FROM TO &optional BG-COLOR)" nil nil) |
7142 | 7227 |
7143 (autoload (quote ps-mule-plot-composition) "ps-mule" "\ | 7228 (autoload 'ps-mule-plot-composition "ps-mule" "\ |
7144 Generate PostScript code for plotting composition in the region FROM and TO. | 7229 Generate PostScript code for plotting composition in the region FROM and TO. |
7145 | 7230 |
7146 It is assumed that all characters in this region belong to the same | 7231 It is assumed that all characters in this region belong to the same |
7147 composition. | 7232 composition. |
7148 | 7233 |
7155 Where ENDPOS is the end position of the sequence and RUN-WIDTH is the width of | 7240 Where ENDPOS is the end position of the sequence and RUN-WIDTH is the width of |
7156 the sequence. | 7241 the sequence. |
7157 | 7242 |
7158 \(fn FROM TO &optional BG-COLOR)" nil nil) | 7243 \(fn FROM TO &optional BG-COLOR)" nil nil) |
7159 | 7244 |
7160 (autoload (quote ps-mule-initialize) "ps-mule" "\ | 7245 (autoload 'ps-mule-initialize "ps-mule" "\ |
7161 Initialize global data for printing multi-byte characters. | 7246 Initialize global data for printing multi-byte characters. |
7162 | 7247 |
7163 \(fn)" nil nil) | 7248 \(fn)" nil nil) |
7164 | 7249 |
7165 (autoload (quote ps-mule-encode-header-string) "ps-mule" "\ | 7250 (autoload 'ps-mule-encode-header-string "ps-mule" "\ |
7166 Generate PostScript code for ploting STRING by font FONTTAG. | 7251 Generate PostScript code for ploting STRING by font FONTTAG. |
7167 FONTTAG should be a string \"/h0\" or \"/h1\". | 7252 FONTTAG should be a string \"/h0\" or \"/h1\". |
7168 | 7253 |
7169 \(fn STRING FONTTAG)" nil nil) | 7254 \(fn STRING FONTTAG)" nil nil) |
7170 | 7255 |
7171 (autoload (quote ps-mule-begin-job) "ps-mule" "\ | 7256 (autoload 'ps-mule-begin-job "ps-mule" "\ |
7172 Start printing job for multi-byte chars between FROM and TO. | 7257 Start printing job for multi-byte chars between FROM and TO. |
7173 It checks if all multi-byte characters in the region are printable or not. | 7258 It checks if all multi-byte characters in the region are printable or not. |
7174 | 7259 |
7175 \(fn FROM TO)" nil nil) | 7260 \(fn FROM TO)" nil nil) |
7176 | 7261 |
7177 (autoload (quote ps-mule-begin-page) "ps-mule" "\ | 7262 (autoload 'ps-mule-begin-page "ps-mule" "\ |
7178 Not documented | 7263 Not documented |
7179 | 7264 |
7180 \(fn)" nil nil) | 7265 \(fn)" nil nil) |
7181 | 7266 |
7182 ;;;*** | 7267 ;;;*** |