aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2001-04-02 10:35:44 +0000
committerGerd Moellmann2001-04-02 10:35:44 +0000
commit64d8e7fd0e81cc3e89d04a27e30bc96075415f86 (patch)
treea7f693de72d8d0e67c6f9529be781395415681d1
parent6bf5fb46a34e07dca0f68dd89aad788d730712d9 (diff)
downloademacs-64d8e7fd0e81cc3e89d04a27e30bc96075415f86.tar.gz
emacs-64d8e7fd0e81cc3e89d04a27e30bc96075415f86.zip
XEmacs compatibility. Doc fix.
(installation-directory, coding-system-for-read): Declare vars if it's not declared yet. (bdf-read-font-info, bdf-read-bitmap, bdf-get-bitmaps): Code fix.
-rw-r--r--lisp/ps-bdf.el30
1 files changed, 18 insertions, 12 deletions
diff --git a/lisp/ps-bdf.el b/lisp/ps-bdf.el
index 441584607de..241f4d9aaa4 100644
--- a/lisp/ps-bdf.el
+++ b/lisp/ps-bdf.el
@@ -1,11 +1,11 @@
1;;; ps-bdf.el --- BDF font file handler for ps-print. 1;;; ps-bdf.el --- BDF font file handler for ps-print.
2 2
3;; Copyright (C) 1998, 1999 Electrotechnical Laboratory, JAPAN. 3;; Copyright (C) 1998,99,2001 Electrotechnical Laboratory, JAPAN.
4;; Licensed to the Free Software Foundation. 4;; Licensed to the Free Software Foundation.
5 5
6;; Keywords: wp, BDF, font, PostScript 6;; Keywords: wp, BDF, font, PostScript
7;; Maintainer: Kenichi Handa <handa@etl.go.jp> 7;; Maintainer: Kenichi Handa <handa@etl.go.jp>
8;; Time-stamp: <99/02/27 11:14:07 kenichi> 8;; Time-stamp: <2001/03/05 09:04:32 vinicius>
9 9
10;; This file is part of GNU Emacs. 10;; This file is part of GNU Emacs.
11 11
@@ -31,7 +31,12 @@
31 31
32;;; Code: 32;;; Code:
33 33
34(eval-when-compile (require 'ps-mule)) 34(eval-and-compile
35 (require 'ps-mule)
36
37 ;; to avoid XEmacs compilation gripes
38 (defvar installation-directory nil)
39 (defvar coding-system-for-read nil))
35 40
36;;;###autoload 41;;;###autoload
37(defvar bdf-directory-list 42(defvar bdf-directory-list
@@ -42,13 +47,13 @@
42The default value is '(\"/usr/local/share/emacs/fonts/bdf\").") 47The default value is '(\"/usr/local/share/emacs/fonts/bdf\").")
43 48
44;; MS-DOS users like to move the binary around after it's built, but 49;; MS-DOS users like to move the binary around after it's built, but
45;; the value above is computed at loadup time. 50;; the value above is computed at load-up time.
46(and (eq system-type 'ms-dos) 51(and (eq system-type 'ms-dos)
47 (setq bdf-directory-list 52 (setq bdf-directory-list
48 (list (expand-file-name "fonts/bdf" installation-directory)))) 53 (list (expand-file-name "fonts/bdf" installation-directory))))
49 54
50(defun bdf-expand-file-name (bdfname) 55(defun bdf-expand-file-name (bdfname)
51 "Return an abosolute path name of a `BDF' font file BDFNAME. 56 "Return an absolute path name of a `BDF' font file BDFNAME.
52It searches directories listed in the variable `bdf-directory-list' 57It searches directories listed in the variable `bdf-directory-list'
53for BDFNAME." 58for BDFNAME."
54 (if (file-name-absolute-p bdfname) 59 (if (file-name-absolute-p bdfname)
@@ -124,7 +129,7 @@ If the cache file is not readable, this return nil."
124(defun bdf-write-cache () 129(defun bdf-write-cache ()
125 "Write out cached information of `BDF' font file to a file. 130 "Write out cached information of `BDF' font file to a file.
126The variable `bdf-cache-file' holds the cache file name. 131The variable `bdf-cache-file' holds the cache file name.
127The file is written if and only if the file alreay exists and writable." 132The file is written if and only if the file already exists and writable."
128 (and bdf-cache 133 (and bdf-cache
129 (file-exists-p bdf-cache-file) 134 (file-exists-p bdf-cache-file)
130 (file-writable-p bdf-cache-file) 135 (file-writable-p bdf-cache-file)
@@ -198,7 +203,7 @@ CODE-RANGE is a vector of minimum 1st byte, maximum 1st byte, minimum
1982nd byte, maximum 2nd byte, minimum code, maximum code, and default 2032nd byte, maximum 2nd byte, minimum code, maximum code, and default
199code. For 1-byte fonts, the first two elements are 0. 204code. For 1-byte fonts, the first two elements are 0.
200 205
201MAXLEN is a maximum bytes of one glyph informaion in the font file. 206MAXLEN is a maximum bytes of one glyph information in the font file.
202 207
203OFFSET-VECTOR is a vector of a file position which starts bitmap data 208OFFSET-VECTOR is a vector of a file position which starts bitmap data
204of the glyph in the font file. 209of the glyph in the font file.
@@ -257,7 +262,7 @@ CODE, where N and CODE are in the following relation:
257 262
258 (let ((min-code0 256) (min-code1 256) (min-code 65536) 263 (let ((min-code0 256) (min-code1 256) (min-code 65536)
259 (max-code0 0) (max-code1 0) (max-code 0) 264 (max-code0 0) (max-code1 0) (max-code 0)
260 glyph glyph-list code0 code1 code bbx offset) 265 glyph glyph-list code0 code1 code offset)
261 266
262 (while (search-forward "\nSTARTCHAR" nil t) 267 (while (search-forward "\nSTARTCHAR" nil t)
263 (setq offset (line-beginning-position)) 268 (setq offset (line-beginning-position))
@@ -340,8 +345,8 @@ on that file name."
340 (bdf-get-font-info (or fname (car bdfnames))))) 345 (bdf-get-font-info (or fname (car bdfnames)))))
341 346
342(defun bdf-read-bitmap (bdfname offset maxlen) 347(defun bdf-read-bitmap (bdfname offset maxlen)
343 "Read `BDF' font file BDFNAME to get bitmap data at file poistion OFFSET. 348 "Read `BDF' font file BDFNAME to get bitmap data at file position OFFSET.
344BDFNAME is an abosolute path name of the font file. 349BDFNAME is an absolute path name of the font file.
345MAXLEN specifies how many bytes we should read at least. 350MAXLEN specifies how many bytes we should read at least.
346The value is a list of DWIDTH, BBX, and BITMAP-STRING. 351The value is a list of DWIDTH, BBX, and BITMAP-STRING.
347DWIDTH is a pixel width of a glyph. 352DWIDTH is a pixel width of a glyph.
@@ -359,7 +364,8 @@ BITMAP-STRING is a string representing bits by hexadecimal digits."
359 (search-forward "\nBBX") 364 (search-forward "\nBBX")
360 (setq bbx (vector (read (current-buffer)) (read (current-buffer)) 365 (setq bbx (vector (read (current-buffer)) (read (current-buffer))
361 (read (current-buffer)) (read (current-buffer))) 366 (read (current-buffer)) (read (current-buffer)))
362 height (aref bbx 1) yoff (aref bbx 3)) 367 height (aref bbx 1)
368 yoff (aref bbx 3))
363 (search-forward "\nBITMAP") 369 (search-forward "\nBITMAP")
364 (forward-line 1) 370 (forward-line 1)
365 (delete-region (point-min) (point)) 371 (delete-region (point-min) (point))
@@ -396,7 +402,7 @@ BBX is a bounding box of the glyph.
396BITMAP-STRING is a string representing bits by hexadecimal digits." 402BITMAP-STRING is a string representing bits by hexadecimal digits."
397 (let* ((font-info (bdf-find-font-info bdfname)) 403 (let* ((font-info (bdf-find-font-info bdfname))
398 (absolute-path (bdf-info-absolute-path font-info)) 404 (absolute-path (bdf-info-absolute-path font-info))
399 (font-bounding-box (bdf-info-font-bounding-box font-info)) 405 ;;(font-bounding-box (bdf-info-font-bounding-box font-info))
400 (maxlen (bdf-info-maxlen font-info)) 406 (maxlen (bdf-info-maxlen font-info))
401 (code-range (bdf-info-code-range font-info)) 407 (code-range (bdf-info-code-range font-info))
402 (offset-vector (bdf-info-offset-vector font-info))) 408 (offset-vector (bdf-info-offset-vector font-info)))