;;; ps-print.el --- print text from the buffer as PostScript
;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-;; 2003, 2004 Free Software Foundation, Inc.
+;; 2003, 2004, 2005 Free Software Foundation, Inc.
;; Author: Jim Thompson (was <thompson@wg2.waii.com>)
;; Jacques Duthen (was <duthen@cegelec-red.fr>)
;; Maintainer: Kenichi Handa <handa@etl.go.jp> (multi-byte characters)
;; Vinicius Jose Latorre <viniciusjl@ig.com.br>
;; Keywords: wp, print, PostScript
-;; Time-stamp: <2004/07/21 23:12:05 vinicius>
-;; Version: 6.6.5
+;; Time-stamp: <2005/03/19 00:40:12 vinicius>
+;; Version: 6.6.6
;; X-URL: http://www.cpqd.com.br/~vinicius/emacs/
-(defconst ps-print-version "6.6.5"
- "ps-print.el, v 6.6.5 <2004/07/21 vinicius>
+(defconst ps-print-version "6.6.6"
+ "ps-print.el, v 6.6.6 <2005/03/19 vinicius>
Vinicius's last change version -- this file may have been edited as part of
Emacs without changes to the version number. When reporting bugs, please also
(defvar mark-active nil)
(defun ps-mark-active-p ()
mark-active)
- (defalias 'ps-face-foreground-name 'face-foreground)
- (defalias 'ps-face-background-name 'face-background)
- ))
+ (defun ps-face-foreground-name (face)
+ (face-foreground face nil t))
+ (defun ps-face-background-name (face)
+ (face-background face nil t))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
NUMBER It's a real value between 0.0 (black) and 1.0 (white) that
indicate the gray color.
- COLOR-NAME It's a string wich contains the color name. For example:
+ COLOR-NAME It's a string which contains the color name. For example:
\"yellow\".
LIST It's a list of RGB values, that is a list of three real values
NUMBER It's a real value between 0.0 (black) and 1.0 (white) that
indicate the gray color.
- COLOR-NAME It's a string wich contains the color name. For example:
+ COLOR-NAME It's a string which contains the color name. For example:
\"yellow\".
LIST It's a list of RGB values, that is a list of three real values
((stringp (car content))
(car content))
;; function symbol
- ((and (symbolp (car content)) (fboundp (car content)))
+ ((functionp (car content))
(concat "(" (funcall (car content)) ")"))
;; variable symbol
((and (symbolp (car content)) (boundp (car content)))
(and ps-print-footer
(setq ps-lf-cache (ps-generate-string-list ps-left-footer)
ps-rf-cache (ps-generate-string-list ps-right-footer)))
- (mapconcat 'identity
- (append ps-lh-cache ps-rh-cache ps-lf-cache ps-rf-cache)
- ""))
+ (append ps-lh-cache ps-rh-cache ps-lf-cache ps-rf-cache))
;; These functions insert the arrays that define the contents of the headers.
;; Functions are called -- they should return strings; they will be inserted
;; as strings and the PS string delimiters added.
- ((and (symbolp content) (fboundp content))
+ ((functionp content)
(ps-output-string (ps-mule-encode-header-string (funcall content)
fonttag)))
(defvar ps-current-effect 0)
+(defvar ps-print-translation-table
+ (let ((tbl (make-char-table 'translation-table nil)))
+ (if (and (boundp 'ucs-mule-8859-to-mule-unicode)
+ (char-table-p ucs-mule-8859-to-mule-unicode))
+ (map-char-table
+ #'(lambda (k v)
+ (if (and v (eq (char-charset v) 'latin-iso8859-1) (/= k v))
+ (aset tbl k v)))
+ ucs-mule-8859-to-mule-unicode))
+ tbl)
+ "Translation table for PostScript printing.
+The default value is a table that translates non-Latin-1 Latin characters
+to the equivalent Latin-1 characters.")
(defun ps-plot-region (from to font &optional fg-color bg-color effects)
(or (equal font ps-current-font)
(ps-plot 'ps-mule-plot-composition match-point (point) bg-color))
((> match 255) ; a multi-byte character
+ (setq match (or (aref ps-print-translation-table match) match))
(let* ((charset (char-charset match))
(composition (ps-e-find-composition match-point to))
(stop (if (nth 2 composition) (car composition) to)))
(or (eq charset 'composition)
- (while (and (< (point) stop) (eq (charset-after) charset))
+ (while (and (< (point) stop)
+ (let ((ch (following-char)))
+ (setq ch
+ (or (aref ps-print-translation-table ch)
+ ch))
+ (eq (char-charset ch) charset)))
(forward-char 1)))
(ps-plot 'ps-mule-plot-string match-point (point) bg-color)))
; characters from ^@ to ^_ and