diff options
| author | Eli Zaretskii | 2002-05-17 14:09:39 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2002-05-17 14:09:39 +0000 |
| commit | d0d08a25c2849ab2d2b496f2ed382cf4448226b2 (patch) | |
| tree | bf10a0d861695968ced9f15035725cbe3dbcdaed | |
| parent | 8de1855e88fe0e6a3b8538b727c97f5713092a9f (diff) | |
| download | emacs-d0d08a25c2849ab2d2b496f2ed382cf4448226b2.tar.gz emacs-d0d08a25c2849ab2d2b496f2ed382cf4448226b2.zip | |
(eval-and-compile): Add a trivial replacement for a
possibly missing encode-char.
(ps-mule-font-info-database-bdf): Add associations for Unicode
fonts. Doc fix.
(ps-mule-font-info-database-ps-bdf): Doc fix.
(ps-mule-encode-ucs2): New function for encoding Unicode characters.
| -rw-r--r-- | lisp/ps-mule.el | 52 |
1 files changed, 39 insertions, 13 deletions
diff --git a/lisp/ps-mule.el b/lisp/ps-mule.el index 133f26bd00c..eeb153e44c1 100644 --- a/lisp/ps-mule.el +++ b/lisp/ps-mule.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; ps-mule.el --- provide multi-byte character facility to ps-print | 1 | ;;; ps-mule.el --- provide multi-byte character facility to ps-print |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Vinicius Jose Latorre <vinicius@cpqd.com.br> | 5 | ;; Author: Vinicius Jose Latorre <vinicius@cpqd.com.br> |
| 6 | ;; Kenichi Handa <handa@etl.go.jp> (multi-byte characters) | 6 | ;; Kenichi Handa <handa@etl.go.jp> (multi-byte characters) |
| @@ -159,7 +159,10 @@ | |||
| 159 | (setq i (1+ i))) | 159 | (setq i (1+ i))) |
| 160 | multibyte))) | 160 | multibyte))) |
| 161 | (or (fboundp 'string-make-multibyte) | 161 | (or (fboundp 'string-make-multibyte) |
| 162 | (defalias 'string-make-multibyte 'copy-sequence))) | 162 | (defalias 'string-make-multibyte 'copy-sequence)) |
| 163 | (or (fboundp 'encode-char) | ||
| 164 | (defun encode-char (ch ccs) | ||
| 165 | ch))) | ||
| 163 | 166 | ||
| 164 | 167 | ||
| 165 | ;;;###autoload | 168 | ;;;###autoload |
| @@ -417,16 +420,22 @@ Currently, data for Japanese and Korean PostScript printers are listed.") | |||
| 417 | (normal bdf ("ind24-mule.bdf" "mule-indian-24.bdf") ps-mule-encode-7bit 2)) | 420 | (normal bdf ("ind24-mule.bdf" "mule-indian-24.bdf") ps-mule-encode-7bit 2)) |
| 418 | (tibetan | 421 | (tibetan |
| 419 | (normal bdf ("tib24p-mule.bdf" "tib24-mule.bdf" "mule-tibmdx-24.bdf") | 422 | (normal bdf ("tib24p-mule.bdf" "tib24-mule.bdf" "mule-tibmdx-24.bdf") |
| 420 | ps-mule-encode-7bit 2))) | 423 | ps-mule-encode-7bit 2)) |
| 424 | (mule-unicode-0100-24ff | ||
| 425 | (normal bdf "etl24-unicode.bdf" ps-mule-encode-ucs2 2)) | ||
| 426 | (mule-unicode-2500-33ff | ||
| 427 | (normal bdf "etl24-unicode.bdf" ps-mule-encode-ucs2 2)) | ||
| 428 | (mule-unicode-e000-ffff | ||
| 429 | (normal bdf "etl24-unicode.bdf" ps-mule-encode-ucs2 2))) | ||
| 421 | "Sample setting of the `ps-mule-font-info-database' to use BDF fonts. | 430 | "Sample setting of the `ps-mule-font-info-database' to use BDF fonts. |
| 422 | BDF (Bitmap Distribution Format) is a format used for distributing X's font | 431 | BDF (Bitmap Distribution Format) is a format used for distributing X's font |
| 423 | source file. | 432 | source file. |
| 424 | 433 | ||
| 425 | Current default value list for BDF fonts is included in `intlfonts-1.2' which is | 434 | Current default value list for BDF fonts is included in `intlfonts-1.2' |
| 426 | a collection of X11 fonts for all characters supported by Emacs. | 435 | which is a collection of X11 fonts for all characters supported by Emacs. |
| 427 | 436 | ||
| 428 | Using this list as default value to `ps-mule-font-info-database', all characters | 437 | Using this list as default value to `ps-mule-font-info-database', all |
| 429 | including ASCII and Latin-1 are printed by BDF fonts. | 438 | characters including ASCII and Latin-1 are printed by BDF fonts. |
| 430 | 439 | ||
| 431 | See also `ps-mule-font-info-database-ps-bdf'.") | 440 | See also `ps-mule-font-info-database-ps-bdf'.") |
| 432 | 441 | ||
| @@ -435,13 +444,13 @@ See also `ps-mule-font-info-database-ps-bdf'.") | |||
| 435 | (cdr (cdr ps-mule-font-info-database-bdf))) | 444 | (cdr (cdr ps-mule-font-info-database-bdf))) |
| 436 | "Sample setting of the `ps-mule-font-info-database' to use BDF fonts. | 445 | "Sample setting of the `ps-mule-font-info-database' to use BDF fonts. |
| 437 | 446 | ||
| 438 | Current default value list for BDF fonts is included in `intlfonts-1.2' which is | 447 | Current default value list for BDF fonts is included in `intlfonts-1.2' |
| 439 | a collection of X11 fonts for all characters supported by Emacs. | 448 | which is a collection of X11 fonts for all characters supported by Emacs. |
| 440 | 449 | ||
| 441 | Using this list as default value to `ps-mule-font-info-database', all characters | 450 | Using this list as default value to `ps-mule-font-info-database', all |
| 442 | except ASCII and Latin-1 characters are printed by BDF fonts. ASCII and Latin-1 | 451 | characters except ASCII and Latin-1 characters are printed with BDF fonts. |
| 443 | characters are printed by PostScript font specified by `ps-font-family' and | 452 | ASCII and Latin-1 characters are printed with PostScript font specified |
| 444 | `ps-header-font-family'. | 453 | by `ps-font-family' and `ps-header-font-family'. |
| 445 | 454 | ||
| 446 | See also `ps-mule-font-info-database-bdf'.") | 455 | See also `ps-mule-font-info-database-bdf'.") |
| 447 | 456 | ||
| @@ -503,6 +512,23 @@ See also `ps-mule-font-info-database-bdf'.") | |||
| 503 | (defun ps-mule-encode-ethiopic (string) | 512 | (defun ps-mule-encode-ethiopic (string) |
| 504 | string)) | 513 | string)) |
| 505 | 514 | ||
| 515 | ;; Special encoding for mule-unicode-* characters. | ||
| 516 | (defun ps-mule-encode-ucs2 (string) | ||
| 517 | (let* ((len (ps-mule-chars-in-string string)) | ||
| 518 | (str (make-string (* 2 len) 0)) | ||
| 519 | (i 0) | ||
| 520 | (j 0) | ||
| 521 | ch hi lo) | ||
| 522 | (while (< i len) | ||
| 523 | (setq ch (encode-char (ps-mule-string-char string i) 'ucs) | ||
| 524 | hi (lsh ch -8) | ||
| 525 | lo (logand ch 255)) | ||
| 526 | (aset str j hi) | ||
| 527 | (aset str (1+ j) lo) | ||
| 528 | (setq i (1+ i) | ||
| 529 | j (+ j 2))) | ||
| 530 | str)) | ||
| 531 | |||
| 506 | ;; A charset which we are now processing. | 532 | ;; A charset which we are now processing. |
| 507 | (defvar ps-mule-current-charset nil) | 533 | (defvar ps-mule-current-charset nil) |
| 508 | 534 | ||