1 ;;; compface.el --- functions for converting X-Face headers
3 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software: you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation, either version 3 of the License, or
13 ;; (at your option) any later version.
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
28 (defun uncompface (face)
30 Requires the external programs `uncompface', and `icontopbm'. On a
31 GNU/Linux system these might be in packages with names like `compface'
32 or `faces-xface' and `netpbm' or `libgr-progs', for instance."
34 (unless (featurep 'xemacs
) (set-buffer-multibyte nil
))
36 (let ((coding-system-for-read 'raw-text
)
37 ;; At least "icontopbm" doesn't work with Windows because
38 ;; the line-break code is converted into CRLF by default.
39 (coding-system-for-write 'binary
))
40 (and (eq 0 (apply 'call-process-region
(point-min) (point-max)
42 'delete
'(t nil
) nil
))
44 (goto-char (point-min))
45 (insert "/* Width=48, Height=48 */\n")
46 ;; I just can't get "icontopbm" to work correctly on its
47 ;; own in XEmacs. And Emacs doesn't understand un-raw pbm
49 (if (not (featurep 'xemacs
))
50 (eq 0 (call-process-region (point-min) (point-max)
53 (shell-command-on-region (point-min) (point-max)
54 "icontopbm | pnmnoraw"
61 ;; arch-tag: f9c78e84-98c0-4142-9682-8ba4cf4c3441
62 ;;; compface.el ends here