Mercurial > emacs
annotate lisp/ps-mule.el @ 112264:01708c6828b7
merge emacs-23
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 14 Jan 2011 13:08:30 +0900 |
parents | 376148b31b5e |
children | 417b1e4d63cd |
rev | line source |
---|---|
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37201
diff
changeset
|
1 ;;; ps-mule.el --- provide multi-byte character facility to ps-print |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
2 |
64762
41bb365f41c4
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
64647
diff
changeset
|
3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
112218
376148b31b5e
Add 2011 to FSF/AIST copyright years.
Glenn Morris <rgm@gnu.org>
parents:
110984
diff
changeset
|
4 ;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
5 |
74327
78c65b1a07f6
Fix maintainer email. Emacs 20/21 compatibility.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
68651
diff
changeset
|
6 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br> |
78c65b1a07f6
Fix maintainer email. Emacs 20/21 compatibility.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
68651
diff
changeset
|
7 ;; Kenichi Handa <handa@m17n.org> (multi-byte characters) |
78c65b1a07f6
Fix maintainer email. Emacs 20/21 compatibility.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
68651
diff
changeset
|
8 ;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters) |
78c65b1a07f6
Fix maintainer email. Emacs 20/21 compatibility.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
68651
diff
changeset
|
9 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br> |
38436
b174db545cfd
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
37201
diff
changeset
|
10 ;; Keywords: wp, print, PostScript, multibyte, mule |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
11 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
12 ;; This file is part of GNU Emacs. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
13 |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91996
diff
changeset
|
14 ;; GNU Emacs is free software: you can redistribute it and/or modify |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
15 ;; it under the terms of the GNU General Public License as published by |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91996
diff
changeset
|
16 ;; the Free Software Foundation, either version 3 of the License, or |
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91996
diff
changeset
|
17 ;; (at your option) any later version. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
18 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
19 ;; GNU Emacs is distributed in the hope that it will be useful, |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
22 ;; GNU General Public License for more details. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
23 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
24 ;; You should have received a copy of the GNU General Public License |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91996
diff
changeset
|
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
26 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
27 ;;; Commentary: |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
28 |
26115
314173e121ee
Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents:
25828
diff
changeset
|
29 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
30 ;; |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
31 ;; About ps-mule |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
32 ;; ------------- |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
33 ;; |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
34 ;; This package is used for ps-print to print multi-byte buffer. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
35 ;; |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
36 ;; See also ps-print.el. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
37 ;; |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
38 ;; |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
39 ;; Printing Multi-byte Buffer |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
40 ;; -------------------------- |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
41 ;; |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
42 ;; The variable `ps-multibyte-buffer' specifies the ps-print multi-byte buffer |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
43 ;; handling. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
44 ;; |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
45 ;; Valid values for `ps-multibyte-buffer' are: |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
46 ;; |
82106
f95feb715a68
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82095
diff
changeset
|
47 ;; nil This is the value to use the default settings; |
f95feb715a68
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82095
diff
changeset
|
48 ;; by default, this only works to print buffers with |
f95feb715a68
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82095
diff
changeset
|
49 ;; only ASCII and Latin characters. But this default |
f95feb715a68
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82095
diff
changeset
|
50 ;; setting can be changed by setting the variable |
26115
314173e121ee
Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents:
25828
diff
changeset
|
51 ;; `ps-mule-font-info-database-default' differently. |
314173e121ee
Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents:
25828
diff
changeset
|
52 ;; The initial value of this variable is |
314173e121ee
Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents:
25828
diff
changeset
|
53 ;; `ps-mule-font-info-database-latin' (see |
314173e121ee
Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents:
25828
diff
changeset
|
54 ;; documentation). |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
55 ;; |
82106
f95feb715a68
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82095
diff
changeset
|
56 ;; `non-latin-printer' This is the value to use when you have a japanese |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
57 ;; or korean PostScript printer and want to print |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
58 ;; buffer with ASCII, Latin-1, Japanese (JISX0208 and |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
59 ;; JISX0201-Kana) and Korean characters. At present, |
82106
f95feb715a68
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82095
diff
changeset
|
60 ;; it was not tested with the Korean characters |
f95feb715a68
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82095
diff
changeset
|
61 ;; printing. If you have a korean PostScript printer, |
f95feb715a68
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82095
diff
changeset
|
62 ;; please, test it. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
63 ;; |
82106
f95feb715a68
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82095
diff
changeset
|
64 ;; `bdf-font' This is the value to use when you want to print |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
65 ;; buffer with BDF fonts. BDF fonts include both latin |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
66 ;; and non-latin fonts. BDF (Bitmap Distribution |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
67 ;; Format) is a format used for distributing X's font |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
68 ;; source file. BDF fonts are included in |
37137
b960119b9c18
XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
30561
diff
changeset
|
69 ;; `intlfonts-1.2' which is a collection of X11 fonts |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
70 ;; for all characters supported by Emacs. In order to |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
71 ;; use this value, be sure to have installed |
37137
b960119b9c18
XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
30561
diff
changeset
|
72 ;; `intlfonts-1.2' and set the variable |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
73 ;; `bdf-directory-list' appropriately (see ps-bdf.el |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
74 ;; for documentation of this variable). |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
75 ;; |
82106
f95feb715a68
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82095
diff
changeset
|
76 ;; `bdf-font-except-latin' This is like `bdf-font' except that it uses |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
77 ;; PostScript default fonts to print ASCII and Latin-1 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
78 ;; characters. This is convenient when you want or |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
79 ;; need to use both latin and non-latin characters on |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
80 ;; the same buffer. See `ps-font-family', |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
81 ;; `ps-header-font-family' and `ps-font-info-database'. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
82 ;; |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
83 ;; Any other value is treated as nil. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
84 ;; |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
85 ;; The default is nil. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
86 ;; |
26115
314173e121ee
Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents:
25828
diff
changeset
|
87 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
88 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
89 ;;; Code: |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
90 |
37137
b960119b9c18
XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
30561
diff
changeset
|
91 (eval-and-compile |
90736
ef1369583937
Split XEmacs/Emacs definitions and sample setup code into separate files
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90735
diff
changeset
|
92 (require 'ps-print)) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
93 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
94 |
27160
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
95 ;;;###autoload |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
96 (defcustom ps-multibyte-buffer nil |
100171 | 97 "Specifies the multi-byte buffer handling. |
27160
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
98 |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
99 Valid values are: |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
100 |
82095
b5773fe4ea48
(ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81629
diff
changeset
|
101 nil This is the value to use the default settings; |
b5773fe4ea48
(ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81629
diff
changeset
|
102 by default, this only works to print buffers with |
b5773fe4ea48
(ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81629
diff
changeset
|
103 only ASCII and Latin characters. But this default |
b5773fe4ea48
(ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81629
diff
changeset
|
104 setting can be changed by setting the variable |
27160
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
105 `ps-mule-font-info-database-default' differently. |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
106 The initial value of this variable is |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
107 `ps-mule-font-info-database-latin' (see |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
108 documentation). |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
109 |
82095
b5773fe4ea48
(ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81629
diff
changeset
|
110 `non-latin-printer' This is the value to use when you have a Japanese |
27160
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
111 or Korean PostScript printer and want to print |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
112 buffer with ASCII, Latin-1, Japanese (JISX0208 and |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
113 JISX0201-Kana) and Korean characters. At present, |
82107
d06c8006b89b
Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82106
diff
changeset
|
114 it was not tested with the Korean characters |
d06c8006b89b
Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82106
diff
changeset
|
115 printing. If you have a korean PostScript printer, |
d06c8006b89b
Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82106
diff
changeset
|
116 please, test it. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
117 |
82095
b5773fe4ea48
(ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81629
diff
changeset
|
118 `bdf-font' This is the value to use when you want to print |
27160
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
119 buffer with BDF fonts. BDF fonts include both latin |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
120 and non-latin fonts. BDF (Bitmap Distribution |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
121 Format) is a format used for distributing X's font |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
122 source file. BDF fonts are included in |
37137
b960119b9c18
XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
30561
diff
changeset
|
123 `intlfonts-1.2' which is a collection of X11 fonts |
27160
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
124 for all characters supported by Emacs. In order to |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
125 use this value, be sure to have installed |
37137
b960119b9c18
XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
30561
diff
changeset
|
126 `intlfonts-1.2' and set the variable |
27160
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
127 `bdf-directory-list' appropriately (see ps-bdf.el for |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
128 documentation of this variable). |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
129 |
82095
b5773fe4ea48
(ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
81629
diff
changeset
|
130 `bdf-font-except-latin' This is like `bdf-font' except that it uses |
27160
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
131 PostScript default fonts to print ASCII and Latin-1 |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
132 characters. This is convenient when you want or |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
133 need to use both latin and non-latin characters on |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
134 the same buffer. See `ps-font-family', |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
135 `ps-header-font-family' and `ps-font-info-database'. |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
136 |
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
137 Any other value is treated as nil." |
28631
5e9674136340
Customization fix, doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
27160
diff
changeset
|
138 :type '(choice (const non-latin-printer) (const bdf-font) |
5e9674136340
Customization fix, doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
27160
diff
changeset
|
139 (const bdf-font-except-latin) (const :tag "nil" nil)) |
27160
1e00f7f6655c
ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents:
26882
diff
changeset
|
140 :group 'ps-print-font) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
141 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
142 (defvar ps-mule-font-info-database |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
143 nil |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
144 "Alist of charsets with the corresponding font information. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
145 Each element has the form: |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
146 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
147 (CHARSET (FONT-TYPE FONT-SRC FONT-NAME ENCODING BYTES) ...) |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
148 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
149 Where |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
150 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
151 CHARSET is a charset (symbol) for this font family, |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
152 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
153 FONT-TYPE is a font type: normal, bold, italic, or bold-italic. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
154 |
56679
91074b668126
(ps-mule-font-info-database): Fix docstring.
Kenichi Handa <handa@m17n.org>
parents:
52401
diff
changeset
|
155 FONT-SRC is a font source: builtin, bdf, vflib, or nil. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
156 |
37137
b960119b9c18
XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
30561
diff
changeset
|
157 If FONT-SRC is builtin, FONT-NAME is a built-in PostScript font name. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
158 |
24086
bedce7fcf0f4
(ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents:
23937
diff
changeset
|
159 If FONT-SRC is bdf, FONT-NAME is a BDF font file name, or a list of |
bedce7fcf0f4
(ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents:
23937
diff
changeset
|
160 alternative font names. To use this font, the external library `ps-bdf' |
bedce7fcf0f4
(ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents:
23937
diff
changeset
|
161 is required. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
162 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
163 If FONT-SRC is vflib, FONT-NAME is the name of a font that VFlib knows. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
164 To use this font, the external library `vflib' is required. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
165 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
166 If FONT-SRC is nil, a proper ASCII font in the variable |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
167 `ps-font-info-database' is used. This is useful for Latin-1 characters. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
168 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
169 ENCODING is a coding system to encode a string of characters of CHARSET into a |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
170 proper string matching an encoding of the specified font. ENCODING may be a |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
171 function that does this encoding. In this case, the function is called with |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
172 one argument, the string to encode, and it should return an encoded string. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
173 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
174 BYTES specifies how many bytes each character has in the encoded byte |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
175 sequence; it should be 1 or 2. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
176 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
177 All multi-byte characters are printed by fonts specified in this database |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
178 regardless of a font family of ASCII characters. The exception is Latin-1 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
179 characters which are printed by the same font as ASCII characters, thus obey |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
180 font family. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
181 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
182 See also the variable `ps-font-info-database'.") |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
183 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
184 (defconst ps-mule-font-info-database-latin |
89530 | 185 '((iso-8859-1 |
186 (normal nil nil))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
187 "Sample setting of `ps-mule-font-info-database' to use latin fonts.") |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
188 |
26115
314173e121ee
Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents:
25828
diff
changeset
|
189 (defcustom ps-mule-font-info-database-default |
24307
6909b106c5c6
(ps-mule-font-info-database-default): Set the initial
Kenichi Handa <handa@m17n.org>
parents:
24306
diff
changeset
|
190 ps-mule-font-info-database-latin |
100171 | 191 "The default setting to use when `ps-multibyte-buffer' is nil." |
30561
fb68d65b0fa3
Fix a customization problem on
Gerd Moellmann <gerd@gnu.org>
parents:
29523
diff
changeset
|
192 :type '(symbol :tag "Multi-Byte Buffer Database Font Default") |
26115
314173e121ee
Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents:
25828
diff
changeset
|
193 :group 'ps-print-font) |
24306
432510346b14
(ps-multibyte-buffer): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents:
24303
diff
changeset
|
194 |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
195 (defconst ps-mule-font-info-database-ps |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
196 '((katakana-jisx0201 |
89530 | 197 (normal builtin "Ryumin-Light.Katakana") |
198 (bold builtin "GothicBBB-Medium.Katakana") | |
199 (bold-italic builtin "GothicBBB-Medium.Katakana")) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
200 (latin-jisx0201 |
89530 | 201 (normal builtin "Ryumin-Light.Hankaku") |
202 (bold builtin "GothicBBB-Medium.Hankaku")) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
203 (japanese-jisx0208 |
89530 | 204 (normal builtin "Ryumin-Light-H") |
205 (bold builtin "GothicBBB-Medium-H")) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
206 (korean-ksc5601 |
89530 | 207 (normal builtin "Munhwa-Regular-KSC-EUC-H") |
208 (bold builtin "Munhwa-Bold-KSC-EUC-H")) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
209 ) |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
210 "Sample setting of the `ps-mule-font-info-database' to use builtin PS font. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
211 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
212 Currently, data for Japanese and Korean PostScript printers are listed.") |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
213 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
214 (defconst ps-mule-font-info-database-bdf |
89530 | 215 '((iso-8859-1 |
216 (normal bdf ("lt1-24-etl.bdf" "etl24-latin1.bdf")) | |
217 (bold bdf ("lt1-16b-etl.bdf" "etl16b-latin1.bdf")) | |
218 (italic bdf ("lt1-16i-etl.bdf" "etl16i-latin1.bdf")) | |
219 (bold-italic bdf ("lt1-16bi-etl.bdf" "etl16bi-latin1.bdf"))) | |
220 (iso-8859-2 | |
221 (normal bdf ("lt2-24-etl.bdf" "etl24-latin2.bdf"))) | |
222 (iso-8859-3 | |
223 (normal bdf ("lt3-24-etl.bdf" "etl24-latin3.bdf"))) | |
224 (iso-8859-4 | |
225 (normal bdf ("lt4-24-etl.bdf" "etl24-latin4.bdf"))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
226 (thai-tis620 |
89530 | 227 (normal bdf ("thai24.bdf" "thai-24.bdf") iso-8859-11)) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
228 (greek-iso8859-7 |
89530 | 229 (normal bdf ("grk24-etl.bdf" "etl24-greek.bdf") iso-8859-7)) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
230 (hebrew-iso8859-8 |
89530 | 231 (normal bdf ("heb24-etl.bdf" "etl24-hebrew.bdf") iso-8859-8)) |
232 (jisx0201 | |
233 (normal bdf "12x24rk.bdf" jisx0201)) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
234 (cyrillic-iso8859-5 |
89530 | 235 (normal bdf ("cyr24-etl.bdf" "etl24-cyrillic.bdf") iso-8859-5)) |
236 (iso-8859-9 | |
237 (normal bdf ("lt5-24-etl.bdf" "etl24-latin5.bdf") iso-8859-9)) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
238 (chinese-gb2312 |
89530 | 239 (normal bdf "gb24st.bdf")) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
240 (japanese-jisx0208 |
89530 | 241 (normal bdf "jiskan24.bdf")) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
242 (korean-ksc5601 |
89530 | 243 (normal bdf "hanglm24.bdf")) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
244 (japanese-jisx0212 |
89530 | 245 (normal bdf ("jksp40.bdf" "jisksp40.bdf"))) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
246 (chinese-cns11643-1 |
89530 | 247 (normal bdf ("cns1-40.bdf" "cns-1-40.bdf"))) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
248 (chinese-cns11643-2 |
89530 | 249 (normal bdf ("cns2-40.bdf" "cns-2-40.bdf"))) |
250 (big5 | |
251 (normal bdf "taipei24.bdf")) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
252 (chinese-sisheng |
89530 | 253 (normal bdf ("sish24-etl.bdf" "etl24-sisheng.bdf"))) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
254 (ipa |
89530 | 255 (normal bdf ("ipa24-etl.bdf" "etl24-ipa.bdf") ipa)) |
256 (viscii | |
257 (normal bdf ("visc24-etl.bdf" "etl24-viscii.bdf"))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
258 (arabic-digit |
89530 | 259 (normal bdf ("arab24-0-etl.bdf" "etl24-arabic0.bdf"))) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
260 (arabic-1-column |
89530 | 261 (normal bdf ("arab24-1-etl.bdf" "etl24-arabic1.bdf"))) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
262 (lao |
89530 | 263 (normal bdf ("lao24-mule.bdf" "mule-lao-24.bdf") ps-mule-encode-lao 1)) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
264 (arabic-2-column |
89530 | 265 (normal bdf ("arab24-2-etl.bdf" "etl24-arabic2.bdf"))) |
266 (devanagari-cdac | |
267 (normal bdf "dvsr0ntt-32.bdf")) | |
268 (malayalam-cdac | |
269 (normal bdf "mlkr0ntt-32.bdf")) | |
270 (tamil-cdac | |
271 (normal bdf "tmvl0ntt-32.bdf")) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
272 (indian-is13194 |
89530 | 273 (normal bdf ("isci24-mule.bdf" "mule-iscii-24.bdf"))) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
274 (indian-1-column |
89530 | 275 (normal bdf ("ind1c24-mule.bdf" "mule-indian-1col-24.bdf"))) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
276 (ethiopic |
91996
a4c135399649
(ps-mule-font-info-database-bdf): Use
Kenichi Handa <handa@m17n.org>
parents:
91985
diff
changeset
|
277 (normal bdf ("ethio16f-uni.bdf" "ethiomx24f-uni.bdf") unicode-bmp)) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
278 (chinese-cns11643-3 |
89530 | 279 (normal bdf ("cns3-40.bdf" "cns-3-40.bdf"))) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
280 (chinese-cns11643-4 |
89530 | 281 (normal bdf ("cns4-40.bdf" "cns-4-40.bdf"))) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
282 (chinese-cns11643-5 |
89530 | 283 (normal bdf ("cns5-40.bdf" "cns-5-40.bdf"))) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
284 (chinese-cns11643-6 |
89530 | 285 (normal bdf ("cns6-40.bdf" "cns-6-40.bdf"))) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
286 (chinese-cns11643-7 |
89530 | 287 (normal bdf ("cns7-40.bdf" "cns-7-40.bdf"))) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
288 (indian-2-column |
89530 | 289 (normal bdf ("ind24-mule.bdf" "mule-indian-24.bdf"))) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
290 (tibetan |
89530 | 291 (normal bdf ("tib24p-mule.bdf" "tib24-mule.bdf" "mule-tibmdx-24.bdf"))) |
292 (unicode-bmp | |
293 (normal bdf "etl24-unicode.bdf")) | |
294 ) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
295 "Sample setting of the `ps-mule-font-info-database' to use BDF fonts. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
296 BDF (Bitmap Distribution Format) is a format used for distributing X's font |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
297 source file. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
298 |
45334
695ae1bd8fa4
(eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents:
39353
diff
changeset
|
299 Current default value list for BDF fonts is included in `intlfonts-1.2' |
695ae1bd8fa4
(eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents:
39353
diff
changeset
|
300 which is a collection of X11 fonts for all characters supported by Emacs. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
301 |
45334
695ae1bd8fa4
(eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents:
39353
diff
changeset
|
302 Using this list as default value to `ps-mule-font-info-database', all |
695ae1bd8fa4
(eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents:
39353
diff
changeset
|
303 characters including ASCII and Latin-1 are printed by BDF fonts. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
304 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
305 See also `ps-mule-font-info-database-ps-bdf'.") |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
306 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
307 (defconst ps-mule-font-info-database-ps-bdf |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
308 (cons (car ps-mule-font-info-database-latin) |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
309 (cdr (cdr ps-mule-font-info-database-bdf))) |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
310 "Sample setting of the `ps-mule-font-info-database' to use BDF fonts. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
311 |
45334
695ae1bd8fa4
(eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents:
39353
diff
changeset
|
312 Current default value list for BDF fonts is included in `intlfonts-1.2' |
695ae1bd8fa4
(eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents:
39353
diff
changeset
|
313 which is a collection of X11 fonts for all characters supported by Emacs. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
314 |
45334
695ae1bd8fa4
(eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents:
39353
diff
changeset
|
315 Using this list as default value to `ps-mule-font-info-database', all |
695ae1bd8fa4
(eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents:
39353
diff
changeset
|
316 characters except ASCII and Latin-1 characters are printed with BDF fonts. |
695ae1bd8fa4
(eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents:
39353
diff
changeset
|
317 ASCII and Latin-1 characters are printed with PostScript font specified |
695ae1bd8fa4
(eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents:
39353
diff
changeset
|
318 by `ps-font-family' and `ps-header-font-family'. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
319 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
320 See also `ps-mule-font-info-database-bdf'.") |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
321 |
110984
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
322 ;; Functions to access each element of FONT-SPEC. |
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
323 ;; |
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
324 ;; FONT-SPEC is a vector of this form: |
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
325 ;; [ID CHARSET FONT-ID FONT-SRC FONT-NAME ENCODING BYTES EXTRA-DATA] |
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
326 ;; Where |
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
327 ;; |
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
328 ;; ID is an identification number for this FONT-SPEC and is unique in the list. |
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
329 ;; |
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
330 ;; CHARSET, FONT-SRC, FONT-NAME, ENCODING, and BYTES are the same as those in |
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
331 ;; `ps-mule-font-info-database' (which see). |
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
332 ;; |
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
333 ;; EXTRA-DATA is a data attached by external libraries. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
334 |
89530 | 335 (defsubst ps-mule-font-spec-id (font-spec) (aref font-spec 0)) |
336 (defsubst ps-mule-font-spec-charset (font-spec) (aref font-spec 1)) | |
337 (defsubst ps-mule-font-spec-font-id (font-spec) (aref font-spec 2)) | |
338 (defsubst ps-mule-font-spec-src (font-spec) (aref font-spec 3)) | |
339 (defsubst ps-mule-font-spec-name (font-spec) (aref font-spec 4)) | |
340 (defsubst ps-mule-font-spec-set-name (font-spec name) | |
341 (aset font-spec 4 name)) | |
342 (defsubst ps-mule-font-spec-encoding (font-spec) (aref font-spec 5)) | |
343 (defsubst ps-mule-font-spec-bytes (font-spec) (aref font-spec 6)) | |
344 (defsubst ps-mule-font-spec-extra (font-spec) (aref font-spec 7)) | |
345 (defsubst ps-mule-font-spec-set-extra (font-spec extra) | |
346 (aset font-spec 7 extra)) | |
347 | |
348 ;; Functions to encode character into glyph code. | |
349 (defun ps-mule-encode-lao (char) | |
350 (- char #x0DE0)) | |
351 | |
352 (defun ps-mule-encode-char (char font-spec) | |
353 (let ((encoding (ps-mule-font-spec-encoding font-spec))) | |
354 (cond ((charsetp encoding) | |
355 (encode-char char encoding)) | |
356 ((fboundp encoding) | |
357 (funcall encoding char)) | |
358 (t | |
359 char)))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
360 |
89530 | 361 ;; Array of FONT-SPEC-TABLEs; Nth element is for FONT-TYPE N. |
362 ;; | |
363 ;; FONT-TYPE is 0, 1, 2, or 3 representing normal, bold, italic, and | |
364 ;; bold-italic respectively. | |
365 ;; | |
366 ;; FONT-SPEC-TABLE is a char-table of FONT-SPECs. It records which | |
367 ;; character is printed by which FONT-SPEC. It has one extra slot | |
368 ;; whose value is an alist of the form: | |
369 ;; (CHARSET . FONT-SPEC) | |
370 ;; FONT-SPEC is a vecotr of the form: | |
371 ;; (ID FONT-SRC FONT-NAME ENCODING EXTRA) | |
372 (defvar ps-mule-font-spec-tables nil) | |
373 | |
374 ;; Array of FONT-TYPEs; Nth element FONT-NUMBER N. | |
375 ;; | |
376 ;; FONT-NUMBER is 0, 1, 2, 3, 4, 5, 6 representing fonts f0, f1, f2, | |
377 ;; f3, h0, h1, and H0. | |
378 (defconst ps-mule-font-number-to-type [ 0 1 2 3 1 0 0 ]) | |
379 | |
380 (defsubst ps-mule-get-font-spec (char font-spec-table font-spec) | |
381 "Return a font spec for printing CHAR with FONT-SPEC-TABLE. | |
382 | |
383 FONT-SPEC, if non-nil, is a font spec to try at first. | |
384 | |
385 See the documentation of `ps-mule-font-spec-tables' for the | |
386 format of font spec." | |
387 | |
388 (or (aref font-spec-table char) | |
389 (aset font-spec-table char | |
390 (or (and (< char 256) | |
391 (cdr (car (char-table-extra-slot font-spec-table 0)))) | |
392 (and font-spec | |
393 (encode-char char (ps-mule-font-spec-charset font-spec)) | |
394 font-spec) | |
395 (catch 'tag | |
396 (dolist (elt (char-table-extra-slot font-spec-table 0)) | |
397 (and (encode-char char (car elt)) | |
398 (throw 'tag (cdr elt))))) | |
399 ;; Record that no font-spec exist for CHAR. | |
400 t)))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
401 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
402 (defconst ps-mule-external-libraries |
90989
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
403 '((builtin nil nil nil |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
404 nil nil nil) |
90989
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
405 (bdf ps-bdf nil bdf-generate-prologue |
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
406 bdf-check-font bdf-generate-font bdf-generate-glyph) |
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
407 (pcf nil nil pcf-generate-prologue |
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
408 pcf-check-font pcf-generate-font pcf-generate-glyph) |
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
409 (vflib nil nil vflib-generate-prologue |
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
410 vflib-check-font vflib-generate-font vflib-generate-glyphs)) |
82108
fb40f60f0ab3
Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82107
diff
changeset
|
411 "Alist of external libraries information to support PostScript printing. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
412 Each element has the form: |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
413 |
90989
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
414 (FONT-SRC FEATURE INITIALIZED-P PROLOGUE-FUNC |
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
415 CHECK-FUNC FONT-FUNC GLYPH-FUNC) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
416 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
417 FONT-SRC is the font source: builtin, bdf, pcf, or vflib. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
418 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
419 FEATURE is the feature that provide a facility to handle FONT-SRC. Except for |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
420 `builtin' FONT-SRC, this feature is automatically `require'd before handling |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
421 FONT-SRC. Currently, we only have the feature `ps-bdf'. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
422 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
423 INITIALIZED-P indicates if this library is initialized or not. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
424 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
425 PROLOGUE-FUNC is a function to generate PostScript code which define several |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
426 PostScript procedures that will be called by FONT-FUNC and GLYPHS-FUNC. It is |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
427 called with no argument, and should return a list of strings. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
428 |
89530 | 429 CHECK-FUNC is a function to check if a font is available or not. |
94741
766d27d2c19f
(ps-mule-external-libraries): Don't use `iff' in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
94678
diff
changeset
|
430 It is called with one argument FONT-SPEC, and should return non-nil if and |
766d27d2c19f
(ps-mule-external-libraries): Don't use `iff' in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
94678
diff
changeset
|
431 only if the font specified in FONT-SPEC is available. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
432 |
82108
fb40f60f0ab3
Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82107
diff
changeset
|
433 FONT-FUNC is a function to generate PostScript code which define a new font. |
fb40f60f0ab3
Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82107
diff
changeset
|
434 It is called with one argument FONT-SPEC, and should return a list of strings. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
435 |
90989
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
436 GLYPH-FUNC is a function to generate PostScript code which define glyphs of |
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
437 characters. It is called with two arguments FONT-SPEC and CODE, and should |
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
438 return a list of strings.") |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
439 |
89530 | 440 (defsubst ps-mule-exlib-feature (exlib) (nth 1 exlib)) |
441 (defsubst ps-mule-exlib-initialized-p (exlib) (nth 2 exlib)) | |
442 (defsubst ps-mule-exlib-set-initialized-p (exlib val) | |
443 (setcar (nthcdr 2 exlib) val)) | |
444 (defsubst ps-mule-exlib-prologue (exlib) (nth 3 exlib)) | |
445 (defsubst ps-mule-exlib-check (exlib) (nth 4 exlib)) | |
446 (defsubst ps-mule-exlib-font (exlib) (nth 5 exlib)) | |
447 (defsubst ps-mule-exlib-glyph (exlib) (nth 6 exlib)) | |
37137
b960119b9c18
XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
30561
diff
changeset
|
448 |
89530 | 449 (defun ps-mule-init-external-library (exlib) |
450 "Initialize external library specified by EXLIB for PostScript printing. | |
451 See the documentation of `ps-mule-external-libraries' for EXLIB's meaning." | |
452 (or (ps-mule-exlib-initialized-p exlib) | |
453 (let ((prologue-func (ps-mule-exlib-prologue exlib))) | |
454 (if prologue-func | |
455 (let ((feature (ps-mule-exlib-feature exlib))) | |
456 (if feature | |
457 (require feature)) | |
458 (ps-output-prologue (funcall prologue-func)))) | |
459 (ps-mule-exlib-set-initialized-p exlib t)))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
460 |
89530 | 461 (defvar ps-mule-output-list nil) |
462 | |
463 (defun ps-mule-check-font (font-spec) | |
464 "Check if a font specified in FONT-SPEC is available or not." | |
465 (let ((font-src (ps-mule-font-spec-src font-spec))) | |
466 (or (not font-src) | |
467 (let ((exlib (assq font-src ps-mule-external-libraries))) | |
468 (ps-mule-init-external-library exlib) | |
469 (or (not (ps-mule-exlib-check exlib)) | |
470 (funcall (ps-mule-exlib-check exlib) font-spec)))))) | |
471 | |
472 (defun ps-mule-prepare-font (font-spec) | |
90989
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
473 "Generate PostScript codes defining a new font of FONT-SPEC for charset." |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
474 (let* ((font-src (ps-mule-font-spec-src font-spec)) |
89530 | 475 (exlib (assq font-src ps-mule-external-libraries)) |
476 (id (ps-mule-font-spec-id font-spec)) | |
477 (ftag (format "%02X" id)) | |
478 (font-func (ps-mule-exlib-font exlib)) | |
479 output-list) | |
480 (if font-func | |
481 (setq output-list (funcall font-func font-spec)) | |
482 (setq output-list | |
483 (format "/F%s /%s findfont def\n" | |
484 ftag (or (ps-mule-font-spec-name font-spec) "Courier"))) | |
485 (ps-mule-font-spec-set-extra font-spec t)) | |
486 (and output-list | |
487 (nconc ps-mule-output-list (list output-list))))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
488 |
89530 | 489 (defun ps-mule-prepare-glyph (char font-spec) |
490 "Generate PostScript codes to print CHAR by FONT-SPEC. | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
491 |
89530 | 492 If CHAR is a cons (FROM TO), generate codes for characters |
493 specified by the character code range FROM and TO. | |
37137
b960119b9c18
XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
30561
diff
changeset
|
494 |
89530 | 495 The generated code is inserted on prologue part." |
496 (if (vectorp font-spec) | |
497 (progn | |
498 (or (ps-mule-font-spec-extra font-spec) | |
499 (ps-mule-prepare-font font-spec)) | |
500 (let ((glyph-func (ps-mule-exlib-glyph | |
501 (assq (ps-mule-font-spec-src font-spec) | |
502 ps-mule-external-libraries)))) | |
503 (if glyph-func | |
504 (let (from to output-list) | |
505 (if (consp char) | |
506 (setq from (car char) to (cdr char)) | |
507 (setq from char to char)) | |
508 (while (<= from to) | |
509 (setq output-list | |
510 (funcall glyph-func font-spec from)) | |
511 (and output-list | |
512 (ps-output-prologue output-list)) | |
513 (setq from (1+ from))))))))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
514 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
515 ;; This is a PostScript code inserted in the header of generated PostScript. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
516 (defconst ps-mule-prologue |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
517 "%%%% Start of Mule Section |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
518 |
89534 | 519 /Latin1Encoding { % newname fontname | font |
520 findfont dup length dict begin | |
521 { 1 index /FID ne { def } { pop pop } ifelse } forall | |
522 /Encoding ISOLatin1Encoding def | |
523 currentdict | |
524 end | |
525 definefont | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
526 } bind def |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
527 |
89530 | 528 %% Redefine fonts for multiple charsets. |
529 /ReDefFont { % fontname encoding fdepvector size | - | |
530 20 dict begin | |
531 3 index findfont { | |
532 1 index /FID ne 2 index /UniqueID ne and {def} {pop pop} ifelse | |
533 } forall | |
534 /FontType 0 def | |
535 /FMapType 3 def | |
536 /EscChar 0 def | |
537 % FontMatrix ::= [ size 0 0 size 0 0 ] | |
538 /FontMatrix exch [ exch dup 0 exch 0 exch 0 0 ] def | |
539 /FDepVector exch def | |
540 /Encoding exch def | |
541 currentdict | |
542 end % fontname dic | |
543 definefont pop | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
544 } bind def |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
545 " |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
546 "PostScript code for printing multi-byte characters.") |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
547 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
548 (defvar ps-mule-prologue-generated nil) |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
549 |
89530 | 550 ;; EscChar used in generated composite fonts. |
551 (defconst ps-mule-esc-char 0) | |
552 | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
553 (defun ps-mule-prologue-generated () |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
554 (unless ps-mule-prologue-generated |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
555 (ps-output-prologue ps-mule-prologue) |
90989
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
556 (ps-output-prologue |
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
557 (format "\n/EscChar %d def\n\n%%%% End of Mule Section\n\n" |
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
558 ps-mule-esc-char)) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
559 (setq ps-mule-prologue-generated t))) |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
560 |
89530 | 561 (defun ps-mule-encode-region (from to font-spec-table) |
562 "Generate PostScript code for plotting characters in the region FROM and TO. | |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
563 |
90989
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
564 FONT-SPEC-TABLE is 0, 1, 2, 3, 4, 5, or 6, each represents font tags f0, f1, |
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
565 f2, f3, h0, h1, and H0 respectively." |
89530 | 566 (let* ((font-spec nil) |
567 (font-id 0) | |
91985
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
568 (code-list nil)) |
89530 | 569 (goto-char from) |
570 (while (< (point) to) | |
571 (let* ((char (following-char)) | |
572 (this-spec (ps-mule-get-font-spec char font-spec-table font-spec)) | |
573 this-id) | |
574 (if (vectorp this-spec) | |
575 (setq this-id (ps-mule-font-spec-font-id this-spec)) | |
576 ;; Can't print CHAR. Replace it with '?'. | |
577 (setq char ?? | |
578 this-spec (ps-mule-get-font-spec char font-spec-table nil) | |
579 this-id (ps-mule-font-spec-font-id this-spec))) | |
91985
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
580 (unless (= font-id this-id) |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
581 (setq font-id this-id) |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
582 (push ps-mule-esc-char code-list) |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
583 (push font-id code-list)) |
89530 | 584 (setq font-spec this-spec) |
585 (if (< char 128) | |
91985
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
586 (push char code-list) |
89530 | 587 (let* ((code (ps-mule-encode-char char font-spec))) |
588 (if (= (ps-mule-font-spec-bytes font-spec) 1) | |
91985
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
589 (push code code-list) |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
590 (push (/ code 256) code-list) |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
591 (push (% code 256) code-list)))) |
89530 | 592 (forward-char 1))) |
91985
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
593 (apply 'unibyte-string (nreverse code-list)))) |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
594 |
89530 | 595 (defun ps-mule-plot-composition (composition font-spec-table) |
90989
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
596 "Generate PostScript code for plotting COMPOSITION with FONT-SPEC-TABLE." |
89530 | 597 (ps-output "[") |
598 (let ((components (copy-sequence (nth 2 composition))) | |
599 (font-spec nil)) | |
600 (dotimes (i (length components)) | |
601 (let ((elt (aref components i)) | |
602 this-spec) | |
603 (if (consp elt) | |
604 ;; ELT is a composition rule. | |
605 (ps-output (format " %d" (encode-composition-rule elt))) | |
606 ;; ELT is a glyph character. | |
607 (setq this-spec | |
608 (ps-mule-get-font-spec elt font-spec-table font-spec)) | |
609 (or (vectorp this-spec) | |
610 ;; Can't print CHAR. Replace it with '?'. | |
611 (setq elt ?? | |
612 this-spec | |
613 (ps-mule-get-font-spec elt font-spec-table font-spec))) | |
614 (setq font-spec this-spec) | |
615 (let* ((bytes (ps-mule-font-spec-bytes font-spec)) | |
616 (code (ps-mule-encode-char elt font-spec)) | |
617 (font-id (ps-mule-font-spec-font-id font-spec)) | |
618 (str (make-string (if (= font-id 0) 1 (+ 2 bytes)) 0))) | |
619 (if (= font-id 0) | |
90328
05b8b8dd212b
(ps-mule-eight-bit-char): Delete this function.
Kenichi Handa <handa@m17n.org>
parents:
90294
diff
changeset
|
620 (aset str 0 code) |
89530 | 621 (aset str 0 ps-mule-esc-char) |
90328
05b8b8dd212b
(ps-mule-eight-bit-char): Delete this function.
Kenichi Handa <handa@m17n.org>
parents:
90294
diff
changeset
|
622 (aset str 1 font-id) |
89530 | 623 (if (= bytes 1) |
90328
05b8b8dd212b
(ps-mule-eight-bit-char): Delete this function.
Kenichi Handa <handa@m17n.org>
parents:
90294
diff
changeset
|
624 (aset str 2 code) |
05b8b8dd212b
(ps-mule-eight-bit-char): Delete this function.
Kenichi Handa <handa@m17n.org>
parents:
90294
diff
changeset
|
625 (aset str 2 (/ code 256)) |
05b8b8dd212b
(ps-mule-eight-bit-char): Delete this function.
Kenichi Handa <handa@m17n.org>
parents:
90294
diff
changeset
|
626 (aset str 3 (% code 256)))) |
89530 | 627 (ps-output "[") |
628 (ps-output-string str) | |
629 (ps-output (if (eq (ps-mule-font-spec-src font-spec) 'bdf) | |
630 (format "/C%02X-%X" (ps-mule-font-spec-id font-spec) | |
631 elt) | |
632 "false")) | |
633 (ps-output "]")))))) | |
634 (ps-output " ] " (if (nth 3 composition) "RLC" "RBC") "\n")) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
635 |
89530 | 636 (defun ps-mule-plot-string (from to &optional bg-color) |
637 "Generate PostScript code for plotting characters in the region FROM and TO. | |
638 | |
639 Optional argument BG-COLOR is ignored. | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
640 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
641 Returns the value: |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
642 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
643 (ENDPOS . RUN-WIDTH) |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
644 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
645 Where ENDPOS is the end position of the sequence and RUN-WIDTH is the width of |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
646 the sequence." |
89530 | 647 (let* ((average-width (ps-avg-char-width 'ps-font-for-text)) |
648 (point (point)) | |
649 (composition (find-composition from to nil t)) | |
91996
a4c135399649
(ps-mule-font-info-database-bdf): Use
Kenichi Handa <handa@m17n.org>
parents:
91985
diff
changeset
|
650 (stop (if (and composition |
a4c135399649
(ps-mule-font-info-database-bdf): Use
Kenichi Handa <handa@m17n.org>
parents:
91985
diff
changeset
|
651 (not (vectorp (aref (nth 2 composition) 0)))) |
a4c135399649
(ps-mule-font-info-database-bdf): Use
Kenichi Handa <handa@m17n.org>
parents:
91985
diff
changeset
|
652 (car composition) |
a4c135399649
(ps-mule-font-info-database-bdf): Use
Kenichi Handa <handa@m17n.org>
parents:
91985
diff
changeset
|
653 to)) |
89530 | 654 (ascii-or-latin-1 "[\000-\377]+") |
655 (run-width 0) | |
656 (endpos nil) | |
657 (font-spec-table (aref ps-mule-font-spec-tables | |
658 (aref ps-mule-font-number-to-type | |
659 ps-current-font))) | |
660 width) | |
661 (goto-char from) | |
662 (while (not endpos) | |
663 (cond ((= (point) stop) | |
664 (if (= stop to) | |
665 (setq endpos stop) | |
91985
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
666 (when (< from stop) |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
667 (ps-output-string (ps-mule-encode-region from (point) |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
668 font-spec-table)) |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
669 (ps-output " S\n")) |
89530 | 670 (setq width (* (nth 5 composition) average-width)) |
671 (if (< ps-width-remaining (+ run-width width)) | |
672 (setq endpos stop) | |
673 (ps-mule-plot-composition composition font-spec-table) | |
674 (setq run-width (+ run-width width) | |
675 from (nth 1 composition)) | |
676 (goto-char from) | |
677 (setq composition (find-composition (point) to nil t)) | |
678 (setq stop (if composition (car composition) to))))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
679 |
89530 | 680 ((looking-at ascii-or-latin-1) |
681 (let ((nchars (- (min (match-end 0) stop) (point)))) | |
682 (setq width (* average-width nchars)) | |
683 (if (< ps-width-remaining (+ run-width width)) | |
684 (setq nchars (truncate (- ps-width-remaining run-width) | |
685 average-width) | |
686 run-width (+ run-width (* nchars average-width)) | |
687 endpos (+ (point) nchars)) | |
688 (setq run-width (+ run-width width)) | |
689 (forward-char nchars)))) | |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
690 |
89530 | 691 (t |
692 (while (and (< (point) stop) (not endpos)) | |
693 (setq width (char-width (following-char))) | |
694 (if (< ps-width-remaining (+ run-width width)) | |
695 (setq endpos (point)) | |
696 (setq run-width (+ run-width width)) | |
697 (forward-char 1)))))) | |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
698 |
91985
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
699 (when (< from endpos) |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
700 (ps-output-string (ps-mule-encode-region from endpos font-spec-table)) |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
701 (ps-output " S\n")) |
89530 | 702 (goto-char point) |
703 (cons endpos run-width))) | |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
704 |
89530 | 705 ;; Character composition support |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
706 |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
707 (defvar ps-mule-composition-prologue-generated nil) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
708 |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
709 (defconst ps-mule-composition-prologue |
89530 | 710 "%%%% Procedures for character composition. |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
711 /RelativeCompositionSkip 0.4 def |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
712 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
713 %% Get a bounding box (relative to currentpoint) of STR. |
89530 | 714 /GetPathBox { % [ str cname ] | - |
715 dup 1 get dup false ne { | |
716 BitmapDict exch get /bmp exch def | |
717 %% bmp ::= [ DWIDTH WIDTH HEIGHT XOFF YOFF BITMAP RELATIVE-COMPOSE] | |
718 /LLY bmp 4 get def | |
719 /URY LLY bmp 2 get add def | |
720 /RelativeCompose bmp 6 get dup false ne { | |
721 dup LLY le { pop 1 } { URY ge { -1 } { 0 } ifelse } ifelse | |
722 } { | |
723 pop 0 | |
724 } ifelse def | |
725 dup 0 get stringwidth pop dup /WIDTH exch def bmp 0 get div | |
726 dup LLY mul /LLY exch def | |
94741
766d27d2c19f
(ps-mule-external-libraries): Don't use `iff' in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
94678
diff
changeset
|
727 URY mul /URY exch def |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
728 } { |
89530 | 729 pop |
730 dup 0 get stringwidth pop /WIDTH exch def | |
731 gsave 0 0 moveto | |
732 dup 0 get false charpath flattenpath pathbbox | |
733 /URY exch def pop /LLY exch def pop | |
734 grestore | |
735 /RelativeCompose 0 def | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
736 } ifelse |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
737 } bind def |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
738 |
89530 | 739 %% Apply effects except for shadow and outline to the rectangle |
740 %% specified by TOP BOTTOM LEFT RIGHT. | |
741 /SpecialEffect { % -- | -- | |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
742 currentpoint dup TOP add /yy exch def BOTTOM add /YY exch def |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
743 dup LEFT add /xx exch def RIGHT add /XX exch def |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
744 %% Adjust positions for future shadowing. |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
745 Effect 8 and 0 ne { |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
746 /yy yy Yshadow add def |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
747 /XX XX Xshadow add def |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
748 } if |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
749 Effect 1 and 0 ne { UnderlinePosition Hline } if % underline |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
750 Effect 2 and 0 ne { StrikeoutPosition Hline } if % strikeout |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
751 Effect 4 and 0 ne { OverlinePosition Hline } if % overline |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
752 bg { % background |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
753 true |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
754 Effect 16 and 0 ne {SpaceBackground doBox} { xx yy XX YY doRect} ifelse |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
755 } if |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
756 Effect 16 and 0 ne { false 0 doBox } if % box |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
757 } def |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
758 |
89530 | 759 %% Draw COMPONENTS which has the form [ [str0 xoff0 yoff0] ... ] with |
760 %% effects shadow and outline. | |
761 /ShowComponents { % components | - | |
762 gsave | |
763 { gsave aload pop rmoveto | |
764 Effect 8 and 0 ne { dup doShadow } if | |
765 Effect 32 and 0 ne { true doOutline } { show } ifelse | |
766 grestore | |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
767 } forall |
89530 | 768 grestore |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
769 RIGHT 0 rmoveto |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
770 } def |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
771 |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
772 %% Show relative composition. |
89530 | 773 /RLC { % [[str0 cname0] [str1 cname1] ... [strN cnameN]] | - |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
774 /components exch def |
89530 | 775 [ % push [str xoff yoff] one by one |
776 [ components 0 get GetPathBox aload pop pop 0 0 ] | |
777 %% Bounding box of overall glyphs. | |
778 /LEFT 0 def | |
779 /RIGHT WIDTH def | |
780 /TOP URY def | |
781 /BOTTOM LLY def | |
94741
766d27d2c19f
(ps-mule-external-libraries): Don't use `iff' in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
94678
diff
changeset
|
782 |
89530 | 783 1 1 components length 1 sub { |
784 components exch get | |
785 [ exch | |
786 GetPathBox | |
787 aload pop pop % str | |
788 0 % xoff | |
789 RelativeCompose 1 eq { % compose on TOP | |
790 TOP LLY sub RelativeCompositionSkip add % yoff | |
791 /TOP TOP URY LLY sub add RelativeCompositionSkip add def | |
792 } { RelativeCompose -1 eq { % compose under BOTTOM | |
793 BOTTOM URY sub RelativeCompositionSkip sub % yoff | |
794 /BOTTOM BOTTOM URY LLY sub sub | |
795 RelativeCompositionSkip sub def | |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
796 } { |
89530 | 797 0 % yoff |
798 URY TOP gt { /TOP URY def } if | |
799 LLY BOTTOM lt { /BOTTOM LLY def } if | |
800 } ifelse } ifelse | |
801 ] | |
802 } for | |
803 ] | |
804 SpecialEffect % Reflect special effects. | |
805 ShowComponents % Draw components. | |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
806 } def |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
807 |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
808 %% Show rule-base composition. |
89530 | 809 /RBC { % [[str0 cname0] rule1 [str1 cname0] rule2 ... [strN cnameN]] | - |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
810 /components exch def |
89530 | 811 [ % push [str xoff yoff] one by one |
812 [ components 0 get GetPathBox aload pop pop 0 0 ] | |
813 %% Bounding box of overall glyphs. | |
814 /LEFT 0 def | |
815 /RIGHT WIDTH def | |
816 /TOP URY def | |
817 /BOTTOM LLY def | |
818 1 1 components length 1 sub { | |
819 components exch get /elt exch def | |
820 elt type /integertype eq { % rule | |
821 %% Do the same RULE decoding as the macro | |
37137
b960119b9c18
XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
30561
diff
changeset
|
822 %% COMPOSITION_DECODE_RULE in emacs/src/composite.h. |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
823 elt 12 idiv dup 3 mod /grefx exch def 3 idiv /grefy exch def |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
824 elt 12 mod dup 3 mod /nrefx exch def 3 idiv /nrefy exch def |
89530 | 825 } { % other strings |
826 [ | |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
827 elt GetPathBox |
89530 | 828 aload pop pop |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
829 /height URY LLY sub def |
89530 | 830 /left LEFT [ 0 RIGHT LEFT sub dup 2 div exch ] grefx get add |
831 [ 0 WIDTH 2 div WIDTH ] nrefx get sub def | |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
832 /bottom [ TOP 0 BOTTOM TOP BOTTOM add 2 div ] grefy get |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
833 [ height LLY neg 0 height 2 div ] nrefy get sub def |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
834 %% Update bounding box |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
835 left LEFT lt { /LEFT left def } if |
89530 | 836 left WIDTH add RIGHT gt { /RIGHT left WIDTH add def } if |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
837 bottom BOTTOM lt { /BOTTOM bottom def } if |
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
838 bottom height add TOP gt { /TOP bottom height add def } if |
89530 | 839 left bottom LLY sub ] |
840 } ifelse | |
841 } for | |
842 ] | |
38855
db1312628833
(find-composition): Check if (char-after POS)
Gerd Moellmann <gerd@gnu.org>
parents:
38816
diff
changeset
|
843 |
89530 | 844 LEFT 0 lt { % Adjust xoff to the right. |
845 dup { dup 1 get LEFT sub 1 exch put } forall | |
846 /RIGHT RIGHT LEFT sub def | |
847 } if | |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
848 |
89530 | 849 SpecialEffect % Reflect special effects. |
850 ShowComponents % Draw components. | |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
851 } def |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
852 |
89530 | 853 %%%% End of procedures for character composition |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
854 " |
37137
b960119b9c18
XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
30561
diff
changeset
|
855 "PostScript code for printing character composition.") |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
856 |
89530 | 857 (defun ps-mule-composition-prologue-generated () |
858 (unless ps-mule-composition-prologue-generated | |
859 (ps-mule-prologue-generated) | |
860 (ps-output-prologue ps-mule-composition-prologue) | |
861 (setq ps-mule-composition-prologue-generated t))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
862 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
863 ;; Bitmap font support |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
864 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
865 (defvar ps-mule-bitmap-prologue-generated nil) |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
866 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
867 (defconst ps-mule-bitmap-prologue |
89530 | 868 "%%%% Procedures for bitmap fonts. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
869 |
89530 | 870 %% Create a base bitmap font. |
871 /NBF { % fontname fontsize relative-compose baseline-offset enc | -- | |
872 11 dict begin | |
873 /FontType 3 def | |
874 /FontMatrix matrix def | |
875 /FontBBox [ 0 0 0 0 ] def | |
876 /Encoding exch def | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
877 /BaselineOffset exch def |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
878 /RelativeCompose exch def |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
879 /FontSize exch def |
89530 | 880 /FontMatrix [ 1 FontSize div 0 0 1 FontSize div 0 0 ] def |
881 /BuildGlyph { % fontdict charname | - | |
882 BitmapDict exch get /bmp exch def pop | |
883 %% bmp ::= [ DWIDTH WIDTH HEIGHT XOFF YOFF BITMAP RELATIVE-COMPOSE ] | |
884 /llx bmp 3 get def | |
885 /lly bmp 4 get def | |
886 /urx llx bmp 1 get add def | |
887 /ury lly bmp 2 get add def | |
888 bmp 0 get 0 llx lly urx ury setcachedevice | |
889 bmp 5 get length 0 gt { | |
890 llx ury translate | |
891 bmp 1 get bmp 2 get | |
892 true [ 1 0 0 -1 0 0 ] { bmp 5 get } imagemask | |
893 } if | |
894 } bind def | |
895 /BuildChar { % fontdict byte | - | |
896 1 index /Encoding get exch get | |
897 1 index /BuildGlyph get exec | |
898 } bind def | |
899 dup currentdict end | |
900 definefont def | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
901 } bind def |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
902 |
89530 | 903 %% Create a parent font of 8/8 mapping. |
904 /NPF { % fontname encoding fdepvector | - | |
905 8 dict begin | |
906 /FontType 0 def | |
907 /FMapType 2 def | |
908 /FontMatrix matrix def | |
909 /FDepVector exch def | |
910 /Encoding exch def | |
911 dup currentdict | |
912 end | |
913 definefont def | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
914 } bind def |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
915 |
89530 | 916 %%%% End of procedures for bitmap fonts. |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
917 ") |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
918 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
919 ;; External library support. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
920 |
89530 | 921 (defvar ps-mule-bitmap-dict-list nil) |
89532 | 922 (defvar ps-mule-bitmap-font-record nil) |
89530 | 923 |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
924 ;; The following three functions are to be called from external |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
925 ;; libraries which support bitmap fonts (e.g. `bdf') to get |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
926 ;; appropriate PostScript code. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
927 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
928 (defun ps-mule-generate-bitmap-prologue () |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
929 (unless ps-mule-bitmap-prologue-generated |
89530 | 930 (setq ps-mule-bitmap-prologue-generated t |
931 ps-mule-bitmap-dict-list nil | |
932 ps-mule-bitmap-font-record (make-vector 1024 nil)) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
933 (list ps-mule-bitmap-prologue))) |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
934 |
89530 | 935 (defun ps-mule-generate-bitmap-font (font-spec size relative-compose |
936 baselie-offset bbx) | |
937 (let* ((id (ps-mule-font-spec-id font-spec)) | |
938 (bytes (ps-mule-font-spec-bytes font-spec)) | |
939 output-list) | |
940 (if (= bytes 1) | |
941 (setq output-list | |
942 (list (format "/E%02X [ 0 1 255 {pop /.notdef} for ] def\n" id) | |
943 (format "%%%% %s\n" (ps-mule-font-spec-name font-spec)) | |
944 (format "/F%02X %f %S %d E%02X NBF\n" id size | |
945 relative-compose baselie-offset id))) | |
946 (setq output-list | |
947 (list (list (format "/E%02X [ 0 1 255 { pop 0 } for ] def\n" id)) | |
948 (list (format "/V%02X [" id)) | |
949 " ] def\n" | |
950 (format "%%%% %s\n" (ps-mule-font-spec-name font-spec)) | |
951 (format "/F%02X E%02X V%02X NPF\n" id id id)))) | |
952 (aset ps-mule-bitmap-font-record id | |
953 (vector (= bytes 1) output-list | |
954 size relative-compose baselie-offset bbx)) | |
955 (if ps-mule-bitmap-dict-list | |
956 output-list | |
957 (setq ps-mule-bitmap-dict-list (list "/BitmapDict <<\n" ">> def\n")) | |
958 (cons ps-mule-bitmap-dict-list output-list)))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
959 |
89530 | 960 (defun ps-mule-generate-bitmap-glyph (font-spec char code bitmap) |
961 (let* ((id (ps-mule-font-spec-id font-spec)) | |
94741
766d27d2c19f
(ps-mule-external-libraries): Don't use `iff' in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
94678
diff
changeset
|
962 ;; FONT-RECORD ::= ([(SUBFONT-OUTPUT-LIST ...) | t] |
89530 | 963 ;; BASEFONT-OUTPUT-LIST SIZE REL-COMP B-OFFSET BBX) |
964 (font-record (aref ps-mule-bitmap-font-record id)) | |
965 enc-name | |
966 output-list) | |
967 (if (listp (aref font-record 0)) | |
968 ;; This is a 2-dimensional font. Create a subfont for this | |
969 ;; glyph if not yet created. | |
970 (let* ((high (/ code 256)) | |
971 (id2 (+ (* id 256) high))) | |
972 (setq output-list (cdr (assq high (aref font-record 0))) | |
973 code (% code 256)) | |
974 (or output-list | |
975 ;; We must create a subfont. | |
976 (let ((enc-list (car (aref font-record 1))) | |
977 (fdep-list (nth 1 (aref font-record 1)))) | |
978 (setq output-list | |
979 (list | |
980 (format "/E%04X [ 0 1 255 {pop /.notdef} for ] def\n" | |
981 id2) | |
982 (format "/F%04X %f %S %d E%04X NBF\n" | |
983 id2 (aref font-record 2) (aref font-record 3) | |
984 (aref font-record 4) id2) | |
985 (format "E%02X %d %d put\n" | |
986 id high (1- (length fdep-list))))) | |
987 (nconc enc-list (list output-list)) | |
988 (nconc fdep-list (list (format " F%04X" id2))) | |
989 (aset font-record 0 | |
990 (cons (cons high output-list) (aref font-record 0))))) | |
991 (setq enc-name (format "%04X" id2))) | |
992 (setq output-list (aref font-record 1) | |
993 enc-name (format "%02X" id))) | |
994 (setcdr ps-mule-bitmap-dict-list | |
995 (cons (format "/C%02X-%X %s\n" id char bitmap) | |
996 (cdr ps-mule-bitmap-dict-list))) | |
997 (setcdr output-list | |
998 (cons (format "E%s %d /C%02X-%X put\n" enc-name code id char) | |
999 (cdr output-list)))) | |
1000 nil) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1001 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1002 ;; Mule specific initializers. |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1003 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1004 ;;;###autoload |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1005 (defun ps-mule-initialize () |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1006 "Initialize global data for printing multi-byte characters." |
89530 | 1007 (setq ps-mule-prologue-generated nil |
26882
5b331ff3b477
Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents:
26512
diff
changeset
|
1008 ps-mule-composition-prologue-generated nil |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1009 ps-mule-bitmap-prologue-generated nil) |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1010 (mapcar `(lambda (x) (setcar (nthcdr 2 x) nil)) |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1011 ps-mule-external-libraries)) |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1012 |
37137
b960119b9c18
XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
30561
diff
changeset
|
1013 (defun ps-mule-encode-header-string (string fonttag) |
b960119b9c18
XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
30561
diff
changeset
|
1014 "Generate PostScript code for ploting STRING by font FONTTAG. |
90989
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
1015 FONTTAG should be a string \"/h0\", \"/h1\", \"/L0\", or \"/H0\". |
1a04225b86b9
Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
90979
diff
changeset
|
1016 Any other value is treated as \"/H0\"." |
89530 | 1017 (with-temp-buffer |
1018 (insert string) | |
91985
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
1019 (list (ps-mule-encode-region (point-min) (point-max) |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
1020 (aref ps-mule-font-spec-tables |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
1021 (aref ps-mule-font-number-to-type |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
1022 (cond ((string= fonttag "/h0") 4) |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
1023 ((string= fonttag "/h1") 5) |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
1024 ((string= fonttag "/L0") 6) |
a5480cd50c15
(ps-mule-encode-region): Return a single string.
Kenichi Handa <handa@m17n.org>
parents:
91327
diff
changeset
|
1025 (t 0)))))))) |
37137
b960119b9c18
XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
30561
diff
changeset
|
1026 |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1027 ;;;###autoload |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1028 (defun ps-mule-begin-job (from to) |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1029 "Start printing job for multi-byte chars between FROM and TO. |
82108
fb40f60f0ab3
Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents:
82107
diff
changeset
|
1030 It checks if all multi-byte characters in the region are printable or not." |
89530 | 1031 (if (and (not (find-composition from to)) |
1032 (save-excursion | |
1033 (goto-char from) | |
110984
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
1034 (= (skip-chars-forward "\x00-\x7F" to) to))) |
89530 | 1035 ;; All characters can be printed by normal PostScript fonts. |
1036 (setq ps-basic-plot-string-function 'ps-basic-plot-string | |
1037 ps-encode-header-string-function 'identity) | |
1038 (setq ps-basic-plot-string-function 'ps-mule-plot-string | |
1039 ps-encode-header-string-function 'ps-mule-encode-header-string | |
1040 ps-mule-font-info-database | |
1041 (cond ((eq ps-multibyte-buffer 'non-latin-printer) | |
1042 ps-mule-font-info-database-ps) | |
1043 ((eq ps-multibyte-buffer 'bdf-font) | |
1044 ps-mule-font-info-database-bdf) | |
1045 ((eq ps-multibyte-buffer 'bdf-font-except-latin) | |
1046 ps-mule-font-info-database-ps-bdf) | |
1047 (t | |
1048 ps-mule-font-info-database-default))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1049 |
89530 | 1050 ;; Be sure to have font information for Latin-1. |
1051 (or (assq 'iso-8859-1 ps-mule-font-info-database) | |
1052 (setq ps-mule-font-info-database | |
89533
2b2e7811f38e
(ps-mule-begin-job): Fix previous change.
Kenichi Handa <handa@m17n.org>
parents:
89532
diff
changeset
|
1053 (cons '(iso-8859-1 (normal nil nil)) |
89530 | 1054 ps-mule-font-info-database))) |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1055 |
89530 | 1056 ;; Generate ps-mule-font-spec-tables. |
1057 (let ((font-spec-alist (make-vector 4 nil)) | |
1058 (id-max 0) | |
1059 (font-id 0) | |
1060 font-info-list) | |
1061 ;; Generate properly ordered font-info-list from | |
1062 ;; ps-mule-font-info-database. | |
1063 (let ((charset-list | |
1064 (copy-sequence (get-language-info current-language-environment | |
1065 'charset)))) | |
1066 (setq charset-list (cons 'iso-8859-1 (delq 'iso-8859-1 charset-list))) | |
1067 (dolist (charset charset-list) | |
1068 (let ((font-info (assq charset ps-mule-font-info-database))) | |
1069 (and font-info | |
1070 (setq font-info-list (cons font-info font-info-list))))) | |
1071 (dolist (font-info ps-mule-font-info-database) | |
1072 (or (memq (car font-info) charset-list) | |
1073 (setq font-info-list (cons font-info font-info-list)))) | |
1074 (setq font-info-list (nreverse font-info-list))) | |
60201
0d38d6148c13
(ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents:
56986
diff
changeset
|
1075 |
110984
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
1076 ;; Now font-info-list is an alist ordered by charset priority. |
89530 | 1077 ;; Store FONT-SPECs in each element of font-spec-alist. |
1078 (dolist (font-info font-info-list) | |
1079 (let ((font-spec-vec (make-vector 4 nil)) | |
1080 (charset (car font-info)) | |
110984
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
1081 encoding bytes font-spec) |
89530 | 1082 (dolist (e (cdr font-info)) |
110984
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
1083 (setq encoding (nth 3 e) bytes (nth 4 e)) |
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
1084 (unless encoding |
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
1085 (setq encoding charset bytes (charset-dimension charset))) |
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
1086 (setq font-spec (vector id-max charset font-id |
89530 | 1087 (nth 1 e) (nth 2 e) encoding |
110984
287d5a665560
(ps-mule-begin-job): Fix for the case that only ENCODING is set in a font-spec (bug#7197).
Kenichi Handa <handa@m17n.org>
parents:
106815
diff
changeset
|
1088 (or bytes 1) nil) |
89530 | 1089 id-max (1+ id-max)) |
1090 (if (ps-mule-check-font font-spec) | |
1091 (aset font-spec-vec | |
1092 (cond ((eq (car e) 'normal) 0) | |
1093 ((eq (car e) 'bold) 1) | |
1094 ((eq (car e) 'italic) 2) | |
1095 (t 3)) font-spec))) | |
1096 (when (aref font-spec-vec 0) | |
1097 (or (aref font-spec-vec 3) | |
1098 (aset font-spec-vec 3 (or (aref font-spec-vec 1) | |
1099 (aref font-spec-vec 2) | |
1100 (aref font-spec-vec 0)))) | |
1101 (or (aref font-spec-vec 1) | |
1102 (aset font-spec-vec 1 (aref font-spec-vec 0))) | |
1103 (or (aref font-spec-vec 2) | |
1104 (aset font-spec-vec 2 (aref font-spec-vec 1))) | |
1105 (dotimes (i 4) | |
1106 (aset font-spec-alist i | |
1107 (nconc (aref font-spec-alist i) | |
1108 (list (cons charset (aref font-spec-vec i)))))) | |
1109 (setq font-id (1+ font-id))))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1110 |
89530 | 1111 ;; Make four FONT-SPEC-TABLEs and set them in |
1112 ;; ps-mule-font-spec-tables. Each char table has one extra slot | |
1113 ;; whose value is an element of font-spec-alist. | |
1114 (setq ps-mule-font-spec-tables (make-vector 4 nil)) | |
1115 (put 'font-spec-table 'char-table-extra-slots 1) | |
1116 (dotimes (i 4) | |
1117 (let ((table (make-char-table 'font-spec-table))) | |
1118 (aset ps-mule-font-spec-tables i table) | |
1119 (set-char-table-extra-slot table 0 (aref font-spec-alist i)) | |
1120 ;; Be sure to have glyphs for "0123456789/" in advance for | |
1121 ;; page numbering. | |
1122 (let ((str " 0123456789/")) | |
1123 (dotimes (i (length str)) | |
1124 (or (vectorp (ps-mule-get-font-spec (aref str i) table nil)) | |
1125 (error "ASCII font not available"))))))) | |
1126 | |
1127 (ps-mule-prologue-generated) | |
1128 (if (find-composition from to) | |
1129 (ps-mule-composition-prologue-generated)))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1130 |
89530 | 1131 (defun ps-mule-restruct-output-list (list tail) |
1132 (dolist (elt list) | |
1133 (if (listp elt) | |
1134 (setq tail (ps-mule-restruct-output-list elt tail)) | |
1135 (setcdr tail (cons elt (cdr tail))) | |
1136 (setq tail (cdr tail)))) | |
1137 tail) | |
37137
b960119b9c18
XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents:
30561
diff
changeset
|
1138 |
89530 | 1139 (defun ps-mule-redefine-font (font-number fonttag size ps-font) |
1140 (let* ((font-type (aref ps-mule-font-number-to-type font-number)) | |
94741
766d27d2c19f
(ps-mule-external-libraries): Don't use `iff' in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
94678
diff
changeset
|
1141 (font-spec-alist (char-table-extra-slot |
89530 | 1142 (aref ps-mule-font-spec-tables font-type) 0))) |
1143 (ps-output-prologue | |
1144 (list (if (ps-mule-font-spec-src (cdr (car font-spec-alist))) | |
1145 ;; We ignore a font specfied in ps-font-info-database. | |
1146 (format "/V%s VTOP%d def\n" fonttag font-type) | |
89534 | 1147 (format "/V%s [ VTOP%d aload pop ] def\n |
1148 V%s 0 /%s-latin1 /%s Latin1Encoding put\n" | |
1149 fonttag font-type fonttag ps-font ps-font)) | |
89530 | 1150 (format "/%s ETOP%d V%s %f ReDefFont\n" |
1151 fonttag font-type fonttag size))))) | |
1152 | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1153 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1154 ;;;###autoload |
89530 | 1155 (defun ps-mule-end-job () |
1156 "Finish printing job for multi-byte chars." | |
1157 | |
1158 ;; Prepare root and sub fonts while generating glyphs if necessary. | |
1159 (let ((output-head (list t)) | |
1160 (ps-mule-output-list (list t))) | |
1161 (dotimes (i 4) | |
94741
766d27d2c19f
(ps-mule-external-libraries): Don't use `iff' in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
94678
diff
changeset
|
1162 (map-char-table 'ps-mule-prepare-glyph |
89530 | 1163 (aref ps-mule-font-spec-tables i))) |
1164 (ps-mule-restruct-output-list (cdr ps-mule-output-list) output-head) | |
1165 (ps-output-prologue (cdr output-head))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1166 |
89530 | 1167 ;; Prepare top Encoding and templates of FDepVector. |
1168 (dotimes (i 4) | |
1169 (let ((font-spec-alist (char-table-extra-slot | |
1170 (aref ps-mule-font-spec-tables i) 0)) | |
1171 font-list font-spec) | |
1172 (dolist (elt font-spec-alist) | |
1173 (setq font-spec (cdr elt)) | |
1174 (if (ps-mule-font-spec-extra font-spec) | |
1175 (push (cons (ps-mule-font-spec-font-id font-spec) | |
1176 (ps-mule-font-spec-id font-spec)) | |
1177 font-list))) | |
1178 (setq font-list (nreverse font-list)) | |
1179 (ps-output-prologue | |
1180 (list (format "/ETOP%d 256 array def\n" i) | |
1181 (format "0 1 255 { ETOP%d exch 0 put } for\n" i))) | |
1182 (let ((index 0)) | |
1183 (dolist (font font-list) | |
1184 (ps-output-prologue (format "ETOP%d %d %d put\n" i (car font) index)) | |
1185 (setq index (1+ index)))) | |
1186 (ps-output-prologue (format "/VTOP%d [%s] def\n" i | |
1187 (mapconcat #'(lambda (x) | |
1188 (format "F%02X" (cdr x))) | |
1189 font-list " "))))) | |
94741
766d27d2c19f
(ps-mule-external-libraries): Don't use `iff' in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents:
94678
diff
changeset
|
1190 |
89530 | 1191 ;; Redefine fonts f0, f1, f2, f3, h0, h1, H0. |
1192 (ps-mule-redefine-font 4 "h0" ps-header-title-font-size-internal | |
1193 (ps-font 'ps-font-for-header 'bold)) | |
1194 (ps-mule-redefine-font 5 "h1" ps-header-font-size-internal | |
1195 (ps-font 'ps-font-for-header 'normal)) | |
1196 (ps-mule-redefine-font 6 "H0" ps-footer-font-size-internal | |
1197 (ps-font 'ps-font-for-footer 'normal)) | |
1198 (let ((font (ps-font-alist 'ps-font-for-text)) | |
1199 (i 0)) | |
1200 (while font | |
1201 (ps-mule-redefine-font i (format "f%d" i) | |
1202 ps-font-size-internal | |
1203 (ps-font 'ps-font-for-text (car (car font)))) | |
1204 (setq font (cdr font) | |
1205 i (1+ i))))) | |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1206 |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1207 (provide 'ps-mule) |
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1208 |
81629
e293b291c59f
Set generated-autoload-file to "ps-print.el".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
1209 ;; Local Variables: |
e293b291c59f
Set generated-autoload-file to "ps-print.el".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
1210 ;; generated-autoload-file: "ps-print.el" |
e293b291c59f
Set generated-autoload-file to "ps-print.el".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
1211 ;; End: |
e293b291c59f
Set generated-autoload-file to "ps-print.el".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
1212 |
e293b291c59f
Set generated-autoload-file to "ps-print.el".
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
75347
diff
changeset
|
1213 ;; arch-tag: bca017b2-66a7-4e59-8584-103e749eadbe |
23894
f96c37cbdeef
New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents:
23893
diff
changeset
|
1214 ;;; ps-mule.el ends here |