diff options
| author | Gerd Moellmann | 2001-04-02 10:35:44 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-04-02 10:35:44 +0000 |
| commit | 64d8e7fd0e81cc3e89d04a27e30bc96075415f86 (patch) | |
| tree | a7f693de72d8d0e67c6f9529be781395415681d1 | |
| parent | 6bf5fb46a34e07dca0f68dd89aad788d730712d9 (diff) | |
| download | emacs-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.el | 30 |
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 @@ | |||
| 42 | The default value is '(\"/usr/local/share/emacs/fonts/bdf\").") | 47 | The 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. |
| 52 | It searches directories listed in the variable `bdf-directory-list' | 57 | It searches directories listed in the variable `bdf-directory-list' |
| 53 | for BDFNAME." | 58 | for 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. |
| 126 | The variable `bdf-cache-file' holds the cache file name. | 131 | The variable `bdf-cache-file' holds the cache file name. |
| 127 | The file is written if and only if the file alreay exists and writable." | 132 | The 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 | |||
| 198 | 2nd byte, maximum 2nd byte, minimum code, maximum code, and default | 203 | 2nd byte, maximum 2nd byte, minimum code, maximum code, and default |
| 199 | code. For 1-byte fonts, the first two elements are 0. | 204 | code. For 1-byte fonts, the first two elements are 0. |
| 200 | 205 | ||
| 201 | MAXLEN is a maximum bytes of one glyph informaion in the font file. | 206 | MAXLEN is a maximum bytes of one glyph information in the font file. |
| 202 | 207 | ||
| 203 | OFFSET-VECTOR is a vector of a file position which starts bitmap data | 208 | OFFSET-VECTOR is a vector of a file position which starts bitmap data |
| 204 | of the glyph in the font file. | 209 | of 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. |
| 344 | BDFNAME is an abosolute path name of the font file. | 349 | BDFNAME is an absolute path name of the font file. |
| 345 | MAXLEN specifies how many bytes we should read at least. | 350 | MAXLEN specifies how many bytes we should read at least. |
| 346 | The value is a list of DWIDTH, BBX, and BITMAP-STRING. | 351 | The value is a list of DWIDTH, BBX, and BITMAP-STRING. |
| 347 | DWIDTH is a pixel width of a glyph. | 352 | DWIDTH 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. | |||
| 396 | BITMAP-STRING is a string representing bits by hexadecimal digits." | 402 | BITMAP-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))) |