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