From fd7ec851c6ca45adc3f060b8f824820080abc674 Mon Sep 17 00:00:00 2001 From: Vinicius Jose Latorre Date: Wed, 9 Jan 2008 03:27:04 +0000 Subject: [PATCH] Fix face attributes recognition --- lisp/ChangeLog.unicode | 11 +++++++++++ lisp/ps-def.el | 24 ++++++++++++++++++++++-- lisp/ps-print.el | 15 +++++++++------ lisp/ps-samp.el | 3 +-- 4 files changed, 43 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog.unicode b/lisp/ChangeLog.unicode index f842822671e..5bc4ad99299 100644 --- a/lisp/ChangeLog.unicode +++ b/lisp/ChangeLog.unicode @@ -1,3 +1,14 @@ +2008-01-09 Vinicius Jose Latorre + + * ps-print.el: Some face attributes (like :strike-through) was not + being recognised. Reported by Leo . + (ps-print-version): New version 7.3.2. + (ps-screen-to-bit-face): Fix code. Call ps-face-strikout-p, + ps-face-overline-p and ps-face-box-p funs. + + * ps-def.el (ps-face-strikout-p, ps-face-overline-p, ps-face-box-p): + New funs. + 2008-01-09 Kenichi Handa * international/fontset.el (font-encoding-alist): Add an entry for diff --git a/lisp/ps-def.el b/lisp/ps-def.el index 3903fc0ef3f..30453f87463 100644 --- a/lisp/ps-def.el +++ b/lisp/ps-def.el @@ -1,13 +1,12 @@ ;;; ps-def.el --- XEmacs and Emacs definitions for ps-print -;; Copyright (C) 2007 Free Software Foundation, Inc. +;; Copyright (C) 2007, 2008 Free Software Foundation, Inc. ;; Author: Vinicius Jose Latorre ;; Kenichi Handa (multi-byte characters) ;; Maintainer: Kenichi Handa (multi-byte characters) ;; Vinicius Jose Latorre ;; Keywords: wp, print, PostScript -;; Version: 7.2.2 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre ;; This file is part of GNU Emacs. @@ -241,6 +240,15 @@ (memq face ps-italic-faces))) ; Kludge-compatible + (defalias 'ps-face-strikeout-p 'ignore) + + + (defalias 'ps-face-overline-p 'ignore) + + + (defalias 'ps-face-box-p 'ignore) + + ;; XEmacs will have to make do with %s (princ) for floats. (defvar ps-color-format "%s %s %s") (defvar ps-float-format "%s ") @@ -362,6 +370,18 @@ (memq face ps-italic-faces))) + (defun ps-face-strikeout-p (face) + (eq (face-attribute face :strike-through) t)) + + + (defun ps-face-overline-p (face) + (eq (face-attribute face :overline) t)) + + + (defun ps-face-box-p (face) + (not (memq (face-attribute face :box) '(nil unspecified)))) + + ;; Emacs understands the %f format; we'll use it to limit color RGB values ;; to three decimals to cut down some on the size of the PostScript output. (defvar ps-color-format "%0.3f %0.3f %0.3f") diff --git a/lisp/ps-print.el b/lisp/ps-print.el index dd1800e714f..6a44a6c5ef6 100644 --- a/lisp/ps-print.el +++ b/lisp/ps-print.el @@ -10,11 +10,11 @@ ;; Maintainer: Kenichi Handa (multi-byte characters) ;; Vinicius Jose Latorre ;; Keywords: wp, print, PostScript -;; Version: 7.3.1 +;; Version: 7.3.2 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre -(defconst ps-print-version "7.3.1" - "ps-print.el, v 7.3.1 <2007/11/21 vinicius> +(defconst ps-print-version "7.3.2" + "ps-print.el, v 7.3.2 <2008/01/09 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 @@ -6361,9 +6361,12 @@ If FACE is not a valid face name, use default face." (defun ps-screen-to-bit-face (face) (cons face - (vector (logior (if (ps-face-bold-p face) 1 0) ; bold - (if (ps-face-italic-p face) 2 0) ; italic - (if (ps-face-underlined-p face) 4 0)) ; underline + (vector (logior (if (ps-face-bold-p face) 1 0) ; bold + (if (ps-face-italic-p face) 2 0) ; italic + (if (ps-face-underlined-p face) 4 0) ; underline + (if (ps-face-strikeout-p face) 8 0) ; strikeout + (if (ps-face-overline-p face) 16 0) ; overline + (if (ps-face-box-p face) 64 0)) ; box (ps-face-foreground-name face) (ps-face-background-name face)))) diff --git a/lisp/ps-samp.el b/lisp/ps-samp.el index a8e4086fe0b..ffe434b1815 100644 --- a/lisp/ps-samp.el +++ b/lisp/ps-samp.el @@ -1,6 +1,6 @@ ;;; ps-samp.el --- ps-print sample setup code -;; Copyright (C) 2007 Free Software Foundation, Inc. +;; Copyright (C) 2007, 2008 Free Software Foundation, Inc. ;; Author: Jim Thompson (was ) ;; Jacques Duthen (was ) @@ -9,7 +9,6 @@ ;; Maintainer: Kenichi Handa (multi-byte characters) ;; Vinicius Jose Latorre ;; Keywords: wp, print, PostScript -;; Version: 7.2.2 ;; X-URL: http://www.emacswiki.org/cgi-bin/wiki/ViniciusJoseLatorre ;; This file is part of GNU Emacs.