annotate lisp/ps-mule.el @ 85815:960b3c592913

(doc-view-conversion-refresh-interval) (doc-view-dvi->pdf, doc-view-pdf/ps->png, doc-view-pdf->txt) (doc-view-reset-slice): Doc fixes. (doc-view-menu): Remove deleted function doc-view-edit-doc.
author Glenn Morris <rgm@gnu.org>
date Wed, 31 Oct 2007 03:10:32 +0000
parents b98604865ea0
children 107ccd98fa12 f55f9811f5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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,
75347
e3694f1cb928 Add 2007 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 74417
diff changeset
4 ;; 2005, 2006, 2007 Free Software Foundation, Inc.
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
5
74327
78c65b1a07f6 Fix maintainer email. Emacs 20/21 compatibility.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 68651
diff changeset
6 ;; Author: Vinicius Jose Latorre <viniciusjl@ig.com.br>
78c65b1a07f6 Fix maintainer email. Emacs 20/21 compatibility.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 68651
diff changeset
7 ;; Kenichi Handa <handa@m17n.org> (multi-byte characters)
78c65b1a07f6 Fix maintainer email. Emacs 20/21 compatibility.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 68651
diff changeset
8 ;; Maintainer: Kenichi Handa <handa@m17n.org> (multi-byte characters)
78c65b1a07f6 Fix maintainer email. Emacs 20/21 compatibility.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 68651
diff changeset
9 ;; Vinicius Jose Latorre <viniciusjl@ig.com.br>
38436
b174db545cfd Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents: 37201
diff changeset
10 ;; Keywords: wp, print, PostScript, multibyte, mule
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
11
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
12 ;; This file is part of GNU Emacs.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
13
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
14 ;; GNU Emacs is free software; you can redistribute it and/or modify
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
15 ;; it under the terms of the GNU General Public License as published by
78236
9355f9b7bbff Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents: 75347
diff changeset
16 ;; the Free Software Foundation; either version 3, or (at your option)
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
17 ;; any later version.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
18
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
19 ;; GNU Emacs is distributed in the hope that it will be useful,
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
22 ;; GNU General Public License for more details.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
23
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
24 ;; You should have received a copy of the GNU General Public License
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the
64091
6fb026ad601f Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 61257
diff changeset
26 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
6fb026ad601f Update FSF's address.
Lute Kamstra <lute@gnu.org>
parents: 61257
diff changeset
27 ;; Boston, MA 02110-1301, USA.
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
28
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
29 ;;; Commentary:
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
30
26115
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
31 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
32 ;;
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
33 ;; About ps-mule
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 ;;
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
36 ;; 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
37 ;;
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
38 ;; See also ps-print.el.
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 ;;
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
41 ;; Printing Multi-byte Buffer
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 ;;
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
44 ;; 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
45 ;; handling.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
46 ;;
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
47 ;; Valid values for `ps-multibyte-buffer' are:
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
48 ;;
82106
f95feb715a68 Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82095
diff changeset
49 ;; 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
50 ;; by default, this only works to print buffers with
f95feb715a68 Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82095
diff changeset
51 ;; only ASCII and Latin characters. But this default
f95feb715a68 Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82095
diff changeset
52 ;; 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
53 ;; `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
54 ;; 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
55 ;; `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
56 ;; documentation).
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
57 ;;
82106
f95feb715a68 Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82095
diff changeset
58 ;; `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
59 ;; 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
60 ;; 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
61 ;; JISX0201-Kana) and Korean characters. At present,
82106
f95feb715a68 Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82095
diff changeset
62 ;; it was not tested with the Korean characters
f95feb715a68 Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82095
diff changeset
63 ;; printing. If you have a korean PostScript printer,
f95feb715a68 Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82095
diff changeset
64 ;; please, test it.
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
65 ;;
82106
f95feb715a68 Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82095
diff changeset
66 ;; `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
67 ;; 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
68 ;; and non-latin fonts. BDF (Bitmap Distribution
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
69 ;; 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
70 ;; source file. BDF fonts are included in
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
71 ;; `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
72 ;; 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
73 ;; use this value, be sure to have installed
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
74 ;; `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
75 ;; `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
76 ;; for documentation of this variable).
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
77 ;;
82106
f95feb715a68 Doc/docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82095
diff changeset
78 ;; `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
79 ;; 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
80 ;; 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
81 ;; 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
82 ;; the same buffer. See `ps-font-family',
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
83 ;; `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
84 ;;
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
85 ;; Any other value is treated as nil.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
86 ;;
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
87 ;; The default is nil.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
88 ;;
26115
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
89 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
90
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
91 ;;; Code:
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
92
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
93 (eval-and-compile
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
94 (require 'ps-print)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
95
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
96 ;; to avoid XEmacs compilation gripes
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
97 (defvar leading-code-private-22 157)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
98 (or (fboundp 'charset-bytes)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
99 (defun charset-bytes (charset) 1)) ; ascii
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
100 (or (fboundp 'charset-dimension)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
101 (defun charset-dimension (charset) 1)) ; ascii
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
102 (or (fboundp 'charset-id)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
103 (defun charset-id (charset) 0)) ; ascii
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
104 (or (fboundp 'charset-width)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
105 (defun charset-width (charset) 1)) ; ascii
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
106 (or (fboundp 'find-charset-region)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
107 (defun find-charset-region (beg end &optional table)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
108 (list 'ascii)))
37201
a50c338bd5e7 Eliminate cl package dependence.
Gerd Moellmann <gerd@gnu.org>
parents: 37149
diff changeset
109 (or (fboundp 'char-valid-p)
a50c338bd5e7 Eliminate cl package dependence.
Gerd Moellmann <gerd@gnu.org>
parents: 37149
diff changeset
110 (defun char-valid-p (char)
a50c338bd5e7 Eliminate cl package dependence.
Gerd Moellmann <gerd@gnu.org>
parents: 37149
diff changeset
111 (< (following-char) 256)))
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
112 (or (fboundp 'split-char)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
113 (defun split-char (char)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
114 (list (if (char-valid-p char)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
115 'ascii
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
116 'unknow)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
117 char)))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
118 (or (fboundp 'char-width)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
119 (defun char-width (char) 1)) ; ascii
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
120 (or (fboundp 'chars-in-region)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
121 (defun chars-in-region (beg end)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
122 (- (max beg end) (min beg end))))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
123 (or (fboundp 'forward-point)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
124 (defun forward-point (arg)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
125 (save-excursion
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
126 (let ((count (abs arg))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
127 (step (if (zerop arg)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
128 0
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
129 (/ arg arg))))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
130 (while (and (> count 0)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
131 (< (point-min) (point)) (< (point) (point-max)))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
132 (forward-char step)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
133 (setq count (1- count)))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
134 (+ (point) (* count step))))))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
135 (or (fboundp 'decompose-composite-char)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
136 (defun decompose-composite-char (char &optional type
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
137 with-composition-rule)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
138 nil))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
139 (or (fboundp 'encode-coding-string)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
140 (defun encode-coding-string (string coding-system &optional nocopy)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
141 (if nocopy
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
142 string
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
143 (copy-sequence string))))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
144 (or (fboundp 'coding-system-p)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
145 (defun coding-system-p (obj) nil))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
146 (or (fboundp 'ccl-execute-on-string)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
147 (defun ccl-execute-on-string (ccl-prog status str
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
148 &optional contin unibyte-p)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
149 str))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
150 (or (fboundp 'define-ccl-program)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
151 (defmacro define-ccl-program (name ccl-program &optional doc)
37201
a50c338bd5e7 Eliminate cl package dependence.
Gerd Moellmann <gerd@gnu.org>
parents: 37149
diff changeset
152 `(defconst ,name nil ,doc)))
a50c338bd5e7 Eliminate cl package dependence.
Gerd Moellmann <gerd@gnu.org>
parents: 37149
diff changeset
153 (or (fboundp 'multibyte-string-p)
a50c338bd5e7 Eliminate cl package dependence.
Gerd Moellmann <gerd@gnu.org>
parents: 37149
diff changeset
154 (defun multibyte-string-p (str)
a50c338bd5e7 Eliminate cl package dependence.
Gerd Moellmann <gerd@gnu.org>
parents: 37149
diff changeset
155 (let ((len (length str))
a50c338bd5e7 Eliminate cl package dependence.
Gerd Moellmann <gerd@gnu.org>
parents: 37149
diff changeset
156 (i 0)
a50c338bd5e7 Eliminate cl package dependence.
Gerd Moellmann <gerd@gnu.org>
parents: 37149
diff changeset
157 multibyte)
a50c338bd5e7 Eliminate cl package dependence.
Gerd Moellmann <gerd@gnu.org>
parents: 37149
diff changeset
158 (while (and (< i len) (not (setq multibyte (> (aref str i) 255))))
a50c338bd5e7 Eliminate cl package dependence.
Gerd Moellmann <gerd@gnu.org>
parents: 37149
diff changeset
159 (setq i (1+ i)))
a50c338bd5e7 Eliminate cl package dependence.
Gerd Moellmann <gerd@gnu.org>
parents: 37149
diff changeset
160 multibyte)))
a50c338bd5e7 Eliminate cl package dependence.
Gerd Moellmann <gerd@gnu.org>
parents: 37149
diff changeset
161 (or (fboundp 'string-make-multibyte)
45334
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
162 (defalias 'string-make-multibyte 'copy-sequence))
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
163 (or (fboundp 'encode-char)
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
164 (defun encode-char (ch ccs)
74351
b51283822ec9 Eliminate Emacs 20 & 21 compatibility.
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 74327
diff changeset
165 ch)))
23894
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
27160
1e00f7f6655c ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents: 26882
diff changeset
168 ;;;###autoload
1e00f7f6655c ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents: 26882
diff changeset
169 (defcustom ps-multibyte-buffer nil
1e00f7f6655c ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents: 26882
diff changeset
170 "*Specifies the multi-byte buffer handling.
1e00f7f6655c ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents: 26882
diff changeset
171
1e00f7f6655c ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents: 26882
diff changeset
172 Valid values are:
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
173
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
174 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
175 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
176 only ASCII and Latin characters. But this default
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
177 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
178 `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
179 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
180 `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
181 documentation).
1e00f7f6655c ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents: 26882
diff changeset
182
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
183 `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
184 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
185 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
186 JISX0201-Kana) and Korean characters. At present,
82107
d06c8006b89b Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82106
diff changeset
187 it was not tested with the Korean characters
d06c8006b89b Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82106
diff changeset
188 printing. If you have a korean PostScript printer,
d06c8006b89b Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82106
diff changeset
189 please, test it.
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
190
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
191 `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
192 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
193 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
194 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
195 source file. BDF fonts are included in
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
196 `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
197 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
198 use this value, be sure to have installed
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
199 `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
200 `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
201 documentation of this variable).
1e00f7f6655c ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents: 26882
diff changeset
202
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
203 `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
204 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
205 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
206 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
207 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
208 `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
209
1e00f7f6655c ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents: 26882
diff changeset
210 Any other value is treated as nil."
28631
5e9674136340 Customization fix, doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 27160
diff changeset
211 :type '(choice (const non-latin-printer) (const bdf-font)
5e9674136340 Customization fix, doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 27160
diff changeset
212 (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
213 :group 'ps-print-font)
23894
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 (defvar ps-mule-font-info-database
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
216 nil
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
217 "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
218 Each element has the form:
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
219
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
220 (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
221
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
222 Where
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
223
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
224 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
225
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
226 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
227
56679
91074b668126 (ps-mule-font-info-database): Fix docstring.
Kenichi Handa <handa@m17n.org>
parents: 52401
diff changeset
228 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
229
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
230 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
231
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
232 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
233 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
234 is required.
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
235
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
236 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
237 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
238
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
239 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
240 `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
241
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
242 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
243 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
244 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
245 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
246
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
247 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
248 sequence; it should be 1 or 2.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
249
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
250 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
251 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
252 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
253 font family.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
254
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
255 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
256
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
257 (defconst ps-mule-font-info-database-latin
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
258 '((latin-iso8859-1
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
259 (normal nil nil iso-latin-1)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
260 "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
261
26115
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
262 (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
263 ps-mule-font-info-database-latin
30561
fb68d65b0fa3 Fix a customization problem on
Gerd Moellmann <gerd@gnu.org>
parents: 29523
diff changeset
264 "*The default setting to use when `ps-multibyte-buffer' is nil."
fb68d65b0fa3 Fix a customization problem on
Gerd Moellmann <gerd@gnu.org>
parents: 29523
diff changeset
265 :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
266 :group 'ps-print-font)
24306
432510346b14 (ps-multibyte-buffer): Doc-string modified.
Kenichi Handa <handa@m17n.org>
parents: 24303
diff changeset
267
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
268 (defconst ps-mule-font-info-database-ps
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
269 '((katakana-jisx0201
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
270 (normal builtin "Ryumin-Light.Katakana" ps-mule-encode-7bit 1)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
271 (bold builtin "GothicBBB-Medium.Katakana" ps-mule-encode-7bit 1)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
272 (bold-italic builtin "GothicBBB-Medium.Katakana" ps-mule-encode-7bit 1))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
273 (latin-jisx0201
25828
55e4513821f8 (ps-mule-font-info-database-ps): Typo fixed
Kenichi Handa <handa@m17n.org>
parents: 25086
diff changeset
274 (normal builtin "Ryumin-Light.Hankaku" ps-mule-encode-7bit 1)
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
275 (bold builtin "GothicBBB-Medium.Hankaku" ps-mule-encode-7bit 1))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
276 (japanese-jisx0208
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
277 (normal builtin "Ryumin-Light-H" ps-mule-encode-7bit 2)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
278 (bold builtin "GothicBBB-Medium-H" ps-mule-encode-7bit 2))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
279 (korean-ksc5601
25828
55e4513821f8 (ps-mule-font-info-database-ps): Typo fixed
Kenichi Handa <handa@m17n.org>
parents: 25086
diff changeset
280 (normal builtin "Munhwa-Regular-KSC-EUC-H" ps-mule-encode-7bit 2)
55e4513821f8 (ps-mule-font-info-database-ps): Typo fixed
Kenichi Handa <handa@m17n.org>
parents: 25086
diff changeset
281 (bold builtin "Munhwa-Bold-KSC-EUC-H" ps-mule-encode-7bit 2))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
282 )
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
283 "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
284
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
285 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
286
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
287 (defconst ps-mule-font-info-database-bdf
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
288 '((ascii
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
289 (normal bdf ("lt1-24-etl.bdf" "etl24-latin1.bdf") nil 1)
24303
958f4aa0dceb (ps-mule-font-info-database-bdf): Fix ENCODING field
Kenichi Handa <handa@m17n.org>
parents: 24086
diff changeset
290 (bold bdf ("lt1-16b-etl.bdf" "etl16b-latin1.bdf") nil 1)
958f4aa0dceb (ps-mule-font-info-database-bdf): Fix ENCODING field
Kenichi Handa <handa@m17n.org>
parents: 24086
diff changeset
291 (italic bdf ("lt1-16i-etl.bdf" "etl16i-latin1.bdf") nil 1)
958f4aa0dceb (ps-mule-font-info-database-bdf): Fix ENCODING field
Kenichi Handa <handa@m17n.org>
parents: 24086
diff changeset
292 (bold-italic bdf ("lt1-16bi-etl.bdf" "etl16bi-latin1.bdf") nil 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
293 (latin-iso8859-1
24303
958f4aa0dceb (ps-mule-font-info-database-bdf): Fix ENCODING field
Kenichi Handa <handa@m17n.org>
parents: 24086
diff changeset
294 (normal bdf ("lt1-24-etl.bdf" "etl24-latin1.bdf") iso-latin-1 1)
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
295 (bold bdf ("lt1-16b-etl.bdf" "etl16b-latin1.bdf") iso-latin-1 1)
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
296 (italic bdf ("lt1-16i-etl.bdf" "etl16i-latin1.bdf") iso-latin-1 1)
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
297 (bold-italic bdf ("lt1-16bi-etl.bdf" "etl16bi-latin1.bdf") iso-latin-1 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
298 (latin-iso8859-2
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
299 (normal bdf ("lt2-24-etl.bdf" "etl24-latin2.bdf") iso-latin-2 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
300 (latin-iso8859-3
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
301 (normal bdf ("lt3-24-etl.bdf" "etl24-latin3.bdf") iso-latin-3 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
302 (latin-iso8859-4
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
303 (normal bdf ("lt4-24-etl.bdf" "etl24-latin4.bdf") iso-latin-4 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
304 (thai-tis620
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
305 (normal bdf ("thai24.bdf" "thai-24.bdf") thai-tis620 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
306 (greek-iso8859-7
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
307 (normal bdf ("grk24-etl.bdf" "etl24-greek.bdf") greek-iso-8bit 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
308 ;; (arabic-iso8859-6 nil) ; not yet available
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
309 (hebrew-iso8859-8
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
310 (normal bdf ("heb24-etl.bdf" "etl24-hebrew.bdf") hebrew-iso-8bit 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
311 (katakana-jisx0201
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
312 (normal bdf "12x24rk.bdf" ps-mule-encode-8bit 1))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
313 (latin-jisx0201
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
314 (normal bdf "12x24rk.bdf" ps-mule-encode-7bit 1))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
315 (cyrillic-iso8859-5
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
316 (normal bdf ("cyr24-etl.bdf" "etl24-cyrillic.bdf") cyrillic-iso-8bit 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
317 (latin-iso8859-9
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
318 (normal bdf ("lt5-24-etl.bdf" "etl24-latin5.bdf") iso-latin-5 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
319 (japanese-jisx0208-1978
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
320 (normal bdf "jiskan24.bdf" ps-mule-encode-7bit 2))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
321 (chinese-gb2312
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
322 (normal bdf "gb24st.bdf" ps-mule-encode-7bit 2))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
323 (japanese-jisx0208
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
324 (normal bdf "jiskan24.bdf" ps-mule-encode-7bit 2))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
325 (korean-ksc5601
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
326 (normal bdf "hanglm24.bdf" ps-mule-encode-7bit 2))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
327 (japanese-jisx0212
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
328 (normal bdf ("jksp40.bdf" "jisksp40.bdf") ps-mule-encode-7bit 2))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
329 (chinese-cns11643-1
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
330 (normal bdf ("cns1-40.bdf" "cns-1-40.bdf") ps-mule-encode-7bit 2))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
331 (chinese-cns11643-2
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
332 (normal bdf ("cns2-40.bdf" "cns-2-40.bdf") ps-mule-encode-7bit 2))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
333 (chinese-big5-1
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
334 (normal bdf "taipei24.bdf" chinese-big5 2))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
335 (chinese-big5-2
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
336 (normal bdf "taipei24.bdf" chinese-big5 2))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
337 (chinese-sisheng
26512
a6cf126fdf97 (ps-mule-font-info-database-bdf): Default BDF font
Kenichi Handa <handa@m17n.org>
parents: 26483
diff changeset
338 (normal bdf ("sish24-etl.bdf" "etl24-sisheng.bdf") ps-mule-encode-7bit 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
339 (ipa
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
340 (normal bdf ("ipa24-etl.bdf" "etl24-ipa.bdf") ps-mule-encode-8bit 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
341 (vietnamese-viscii-lower
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
342 (normal bdf ("visc24-etl.bdf" "etl24-viscii.bdf") vietnamese-viscii 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
343 (vietnamese-viscii-upper
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
344 (normal bdf ("visc24-etl.bdf" "etl24-viscii.bdf") vietnamese-viscii 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
345 (arabic-digit
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
346 (normal bdf ("arab24-0-etl.bdf" "etl24-arabic0.bdf") ps-mule-encode-7bit 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
347 (arabic-1-column
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
348 (normal bdf ("arab24-1-etl.bdf" "etl24-arabic1.bdf") ps-mule-encode-7bit 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
349 ;; (ascii-right-to-left nil) ; not yet available
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
350 (lao
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
351 (normal bdf ("lao24-mule.bdf" "mule-lao-24.bdf") lao 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
352 (arabic-2-column
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
353 (normal bdf ("arab24-2-etl.bdf" "etl24-arabic2.bdf") ps-mule-encode-7bit 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
354 (indian-is13194
37149
92239370ac9f (ps-mule-font-info-database-bdf): Change
Gerd Moellmann <gerd@gnu.org>
parents: 37140
diff changeset
355 (normal bdf ("isci24-mule.bdf" "mule-iscii-24.bdf") ps-mule-encode-7bit 1))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
356 (indian-1-column
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
357 (normal bdf ("ind1c24-mule.bdf" "mule-indian-1col-24.bdf") ps-mule-encode-7bit 2))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
358 (tibetan-1-column
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
359 (normal bdf ("tib1c24-mule.bdf" "mule-tibmdx-1col-24.bdf") ps-mule-encode-7bit 2))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
360 (ethiopic
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
361 (normal bdf ("ethio24f-uni.bdf" "ethiomx24f-uni.bdf") ps-mule-encode-ethiopic 2))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
362 (chinese-cns11643-3
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
363 (normal bdf ("cns3-40.bdf" "cns-3-40.bdf") ps-mule-encode-7bit 2))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
364 (chinese-cns11643-4
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
365 (normal bdf ("cns4-40.bdf" "cns-4-40.bdf") ps-mule-encode-7bit 2))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
366 (chinese-cns11643-5
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
367 (normal bdf ("cns5-40.bdf" "cns-5-40.bdf") ps-mule-encode-7bit 2))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
368 (chinese-cns11643-6
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
369 (normal bdf ("cns6-40.bdf" "cns-6-40.bdf") ps-mule-encode-7bit 2))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
370 (chinese-cns11643-7
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
371 (normal bdf ("cns7-40.bdf" "cns-7-40.bdf") ps-mule-encode-7bit 2))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
372 (indian-2-column
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
373 (normal bdf ("ind24-mule.bdf" "mule-indian-24.bdf") ps-mule-encode-7bit 2))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
374 (tibetan
29523
33994562b445 (ps-mule-font-info-database-bdf): Prefer the font "tib24p-mule.bdf"
Kenichi Handa <handa@m17n.org>
parents: 28631
diff changeset
375 (normal bdf ("tib24p-mule.bdf" "tib24-mule.bdf" "mule-tibmdx-24.bdf")
45334
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
376 ps-mule-encode-7bit 2))
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
377 (mule-unicode-0100-24ff
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
378 (normal bdf "etl24-unicode.bdf" ps-mule-encode-ucs2 2))
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
379 (mule-unicode-2500-33ff
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
380 (normal bdf "etl24-unicode.bdf" ps-mule-encode-ucs2 2))
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
381 (mule-unicode-e000-ffff
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
382 (normal bdf "etl24-unicode.bdf" ps-mule-encode-ucs2 2)))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
383 "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
384 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
385 source file.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
386
45334
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
387 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
388 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
389
45334
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
390 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
391 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
392
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
393 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
394
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
395 (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
396 (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
397 (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
398 "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
399
45334
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
400 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
401 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
402
45334
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
403 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
404 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
405 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
406 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
407
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
408 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
409
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
410 ;; Two typical encoding functions for PostScript fonts.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
411
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
412 (defun ps-mule-encode-7bit (string)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
413 (ps-mule-encode-bit string 0))
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 (defun ps-mule-encode-8bit (string)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
416 (ps-mule-encode-bit string 128))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
417
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
418 (defun ps-mule-encode-bit (string delta)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
419 (let* ((dim (charset-dimension (char-charset (string-to-char string))))
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
420 (len (length string))
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
421 (str (make-string (* len dim) 0))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
422 (j 0))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
423 (if (= dim 1)
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
424 ;; (apply 'string
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
425 ;; (mapcar (lambda (c) (+ (nth 1 (split-char c)) delta))
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
426 ;; string))
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
427 (dotimes (i len)
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
428 (aset str i
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
429 (+ (nth 1 (split-char (aref string i))) delta)))
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
430 ;; (mapconcat (lambda (c)
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
431 ;; (let ((split (split-char c)))
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
432 ;; (string (+ (nth 1 split) delta)
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
433 ;; (+ (nth 2 split) delta))))
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
434 ;; string "")
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
435 (dotimes (i len)
56986
6db2681d2bf6 Fix old function calls (ps-mule-chars-in-string ->
Kenichi Handa <handa@m17n.org>
parents: 56760
diff changeset
436 (let ((split (split-char (aref string i))))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
437 (aset str j (+ (nth 1 split) delta))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
438 (aset str (1+ j) (+ (nth 2 split) delta))
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
439 (setq j (+ j 2)))))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
440 str))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
441
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
442 ;; Special encoding function for Ethiopic.
26115
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
443 (if (boundp 'mule-version) ; only if mule package is loaded
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
444 (define-ccl-program ccl-encode-ethio-unicode
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
445 `(1
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
446 ((read r2)
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
447 (loop
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
448 (if (r2 == ,leading-code-private-22)
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
449 ((read r0)
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
450 (if (r0 == ,(charset-id 'ethiopic))
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
451 ((read r1 r2)
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
452 (r1 &= 127) (r2 &= 127)
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
453 (call ccl-encode-ethio-font)
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
454 (write r1)
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
455 (write-read-repeat r2))
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
456 ((write r2 r0)
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
457 (repeat))))
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
458 (write-read-repeat r2))))))
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
459 ;; to avoid compilation gripes
314173e121ee Doc fix, define functions properly if mule package is
Kenichi Handa <handa@m17n.org>
parents: 25828
diff changeset
460 (defvar ccl-encode-ethio-unicode nil))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
461
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
462 (defalias 'ps-mule-encode-ethiopic
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
463 (if (boundp 'mule-version)
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
464 ;; Bound mule-version.
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
465 (lambda (string)
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
466 (ccl-execute-on-string (symbol-value 'ccl-encode-ethio-unicode)
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
467 (make-vector 9 nil)
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
468 string))
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
469 ;; Unbound mule-version.
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
470 #'identity))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
471
45334
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
472 ;; Special encoding for mule-unicode-* characters.
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
473 (defun ps-mule-encode-ucs2 (string)
56986
6db2681d2bf6 Fix old function calls (ps-mule-chars-in-string ->
Kenichi Handa <handa@m17n.org>
parents: 56760
diff changeset
474 (let* ((len (length string))
45334
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
475 (str (make-string (* 2 len) 0))
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
476 (j 0)
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
477 ch hi lo)
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
478 (dotimes (i len)
56986
6db2681d2bf6 Fix old function calls (ps-mule-chars-in-string ->
Kenichi Handa <handa@m17n.org>
parents: 56760
diff changeset
479 (setq ch (encode-char (aref string i) 'ucs)
45334
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
480 hi (lsh ch -8)
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
481 lo (logand ch 255))
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
482 (aset str j hi)
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
483 (aset str (1+ j) lo)
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
484 (setq j (+ j 2)))
45334
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
485 str))
695ae1bd8fa4 (eval-and-compile): Add a trivial replacement for a
Eli Zaretskii <eliz@gnu.org>
parents: 39353
diff changeset
486
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
487 ;; A charset which we are now processing.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
488 (defvar ps-mule-current-charset nil)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
489
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
490 (defun ps-mule-get-font-spec (charset font-type)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
491 "Return FONT-SPEC for printing characters CHARSET with FONT-TYPE.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
492 FONT-SPEC is a list that has the form:
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
493
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
494 (FONT-SRC FONT-NAME ENCODING BYTES)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
495
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
496 FONT-SPEC is extracted from `ps-mule-font-info-database'.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
497
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
498 See the documentation of `ps-mule-font-info-database' for the meaning of each
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
499 element of the list."
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
500 (let ((slot (cdr (assq charset ps-mule-font-info-database))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
501 (and slot
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
502 (cdr (or (assq font-type slot)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
503 (and (eq font-type 'bold-italic)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
504 (or (assq 'bold slot) (assq 'italic slot)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
505 (assq 'normal slot))))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
506
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
507 ;; Functions to access each element of FONT-SPEC.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
508 (defsubst ps-mule-font-spec-src (font-spec) (car font-spec))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
509 (defsubst ps-mule-font-spec-name (font-spec) (nth 1 font-spec))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
510 (defsubst ps-mule-font-spec-encoding (font-spec) (nth 2 font-spec))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
511 (defsubst ps-mule-font-spec-bytes (font-spec) (nth 3 font-spec))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
512
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
513 (defsubst ps-mule-printable-p (charset)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
514 "Non-nil if characters in CHARSET is printable."
61076
d1615c2ff814 (ps-mule-printable-p): Return t if CHARSET is ascii or
Kenichi Handa <handa@m17n.org>
parents: 61074
diff changeset
515 ;; ASCII and Latin-1 are always printable.
d1615c2ff814 (ps-mule-printable-p): Return t if CHARSET is ascii or
Kenichi Handa <handa@m17n.org>
parents: 61074
diff changeset
516 (or (eq charset 'ascii)
d1615c2ff814 (ps-mule-printable-p): Return t if CHARSET is ascii or
Kenichi Handa <handa@m17n.org>
parents: 61074
diff changeset
517 (eq charset 'latin-iso8859-1)
d1615c2ff814 (ps-mule-printable-p): Return t if CHARSET is ascii or
Kenichi Handa <handa@m17n.org>
parents: 61074
diff changeset
518 (ps-mule-get-font-spec charset 'normal)))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
519
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
520 (defconst ps-mule-external-libraries
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
521 '((builtin nil nil
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
522 nil nil nil)
82108
fb40f60f0ab3 Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82107
diff changeset
523 (bdf ps-bdf nil
fb40f60f0ab3 Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82107
diff changeset
524 bdf-generate-prologue bdf-generate-font bdf-generate-glyphs)
fb40f60f0ab3 Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82107
diff changeset
525 (pcf nil nil
fb40f60f0ab3 Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82107
diff changeset
526 pcf-generate-prologue pcf-generate-font pcf-generate-glyphs)
fb40f60f0ab3 Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82107
diff changeset
527 (vflib nil nil
fb40f60f0ab3 Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82107
diff changeset
528 vflib-generate-prologue vflib-generate-font vflib-generate-glyphs))
fb40f60f0ab3 Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82107
diff changeset
529 "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
530 Each element has the form:
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
531
82108
fb40f60f0ab3 Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82107
diff changeset
532 (FONT-SRC FEATURE INITIALIZED-P
fb40f60f0ab3 Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82107
diff changeset
533 PROLOGUE-FUNC FONT-FUNC GLYPHS-FUNC)
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
534
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
535 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
536
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
537 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
538 `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
539 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
540
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
541 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
542
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
543 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
544 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
545 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
546
82108
fb40f60f0ab3 Docstring fix
Vinicius Jose Latorre <viniciusjl@ig.com.br>
parents: 82107
diff changeset
547 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
548 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
549
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
550 GLYPHS-FUNC is a function to generate PostScript code which define glyphs of
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
551 characters. It is called with three arguments FONT-SPEC, CODE-LIST, and BYTES,
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
552 and should return a list of strings.")
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
553
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
554 (defun ps-mule-init-external-library (font-spec)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
555 "Initialize external library specified by FONT-SPEC for PostScript printing.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
556 See the documentation of `ps-mule-get-font-spec' for FONT-SPEC's meaning."
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
557 (let* ((font-src (ps-mule-font-spec-src font-spec))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
558 (slot (assq font-src ps-mule-external-libraries)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
559 (or (not font-src)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
560 (nth 2 slot)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
561 (let ((func (nth 3 slot)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
562 (if func
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
563 (progn
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
564 (require (nth 1 slot))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
565 (ps-output-prologue (funcall func))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
566 (setcar (nthcdr 2 slot) t)))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
567
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
568 ;; Cached glyph information of fonts, alist of:
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
569 ;; (FONT-NAME ((FONT-TYPE-NUMBER . SCALED-FONT-NAME) ...)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
570 ;; cache CODE0 CODE1 ...)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
571 (defvar ps-mule-font-cache nil)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
572
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
573 (defun ps-mule-generate-font (font-spec charset &optional header-p)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
574 "Generate PostScript codes to define a new font in FONT-SPEC for CHARSET.
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
575
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
576 If optional 3rd arg HEADER-P is non-nil, generate codes to define a header
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
577 font."
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
578 (let* ((font-name (ps-mule-font-spec-name font-spec))
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
579 (font-name (if (consp font-name) (car font-name) font-name))
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
580 (font-cache (assoc font-name ps-mule-font-cache))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
581 (font-src (ps-mule-font-spec-src font-spec))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
582 (func (nth 4 (assq font-src ps-mule-external-libraries)))
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
583 (font-size (if header-p (if (eq ps-current-font 0)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
584 ps-header-title-font-size-internal
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
585 ps-header-font-size-internal)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
586 ps-font-size-internal))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
587 (current-font (+ ps-current-font (if header-p 10 0)))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
588 (scaled-font-name
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
589 (cond (header-p
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
590 (format "h%d" ps-current-font))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
591 ((eq charset 'ascii)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
592 (format "f%d" ps-current-font))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
593 (t
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
594 (format "f%02x-%d" (charset-id charset) ps-current-font)))))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
595 (and func (not font-cache)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
596 (ps-output-prologue (funcall func charset font-spec)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
597 (ps-output-prologue
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
598 (list (format "/%s %f /%s Def%sFontMule\n"
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
599 scaled-font-name font-size font-name
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
600 (if (or header-p
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
601 (eq ps-mule-current-charset 'ascii))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
602 "Ascii" ""))))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
603 (if font-cache
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
604 (setcar (cdr font-cache)
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
605 (cons (cons current-font scaled-font-name)
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
606 (nth 1 font-cache)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
607 (setq font-cache (list font-name
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
608 (list (cons current-font scaled-font-name))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
609 'cache)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
610 ps-mule-font-cache (cons font-cache ps-mule-font-cache)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
611 font-cache))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
612
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
613 (defun ps-mule-generate-glyphs (font-spec code-list)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
614 "Generate PostScript codes which generate glyphs for CODE-LIST of FONT-SPEC."
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
615 (let* ((font-src (ps-mule-font-spec-src font-spec))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
616 (func (nth 5 (assq font-src ps-mule-external-libraries))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
617 (and func
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
618 (ps-output-prologue
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
619 (funcall func font-spec code-list
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
620 (ps-mule-font-spec-bytes font-spec))))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
621
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
622 (defun ps-mule-prepare-font (font-spec string charset
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
623 &optional no-setfont header-p)
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
624 "Generate PostScript codes to print STRING of CHARSET by font FONT-SPEC.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
625
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
626 The generated code is inserted on prologue part except the code that sets the
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
627 current font (using PostScript procedure `FM').
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
628
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
629 If optional 4th arg NO-SETFONT is non-nil, don't generate the code for setting
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
630 the current font.
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
631
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
632 If optional 5th arg HEADER-P is non-nil, generate a code for setting a header
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
633 font."
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
634 (let* ((font-name (ps-mule-font-spec-name font-spec))
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
635 (font-name (if (consp font-name) (car font-name) font-name))
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
636 (current-font (+ ps-current-font (if header-p 10 0)))
24086
bedce7fcf0f4 (ps-mule-font-info-database-bdf): Add alternative
Eli Zaretskii <eliz@gnu.org>
parents: 23937
diff changeset
637 (font-cache (assoc font-name ps-mule-font-cache)))
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
638 (or (and font-cache (assq current-font (nth 1 font-cache)))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
639 (setq font-cache (ps-mule-generate-font font-spec charset header-p)))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
640 (or no-setfont
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
641 (let ((new-font (cdr (assq current-font (nth 1 font-cache)))))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
642 (or (equal new-font ps-last-font)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
643 (progn
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
644 (ps-output (format "/%s FM\n" new-font))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
645 (setq ps-last-font new-font)))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
646 (if (nth 5 (assq (ps-mule-font-spec-src font-spec)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
647 ps-mule-external-libraries))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
648 ;; We have to generate PostScript codes which define glyphs.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
649 (let* ((cached-codes (nthcdr 2 font-cache))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
650 (bytes (ps-mule-font-spec-bytes font-spec))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
651 (len (length string))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
652 (i 0)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
653 newcodes code)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
654 (while (< i len)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
655 (setq code (if (= bytes 1)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
656 (aref string i)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
657 (+ (* (aref string i) 256) (aref string (1+ i)))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
658 (or (memq code cached-codes)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
659 (progn
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
660 (setq newcodes (cons code newcodes))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
661 (setcdr cached-codes (cons code (cdr cached-codes)))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
662 (setq i (+ i bytes)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
663 (and newcodes
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
664 (ps-mule-generate-glyphs font-spec newcodes))))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
665
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
666 ;;;###autoload
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
667 (defun ps-mule-prepare-ascii-font (string)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
668 "Setup special ASCII font for STRING.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
669 STRING should contain only ASCII characters."
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
670 (let ((font-spec
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
671 (ps-mule-get-font-spec
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
672 'ascii
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
673 (car (nth ps-current-font (ps-font-alist 'ps-font-for-text))))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
674 (and font-spec
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
675 (ps-mule-prepare-font font-spec string 'ascii))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
676
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
677 ;;;###autoload
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
678 (defun ps-mule-set-ascii-font ()
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
679 (unless (eq ps-mule-current-charset 'ascii)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
680 (ps-set-font ps-current-font)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
681 (setq ps-mule-current-charset 'ascii)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
682
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
683 ;; List of charsets of multi-byte characters in a text being printed.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
684 ;; If the text doesn't contain any multi-byte characters (i.e. only ASCII),
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
685 ;; the value is nil.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
686 (defvar ps-mule-charset-list nil)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
687
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
688 ;; 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
689 (defconst ps-mule-prologue
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
690 "%%%% Start of Mule Section
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
691
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
692 %% Working dictionary for general use.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
693 /MuleDict 10 dict def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
694
24721
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
695 %% Adjust /RelativeCompose properly by checking /BaselineOffset.
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
696 /AdjustRelativeCompose { % fontdict |- fontdict
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
697 dup length 2 add dict begin
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
698 { 1 index /FID ne { def } { pop pop } ifelse } forall
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
699 currentdict /BaselineOffset known {
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
700 BaselineOffset false eq { /BaselineOffset 0 def } if
24721
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
701 } {
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
702 /BaselineOffset 0 def
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
703 } ifelse
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
704 currentdict /RelativeCompose known not {
24722
4321a26f6594 fix previous change
Kenichi Handa <handa@m17n.org>
parents: 24721
diff changeset
705 /RelativeCompose [ 0 0.1 ] def
24721
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
706 } {
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
707 RelativeCompose false ne {
27160
1e00f7f6655c ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents: 26882
diff changeset
708 [ BaselineOffset RelativeCompose BaselineOffset add
1e00f7f6655c ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents: 26882
diff changeset
709 [ FontMatrix { FontSize div } forall ] transform ]
1e00f7f6655c ps-vars eliminated, ps-multibyte-buffer now is
Kenichi Handa <handa@m17n.org>
parents: 26882
diff changeset
710 /RelativeCompose exch def
24721
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
711 } if
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
712 } ifelse
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
713 currentdict
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
714 end
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
715 } def
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
716
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
717 %% Define already scaled font for non-ASCII character sets.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
718 /DefFontMule { % fontname size basefont |- --
24721
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
719 findfont exch scalefont AdjustRelativeCompose definefont pop
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
720 } bind def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
721
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
722 %% Define already scaled font for ASCII character sets.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
723 /DefAsciiFontMule { % fontname size basefont |-
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
724 MuleDict begin
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
725 findfont dup /Encoding get /ISOLatin1Encoding exch def
24721
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
726 exch scalefont AdjustRelativeCompose reencodeFontISO
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
727 end
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
728 } def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
729
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
730 /CurrentFont false def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
731
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
732 %% Set the specified font to use.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
733 %% For non-ASCII font, don't install Ascent, etc.
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
734 /FM { % fontname |- --
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
735 /font exch def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
736 font /f0 eq font /f1 eq font /f2 eq font /f3 eq or or or {
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
737 font F
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
738 } {
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
739 font findfont setfont
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
740 } ifelse
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
741 } bind def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
742
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
743 %% Show vacant box for characters which don't have appropriate font.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
744 /SB { % count column |- --
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
745 SpaceWidth mul /w exch def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
746 1 exch 1 exch { %for
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
747 pop
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
748 gsave
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
749 0 setlinewidth
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
750 0 Descent rmoveto w 0 rlineto
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
751 0 LineHeight rlineto w neg 0 rlineto closepath stroke
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
752 grestore
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
753 w 0 rmoveto
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
754 } for
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
755 } bind def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
756
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
757 %% Flag to tell if we are now handling a composition. This is
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
758 %% defined here because both composition handler and bitmap font
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
759 %% handler require it.
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
760 /Composing false def
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
761
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
762 %%%% End of Mule Section
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
763
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
764 "
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
765 "PostScript code for printing multi-byte characters.")
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
766
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
767 (defvar ps-mule-prologue-generated nil)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
768
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
769 (defun ps-mule-prologue-generated ()
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
770 (unless ps-mule-prologue-generated
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
771 (ps-output-prologue ps-mule-prologue)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
772 (setq ps-mule-prologue-generated t)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
773
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
774 (defun ps-mule-find-wrappoint (from to char-width &optional composition)
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
775 "Find the longest sequence which is printable in the current line.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
776
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
777 The search starts at FROM and goes until TO.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
778
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
779 Optional 4th arg COMPOSITION, if non-nil, is information of
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
780 composition starting at FROM.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
781
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
782 If COMPOSITION is nil, it is assumed that all characters between FROM
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
783 and TO belong to a charset in `ps-mule-current-charset'. Otherwise,
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
784 it is assumed that all characters between FROM and TO belong to the
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
785 same composition.
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
786
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
787 CHAR-WIDTH is the average width of ASCII characters in the current font.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
788
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
789 Returns the value:
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
790
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
791 (ENDPOS . RUN-WIDTH)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
792
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
793 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
794 the sequence."
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
795 (if (or composition (eq ps-mule-current-charset 'composition))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
796 ;; We must draw one char by one.
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
797 (let ((run-width (if composition
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
798 (nth 5 composition)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
799 (* (char-width (char-after from)) char-width))))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
800 (if (> run-width ps-width-remaining)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
801 (cons from ps-width-remaining)
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
802 (cons (if composition
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
803 (nth 1 composition)
56986
6db2681d2bf6 Fix old function calls (ps-mule-chars-in-string ->
Kenichi Handa <handa@m17n.org>
parents: 56760
diff changeset
804 (1+ from))
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
805 run-width)))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
806 ;; We assume that all characters in this range have the same width.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
807 (setq char-width (* char-width (charset-width ps-mule-current-charset)))
56760
2cd9221e3d46 Delete compatibility code for old Emacses.
Richard M. Stallman <rms@gnu.org>
parents: 56679
diff changeset
808 (let ((run-width (* (abs (- from to)) char-width)))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
809 (if (> run-width ps-width-remaining)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
810 (cons (min to
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
811 (save-excursion
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
812 (goto-char from)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
813 (forward-point
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
814 (truncate (/ ps-width-remaining char-width)))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
815 ps-width-remaining)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
816 (cons to run-width)))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
817
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
818 ;;;###autoload
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
819 (defun ps-mule-plot-string (from to &optional bg-color)
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
820 "Generate PostScript code for plotting characters in the region FROM and TO.
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
821
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
822 It is assumed that all characters in this region belong to the same charset.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
823
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
824 Optional argument BG-COLOR specifies background color.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
825
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
826 Returns the value:
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
827
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
828 (ENDPOS . RUN-WIDTH)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
829
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
830 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
831 the sequence."
61074
6a54f94240ca (ps-mule-plot-string): Translate characters by
Kenichi Handa <handa@m17n.org>
parents: 60201
diff changeset
832 (let ((ch (char-after from)))
6a54f94240ca (ps-mule-plot-string): Translate characters by
Kenichi Handa <handa@m17n.org>
parents: 60201
diff changeset
833 (setq ps-mule-current-charset
6a54f94240ca (ps-mule-plot-string): Translate characters by
Kenichi Handa <handa@m17n.org>
parents: 60201
diff changeset
834 (char-charset (or (aref ps-print-translation-table ch) ch))))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
835 (let* ((wrappoint (ps-mule-find-wrappoint
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
836 from to (ps-avg-char-width 'ps-font-for-text)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
837 (to (car wrappoint))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
838 (font-type (car (nth ps-current-font
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
839 (ps-font-alist 'ps-font-for-text))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
840 (font-spec (ps-mule-get-font-spec ps-mule-current-charset font-type))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
841 (string (buffer-substring-no-properties from to)))
61074
6a54f94240ca (ps-mule-plot-string): Translate characters by
Kenichi Handa <handa@m17n.org>
parents: 60201
diff changeset
842 (dotimes (i (length string))
6a54f94240ca (ps-mule-plot-string): Translate characters by
Kenichi Handa <handa@m17n.org>
parents: 60201
diff changeset
843 (let ((ch (aref ps-print-translation-table (aref string i))))
6a54f94240ca (ps-mule-plot-string): Translate characters by
Kenichi Handa <handa@m17n.org>
parents: 60201
diff changeset
844 (if ch
6a54f94240ca (ps-mule-plot-string): Translate characters by
Kenichi Handa <handa@m17n.org>
parents: 60201
diff changeset
845 (aset string i ch))))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
846 (cond
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
847 ((= from to)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
848 ;; We can't print any more characters in the current line.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
849 nil)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
850
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
851 (font-spec
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
852 ;; We surely have a font for printing this character set.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
853 (ps-output-string (ps-mule-string-encoding font-spec string))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
854 (ps-output " S\n"))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
855
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
856 ((eq ps-mule-current-charset 'latin-iso8859-1)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
857 ;; Latin-1 can be printed by a normal ASCII font.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
858 (ps-output-string (ps-mule-string-ascii string))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
859 (ps-output " S\n"))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
860
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
861 ;; This case is obsolete for Emacs 21.
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
862 ((eq ps-mule-current-charset 'composition)
56986
6db2681d2bf6 Fix old function calls (ps-mule-chars-in-string ->
Kenichi Handa <handa@m17n.org>
parents: 56760
diff changeset
863 (ps-mule-plot-composition from (1+ from) bg-color))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
864
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
865 (t
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
866 ;; No way to print this charset. Just show a vacant box of an
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
867 ;; appropriate width.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
868 (ps-output (format "%d %d SB\n"
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
869 (length string)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
870 (if (eq ps-mule-current-charset 'composition)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
871 (char-width (char-after from))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
872 (charset-width ps-mule-current-charset))))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
873 wrappoint))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
874
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
875 ;;;###autoload
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
876 (defun ps-mule-plot-composition (from to &optional bg-color)
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
877 "Generate PostScript code for plotting composition in the region FROM and TO.
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
878
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
879 It is assumed that all characters in this region belong to the same
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
880 composition.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
881
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
882 Optional argument BG-COLOR specifies background color.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
883
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
884 Returns the value:
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
885
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
886 (ENDPOS . RUN-WIDTH)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
887
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
888 Where ENDPOS is the end position of the sequence and RUN-WIDTH is the width of
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
889 the sequence."
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
890 (let* ((composition (find-composition from nil nil t))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
891 (wrappoint (ps-mule-find-wrappoint
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
892 from to (ps-avg-char-width 'ps-font-for-text)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
893 composition))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
894 (to (car wrappoint))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
895 (font-type (car (nth ps-current-font
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
896 (ps-font-alist 'ps-font-for-text)))))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
897 (if (< from to)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
898 ;; We can print this composition in the current line.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
899 (let ((components (nth 2 composition)))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
900 (ps-mule-plot-components
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
901 (ps-mule-prepare-font-for-components components font-type)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
902 (if (nth 3 composition) "RLC" "RBC"))))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
903 wrappoint))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
904
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
905 ;; Prepare font of FONT-TYPE for printing COMPONENTS. By side effect,
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
906 ;; change character elements in COMPONENTS to the form:
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
907 ;; ENCODED-STRING or (FONTNAME . ENCODED-STRING)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
908 ;; and change rule elements to the encoded value (integer).
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
909 ;; The latter form is used if we much change font for the character.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
910
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
911 (defun ps-mule-prepare-font-for-components (components font-type)
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
912 (dotimes (i (length components))
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
913 (let ((elt (aref components i)))
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
914 (if (consp elt)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
915 ;; ELT is a composition rule.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
916 (setq elt (encode-composition-rule elt))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
917 ;; ELT is a glyph character.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
918 (let* ((charset (char-charset elt))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
919 (font (or (eq charset ps-mule-current-charset)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
920 (if (eq charset 'ascii)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
921 (format "/f%d" ps-current-font)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
922 (format "/f%02x-%d"
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
923 (charset-id charset) ps-current-font))))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
924 str)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
925 (setq ps-mule-current-charset charset
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
926 str (ps-mule-string-encoding
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
927 (ps-mule-get-font-spec charset font-type)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
928 (char-to-string elt)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
929 'no-setfont))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
930 (if (stringp font)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
931 (setq elt (cons font str) ps-last-font font)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
932 (setq elt str))))
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
933 (aset components i elt)))
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
934 components)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
935
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
936 (defun ps-mule-plot-components (components tail)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
937 (let ((elt (aref components 0))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
938 (len (length components))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
939 (i 1))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
940 (ps-output "[ ")
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
941 (if (stringp elt)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
942 (ps-output-string elt)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
943 (ps-output (car elt) " ")
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
944 (ps-output-string (cdr elt)))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
945 (while (< i len)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
946 (setq elt (aref components i) i (1+ i))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
947 (ps-output " ")
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
948 (cond ((stringp elt)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
949 (ps-output-string elt))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
950 ((consp elt)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
951 (ps-output (car elt) " ")
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
952 (ps-output-string (cdr elt)))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
953 (t ; i.e. (integerp elt)
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
954 (ps-output (format "%d" elt)))))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
955 (ps-output " ] " tail "\n")))
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
956
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
957 ;; Composite font support
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
958
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
959 (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
960
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
961 (defconst ps-mule-composition-prologue
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
962 "%%%% Character composition handler
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
963 /RelativeCompositionSkip 0.4 def
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
964
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
965 %% Get a bounding box (relative to currentpoint) of STR.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
966 /GetPathBox { % str |- --
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
967 gsave
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
968 currentfont /FontType get 3 eq { %ifelse
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
969 stringwidth pop pop
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
970 } {
24721
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
971 currentpoint /y exch def /x exch def
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
972 false charpath flattenpath pathbbox
24721
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
973 y sub /URY exch def x sub /URX exch def
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
974 y sub /LLY exch def x sub /LLX exch def
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
975 } ifelse
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
976 grestore
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
977 } bind def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
978
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
979 %% Apply effects (underline, strikeout, overline, box) to the
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
980 %% rectangle specified by TOP BOTTOM LEFT RIGHT.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
981 /SpecialEffect { % -- |- --
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
982 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
983 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
984 %% Adjust positions for future shadowing.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
985 Effect 8 and 0 ne {
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
986 /yy yy Yshadow add def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
987 /XX XX Xshadow add def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
988 } if
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
989 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
990 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
991 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
992 bg { % background
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
993 true
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
994 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
995 } if
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
996 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
997 } def
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
998
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
999 %% Show STR with effects (shadow, outline).
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1000 /ShowWithEffect { % str |- --
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1001 Effect 8 and 0 ne { dup doShadow } if
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1002 Effect 32 and 0 ne { true doOutline } { show } ifelse
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1003 } def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1004
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1005 %% Draw COMPONENTS which have the form [ font0? [str0 xoff0 yoff0] ... ].
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1006 /ShowComponents { % components |- -
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1007 LEFT 0 lt { LEFT neg 0 rmoveto } if
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1008 {
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1009 dup type /nametype eq { % font
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1010 FM
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1011 } { % [ str xoff yoff ]
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1012 gsave
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1013 aload pop rmoveto ShowWithEffect
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1014 grestore
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1015 } ifelse
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1016 } forall
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1017 RIGHT 0 rmoveto
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1018 } def
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1019
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1020 %% Show relative composition.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1021 /RLC { % [ font0? str0 font1? str1 ... fontN? strN ] |- --
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1022 /components exch def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1023 /Composing true def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1024 /first true def
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1025 gsave
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1026 [ components {
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1027 /elt exch def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1028 elt type /nametype eq { % font
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1029 elt dup FM
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1030 } { first { % first string
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1031 /first false def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1032 elt GetPathBox
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1033 %% Bounding box of overall glyphs.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1034 /LEFT LLX def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1035 /RIGHT URX def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1036 /TOP URY def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1037 /BOTTOM LLY def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1038 currentfont /RelativeCompose known {
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1039 /relative currentfont /RelativeCompose get def
64647
0982eb053b07 (ps-mule-composition-prologue): Fix for the case that
Kenichi Handa <handa@m17n.org>
parents: 64644
diff changeset
1040 relative false eq {
0982eb053b07 (ps-mule-composition-prologue): Fix for the case that
Kenichi Handa <handa@m17n.org>
parents: 64644
diff changeset
1041 %% Disable relative composition by setting sufficiently low
0982eb053b07 (ps-mule-composition-prologue): Fix for the case that
Kenichi Handa <handa@m17n.org>
parents: 64644
diff changeset
1042 %% and high positions.
0982eb053b07 (ps-mule-composition-prologue): Fix for the case that
Kenichi Handa <handa@m17n.org>
parents: 64644
diff changeset
1043 /relative [ -100000 100000 ] def
0982eb053b07 (ps-mule-composition-prologue): Fix for the case that
Kenichi Handa <handa@m17n.org>
parents: 64644
diff changeset
1044 } if
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1045 } {
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1046 /relative [ -100000 100000 ] def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1047 } ifelse
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1048 [ elt 0 0 ]
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1049 } { % other strings
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1050 elt GetPathBox
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1051 [ elt % str
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1052 LLX 0 lt { RIGHT } { 0 } ifelse % xoff
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1053 LLY relative 1 get ge { % compose on TOP
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1054 TOP LLY sub RelativeCompositionSkip add % yoff
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1055 /TOP TOP URY LLY sub add RelativeCompositionSkip add def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1056 } { URY relative 0 get le { % compose under BOTTOM
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1057 BOTTOM URY sub RelativeCompositionSkip sub % yoff
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1058 /BOTTOM BOTTOM URY LLY sub sub
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1059 RelativeCompositionSkip sub def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1060 } {
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1061 0 % yoff
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1062 URY TOP gt { /TOP URY def } if
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1063 LLY BOTTOM lt { /BOTTOM LLY def } if
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1064 } ifelse } ifelse
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1065 ]
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1066 URX RIGHT gt { /RIGHT URX def } if
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1067 } ifelse } ifelse
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1068 } forall ] /components exch def
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1069 grestore
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1070
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1071 %% Reflect special effects.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1072 SpecialEffect
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1073
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1074 %% Draw components while ignoring effects other than shadow and outline.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1075 components ShowComponents
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1076 /Composing false def
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1077
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1078 } def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1079
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1080 %% Show rule-base composition.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1081 /RBC { % [ font0? str0 rule1 font1? str1 rule2 ... strN ] |- --
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1082 /components exch def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1083 /Composing true def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1084 /first true def
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1085 gsave
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1086 [ components {
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1087 /elt exch def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1088 elt type /nametype eq { % font
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1089 elt dup FM
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1090 } { elt type /integertype eq { % rule
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1091 %% This RULE decoding should be compatible with macro
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1092 %% 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
1093 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
1094 elt 12 mod dup 3 mod /nrefx exch def 3 idiv /nrefy exch def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1095 } { first { % first string
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1096 /first false def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1097 elt GetPathBox
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1098 %% Bounding box of overall glyphs.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1099 /LEFT LLX def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1100 /RIGHT URX def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1101 /TOP URY def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1102 /BOTTOM LLY def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1103 /WIDTH RIGHT LEFT sub def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1104 [ elt 0 0 ]
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1105 } { % other strings
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1106 elt GetPathBox
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1107 /width URX LLX sub def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1108 /height URY LLY sub def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1109 /left LEFT [ 0 WIDTH 2 div WIDTH ] grefx get add
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1110 [ 0 width 2 div width ] nrefx get sub def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1111 /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
1112 [ 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
1113 %% Update bounding box
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1114 left LEFT lt { /LEFT left def } if
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1115 left width add RIGHT gt { /RIGHT left width add def } if
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1116 /WIDTH RIGHT LEFT sub def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1117 bottom BOTTOM lt { /BOTTOM bottom def } if
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1118 bottom height add TOP gt { /TOP bottom height add def } if
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1119 [ elt left LLX sub bottom LLY sub ]
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1120 } ifelse } ifelse } ifelse
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1121 } forall ] /components exch def
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1122 grestore
38855
db1312628833 (find-composition): Check if (char-after POS)
Gerd Moellmann <gerd@gnu.org>
parents: 38816
diff changeset
1123
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1124 %% Reflect special effects.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1125 SpecialEffect
38855
db1312628833 (find-composition): Check if (char-after POS)
Gerd Moellmann <gerd@gnu.org>
parents: 38816
diff changeset
1126
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1127 %% Draw components while ignoring effects other than shadow and outline.
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1128 components ShowComponents
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1129
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1130 /Composing false def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1131 } def
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1132 %%%% End of character composition handler
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1133
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1134 "
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1135 "PostScript code for printing character composition.")
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1136
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1137 (defun ps-mule-string-ascii (str)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1138 (ps-set-font ps-current-font)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1139 (string-as-unibyte (encode-coding-string str 'iso-latin-1)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1140
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1141 ;; Encode STR for a font specified by FONT-SPEC and return the result.
37140
77ab644da66c Fix typo in comment.
Gerd Moellmann <gerd@gnu.org>
parents: 37137
diff changeset
1142 ;; If necessary, it generates the PostScript code for the font and glyphs to
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1143 ;; print STR. If optional 4th arg HEADER-P is non-nil, it is assumed that STR
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1144 ;; is for headers.
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1145 (defun ps-mule-string-encoding (font-spec str &optional no-setfont header-p)
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1146 (let ((encoding (ps-mule-font-spec-encoding font-spec)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1147 (setq str
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1148 (string-as-unibyte
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1149 (cond ((coding-system-p encoding)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1150 (encode-coding-string str encoding))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1151 ((functionp encoding)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1152 (funcall encoding str))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1153 (encoding
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1154 (error "Invalid coding system or function: %s" encoding))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1155 (t
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1156 str))))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1157 (if (ps-mule-font-spec-src font-spec)
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1158 (ps-mule-prepare-font font-spec str ps-mule-current-charset
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1159 (or no-setfont header-p)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1160 header-p)
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1161 (or no-setfont
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1162 (ps-set-font ps-current-font)))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1163 str))
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 ;; Bitmap font support
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1166
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1167 (defvar ps-mule-bitmap-prologue-generated nil)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1168
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1169 (defconst ps-mule-bitmap-prologue
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1170 "%%%% Bitmap font handler
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1171
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1172 /str7 7 string def % working area
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1173
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1174 %% We grow the dictionary one bunch (1024 entries) by one.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1175 /BitmapDictArray 256 array def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1176 /BitmapDictLength 1024 def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1177 /BitmapDictIndex -1 def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1178
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1179 /NewBitmapDict { % -- |- --
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1180 /BitmapDictIndex BitmapDictIndex 1 add def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1181 BitmapDictArray BitmapDictIndex BitmapDictLength dict put
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1182 } bind def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1183
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1184 %% Make at least one dictionary.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1185 NewBitmapDict
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1186
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1187 /AddBitmap { % gloval-charname bitmap-data |- --
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1188 BitmapDictArray BitmapDictIndex get
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1189 dup length BitmapDictLength ge {
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1190 pop
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1191 NewBitmapDict
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1192 BitmapDictArray BitmapDictIndex get
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1193 } if
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1194 3 1 roll put
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1195 } bind def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1196
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1197 /GetBitmap { % gloval-charname |- bitmap-data
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1198 0 1 BitmapDictIndex { BitmapDictArray exch get begin } for
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1199 load
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1200 0 1 BitmapDictIndex { pop end } for
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1201 } bind def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1202
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1203 %% Return a global character name which can be used as a key in the
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1204 %% bitmap dictionary.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1205 /GlobalCharName { % fontidx code1 code2 |- gloval-charname
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1206 exch 256 mul add exch 65536 mul add 16777216 add 16 str7 cvrs 0 66 put
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1207 str7 cvn
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1208 } bind def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1209
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1210 %% Character code holder for a 2-byte character.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1211 /FirstCode -1 def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1212
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1213 %% Glyph rendering procedure
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1214 /BuildGlyphCommon { % fontdict charname |- --
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1215 1 index /FontDimension get 1 eq { /FirstCode 0 store } if
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1216 NameIndexDict exch get % STACK: fontdict charcode
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1217 FirstCode 0 lt { %ifelse
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1218 %% This is the first byte of a 2-byte character. Just
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1219 %% remember it for the moment.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1220 /FirstCode exch store
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1221 pop
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1222 0 0 setcharwidth
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1223 } {
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1224 1 index /FontSize get /size exch def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1225 1 index /FontSpaceWidthRatio get /ratio exch def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1226 1 index /FontIndex get exch FirstCode exch
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1227 GlobalCharName GetBitmap /bmp exch def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1228 %% bmp == [ DWIDTH BBX-WIDTH BBX-HEIGHT BBX-XOFF BBX-YOFF BITMAP ]
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1229 Composing { %ifelse
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1230 /FontMatrix get [ exch { size div } forall ] /mtrx exch def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1231 bmp 3 get bmp 4 get mtrx transform
24721
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
1232 /LLY exch def /LLX exch def
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1233 bmp 1 get bmp 3 get add bmp 2 get bmp 4 get add mtrx transform
24721
25eb63742593 (ps-mule-prologue): Fix the definition of DefFontMule
Kenichi Handa <handa@m17n.org>
parents: 24707
diff changeset
1234 /URY exch def /URX exch def
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1235 } {
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1236 pop
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1237 } ifelse
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1238 /FirstCode -1 store
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1239
64644
734c19798185 (ps-mule-bitmap-prologue): Fix arguments to setcharwidth.
Kenichi Handa <handa@m17n.org>
parents: 64091
diff changeset
1240 bmp 0 get size div 0 % wx wy
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1241 setcharwidth % We can't use setcachedevice here.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1242
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1243 bmp 1 get 0 gt bmp 2 get 0 gt and {
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1244 bmp 1 get bmp 2 get % width height
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1245 true % polarity
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1246 [ size 0 0 size neg bmp 3 get neg bmp 2 get bmp 4 get add ] % matrix
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1247 bmp 5 1 getinterval cvx % datasrc
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1248 imagemask
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1249 } if
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1250 } ifelse
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1251 } bind def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1252
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1253 /BuildCharCommon {
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1254 1 index /Encoding get exch get
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1255 1 index /BuildGlyph get exec
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1256 } bind def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1257
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1258 %% Bitmap font creator
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1259
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1260 %% Common Encoding shared by all bitmap fonts.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1261 /EncodingCommon 256 array def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1262 %% Mapping table from character name to character code.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1263 /NameIndexDict 256 dict def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1264 0 1 255 { %for
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1265 /idx exch def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1266 /idxname idx 256 add 16 (XXX) cvrs dup 0 67 put cvn def % `C' == 67
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1267 EncodingCommon idx idxname put
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1268 NameIndexDict idxname idx put
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1269 } for
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1270
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1271 /GlobalFontIndex 0 def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1272
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1273 %% fontname dim col fontsize relative-compose baseline-offset fbbx |- --
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1274 /BitmapFont {
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1275 15 dict begin
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1276 /FontBBox exch def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1277 /BaselineOffset exch def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1278 /RelativeCompose exch def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1279 /FontSize exch def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1280 /FontBBox [ FontBBox { FontSize div } forall ] def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1281 FontBBox 2 get FontBBox 0 get sub exch div
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1282 /FontSpaceWidthRatio exch def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1283 /FontDimension exch def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1284 /FontIndex GlobalFontIndex def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1285 /FontType 3 def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1286 /FontMatrix matrix def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1287 /Encoding EncodingCommon def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1288 /BuildGlyph { BuildGlyphCommon } def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1289 /BuildChar { BuildCharCommon } def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1290 currentdict end
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1291 definefont pop
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1292 /GlobalFontIndex GlobalFontIndex 1 add def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1293 } bind def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1294
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1295 %% Define a new bitmap font.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1296 %% fontname dim col fontsize relative-compose baseline-offset fbbx |- --
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1297 /NF {
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1298 /fbbx exch def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1299 %% Convert BDF's FontBoundingBox to PostScript's FontBBox
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1300 [ fbbx 2 get fbbx 3 get
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1301 fbbx 2 get fbbx 0 get add fbbx 3 get fbbx 1 get add ]
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1302 BitmapFont
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1303 } bind def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1304
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1305 %% Define a glyph for the specified font and character.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1306 /NG { % fontname charcode bitmap-data |- --
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1307 /bmp exch def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1308 exch findfont dup /BaselineOffset get bmp 4 get add bmp exch 4 exch put
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1309 /FontIndex get exch
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1310 dup 256 idiv exch 256 mod GlobalCharName
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1311 bmp AddBitmap
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1312 } bind def
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1313 %%%% End of bitmap font handler
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1314
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1315 ")
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1316
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1317 ;; External library support.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1318
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1319 ;; 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
1320 ;; 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
1321 ;; appropriate PostScript code.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1322
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1323 (defun ps-mule-generate-bitmap-prologue ()
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1324 (unless ps-mule-bitmap-prologue-generated
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1325 (setq ps-mule-bitmap-prologue-generated t)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1326 (list ps-mule-bitmap-prologue)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1327
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1328 (defun ps-mule-generate-bitmap-font (&rest args)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1329 (list (apply 'format "/%s %d %d %f %S %d %S NF\n" args)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1330
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1331 (defun ps-mule-generate-bitmap-glyph (font-name code dwidth bbx bitmap)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1332 (format "/%s %d [ %d %d %d %d %d <%s> ] NG\n"
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1333 font-name code
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1334 dwidth (aref bbx 0) (aref bbx 1) (aref bbx 2) (aref bbx 3)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1335 bitmap))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1336
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1337 ;; Mule specific initializers.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1338
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1339 ;;;###autoload
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1340 (defun ps-mule-initialize ()
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1341 "Initialize global data for printing multi-byte characters."
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1342 (setq ps-mule-font-cache nil
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1343 ps-mule-prologue-generated nil
26882
5b331ff3b477 Define encode-composition-rule and find-composition
Kenichi Handa <handa@m17n.org>
parents: 26512
diff changeset
1344 ps-mule-composition-prologue-generated nil
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1345 ps-mule-bitmap-prologue-generated nil)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1346 (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
1347 ps-mule-external-libraries))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1348
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1349 (defvar ps-mule-header-charsets nil)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1350
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1351 ;;;###autoload
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1352 (defun ps-mule-encode-header-string (string fonttag)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1353 "Generate PostScript code for ploting STRING by font FONTTAG.
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1354 FONTTAG should be a string \"/h0\" or \"/h1\"."
38816
e4e0e5593284 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 38436
diff changeset
1355 (setq string (cond ((not (stringp string))
e4e0e5593284 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 38436
diff changeset
1356 "")
e4e0e5593284 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 38436
diff changeset
1357 ((multibyte-string-p string)
e4e0e5593284 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 38436
diff changeset
1358 (copy-sequence string))
e4e0e5593284 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 38436
diff changeset
1359 (t
e4e0e5593284 Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 38436
diff changeset
1360 (string-make-multibyte string))))
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1361 (when ps-mule-header-charsets
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1362 (if (eq (car ps-mule-header-charsets) 'latin-iso8859-1)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1363 ;; Latin1 characters can be printed by the standard PostScript
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1364 ;; font. Converts the other non-ASCII characters to `?'.
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
1365 (let ((len (length string)))
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
1366 (dotimes (i len)
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1367 (or (memq (char-charset (aref string i)) '(ascii latin-iso8859-1))
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
1368 (aset string i ??)))
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1369 (setq string (encode-coding-string string 'iso-latin-1)))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1370 ;; We must prepare a font for the first non-ASCII and non-Latin1
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1371 ;; character in STRING.
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1372 (let* ((ps-current-font (if (string= fonttag "/h0") 0 1))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1373 (ps-mule-current-charset (car ps-mule-header-charsets))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1374 (font-type (car (nth ps-current-font
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1375 (ps-font-alist 'ps-font-for-header))))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1376 (font-spec (ps-mule-get-font-spec ps-mule-current-charset
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1377 font-type)))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1378 (if (or (not font-spec)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1379 (/= (charset-dimension ps-mule-current-charset) 1))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1380 ;; We don't have a proper font, or we can't print them on
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1381 ;; header because this kind of charset is not ASCII
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1382 ;; compatible.
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
1383 (let ((len (length string)))
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
1384 (dotimes (i len)
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1385 (or (memq (char-charset (aref string i))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1386 '(ascii latin-iso8859-1))
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
1387 (aset string i ??)))
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1388 (setq string (encode-coding-string string 'iso-latin-1)))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1389 (let ((charsets (list 'ascii (car ps-mule-header-charsets)))
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
1390 (len (length string)))
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
1391 (dotimes (i len)
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1392 (or (memq (char-charset (aref string i)) charsets)
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
1393 (aset string i ??))))
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1394 (setq string (ps-mule-string-encoding font-spec string nil t))))))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1395 string)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1396
60201
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1397 (defun ps-mule-show-warning (charsets from to header-footer-list)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1398 (let ((table (make-category-table))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1399 (buf (current-buffer))
61257
a4c269a9f159 (ps-mule-show-warning): If the number of unprintable
Kenichi Handa <handa@m17n.org>
parents: 61076
diff changeset
1400 (max-unprintable-chars 15)
60201
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1401 char-pos-list)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1402 (define-category ?u "Unprintable charset" table)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1403 (dolist (cs charsets)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1404 (modify-category-entry (make-char cs) ?u table))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1405 (with-category-table table
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1406 (save-excursion
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1407 (goto-char from)
61257
a4c269a9f159 (ps-mule-show-warning): If the number of unprintable
Kenichi Handa <handa@m17n.org>
parents: 61076
diff changeset
1408 (while (and (<= (length char-pos-list) max-unprintable-chars)
60201
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1409 (re-search-forward "\\cu" to t))
65748
980399883216 (ps-mule-show-warning): If a character is in
Kenichi Handa <handa@m17n.org>
parents: 64762
diff changeset
1410 (or (aref ps-print-translation-table (preceding-char))
980399883216 (ps-mule-show-warning): If a character is in
Kenichi Handa <handa@m17n.org>
parents: 64762
diff changeset
1411 (push (cons (preceding-char) (1- (point))) char-pos-list)))))
60201
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1412 (with-output-to-temp-buffer "*Warning*"
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1413 (with-current-buffer standard-output
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1414 (when char-pos-list
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1415 (let ((func #'(lambda (buf pos)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1416 (when (buffer-live-p buf)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1417 (pop-to-buffer buf)
61257
a4c269a9f159 (ps-mule-show-warning): If the number of unprintable
Kenichi Handa <handa@m17n.org>
parents: 61076
diff changeset
1418 (goto-char pos))))
a4c269a9f159 (ps-mule-show-warning): If the number of unprintable
Kenichi Handa <handa@m17n.org>
parents: 61076
diff changeset
1419 (more nil))
a4c269a9f159 (ps-mule-show-warning): If the number of unprintable
Kenichi Handa <handa@m17n.org>
parents: 61076
diff changeset
1420 (if (>= (length char-pos-list) max-unprintable-chars)
a4c269a9f159 (ps-mule-show-warning): If the number of unprintable
Kenichi Handa <handa@m17n.org>
parents: 61076
diff changeset
1421 (setq char-pos-list (cdr char-pos-list)
a4c269a9f159 (ps-mule-show-warning): If the number of unprintable
Kenichi Handa <handa@m17n.org>
parents: 61076
diff changeset
1422 more t))
60201
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1423 (insert "These characters in the buffer can't be printed:\n")
61257
a4c269a9f159 (ps-mule-show-warning): If the number of unprintable
Kenichi Handa <handa@m17n.org>
parents: 61076
diff changeset
1424 (dolist (elt (nreverse char-pos-list))
60201
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1425 (insert " ")
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1426 (insert-text-button (string (car elt))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1427 :type 'help-xref
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1428 'help-echo
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1429 "mouse-2, RET: jump to this character"
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1430 'help-function func
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1431 'help-args (list buf (cdr elt)))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1432 (insert ","))
61257
a4c269a9f159 (ps-mule-show-warning): If the number of unprintable
Kenichi Handa <handa@m17n.org>
parents: 61076
diff changeset
1433 (if more
a4c269a9f159 (ps-mule-show-warning): If the number of unprintable
Kenichi Handa <handa@m17n.org>
parents: 61076
diff changeset
1434 (insert " and more...")
a4c269a9f159 (ps-mule-show-warning): If the number of unprintable
Kenichi Handa <handa@m17n.org>
parents: 61076
diff changeset
1435 ;; Delete the last comma.
a4c269a9f159 (ps-mule-show-warning): If the number of unprintable
Kenichi Handa <handa@m17n.org>
parents: 61076
diff changeset
1436 (delete-char -1))
60201
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1437 (insert "\nClick them to jump to the buffer position,\n"
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1438 (substitute-command-keys "\
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1439 or \\[universal-argument] \\[what-cursor-position] will give information about them.\n"))))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1440
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1441 (with-category-table table
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
1442 (let (string-list)
60201
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1443 (dolist (elt header-footer-list)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1444 (when (stringp elt)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1445 (when (string-match "\\cu+" elt)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1446 (setq elt (copy-sequence elt))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1447 (put-text-property (match-beginning 0) (match-end 0)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1448 'face 'highlight elt)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1449 (while (string-match "\\cu+" elt (match-end 0))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1450 (put-text-property (match-beginning 0) (match-end 0)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1451 'face 'highlight elt))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1452 (push elt string-list))))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1453 (when string-list
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1454 (insert
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1455 "These highlighted characters in header/footer can't be printed:\n")
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1456 (dolist (elt string-list)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1457 (insert " " elt "\n")))))))))
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1458
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1459 ;;;###autoload
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1460 (defun ps-mule-begin-job (from to)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1461 "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
1462 It checks if all multi-byte characters in the region are printable or not."
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1463 (setq ps-mule-charset-list nil
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1464 ps-mule-header-charsets nil
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1465 ps-mule-font-info-database
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1466 (cond ((eq ps-multibyte-buffer 'non-latin-printer)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1467 ps-mule-font-info-database-ps)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1468 ((eq ps-multibyte-buffer 'bdf-font)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1469 ps-mule-font-info-database-bdf)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1470 ((eq ps-multibyte-buffer 'bdf-font-except-latin)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1471 ps-mule-font-info-database-ps-bdf)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1472 (t
24707
fded44022dc6 (ps-mule-begin-job): Redo this change "if
Kenichi Handa <handa@m17n.org>
parents: 24415
diff changeset
1473 ps-mule-font-info-database-default)))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1474 (and (boundp 'enable-multibyte-characters)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1475 enable-multibyte-characters
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1476 ;; Initialize `ps-mule-charset-list'. If some characters aren't
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1477 ;; printable, warn it.
60201
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1478 (let ((header-footer-list (ps-header-footer-string))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1479 unprintable-charsets)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1480 (setq ps-mule-charset-list
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1481 (delq 'ascii (delq 'eight-bit-control
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1482 (delq 'eight-bit-graphic
61074
6a54f94240ca (ps-mule-plot-string): Translate characters by
Kenichi Handa <handa@m17n.org>
parents: 60201
diff changeset
1483 (find-charset-region
6a54f94240ca (ps-mule-plot-string): Translate characters by
Kenichi Handa <handa@m17n.org>
parents: 60201
diff changeset
1484 from to ps-print-translation-table))))
60201
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1485 ps-mule-header-charsets
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1486 (delq 'ascii (delq 'eight-bit-control
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1487 (delq 'eight-bit-graphic
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1488 (find-charset-string
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1489 (mapconcat
61074
6a54f94240ca (ps-mule-plot-string): Translate characters by
Kenichi Handa <handa@m17n.org>
parents: 60201
diff changeset
1490 'identity header-footer-list "")
6a54f94240ca (ps-mule-plot-string): Translate characters by
Kenichi Handa <handa@m17n.org>
parents: 60201
diff changeset
1491 ps-print-translation-table)))))
60201
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1492 (dolist (cs ps-mule-charset-list)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1493 (or (ps-mule-printable-p cs)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1494 (push cs unprintable-charsets)))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1495 (dolist (cs ps-mule-header-charsets)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1496 (or (ps-mule-printable-p cs)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1497 (memq cs unprintable-charsets)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1498 (push cs unprintable-charsets)))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1499 (when unprintable-charsets
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1500 (ps-mule-show-warning unprintable-charsets from to
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1501 header-footer-list)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1502 (or
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1503 (y-or-n-p "Font for some characters not found, continue anyway? ")
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1504 (error "Printing cancelled")))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1505
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1506 (or ps-mule-composition-prologue-generated
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1507 (let ((use-composition (nth 2 (find-composition from to))))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1508 (or use-composition
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1509 (let (str)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1510 (while header-footer-list
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1511 (setq str (car header-footer-list))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1512 (if (and (stringp str)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1513 (nth 2 (find-composition 0 (length str) str)))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1514 (setq use-composition t
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1515 header-footer-list nil)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1516 (setq header-footer-list (cdr header-footer-list))))))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1517 (when use-composition
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1518 (progn
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1519 (ps-mule-prologue-generated)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1520 (ps-output-prologue ps-mule-composition-prologue)
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1521 (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
1522
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1523 (setq ps-mule-current-charset 'ascii)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1524
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1525 (if (or ps-mule-charset-list ps-mule-header-charsets)
60201
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1526 (dolist (elt (append ps-mule-header-charsets ps-mule-charset-list))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1527 (ps-mule-prologue-generated)
60201
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1528 (ps-mule-init-external-library (ps-mule-get-font-spec elt 'normal))))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1529
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1530 ;; If ASCII font is also specified in ps-mule-font-info-database,
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1531 ;; use it instead of what specified in ps-font-info-database.
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1532 (let ((font-spec (ps-mule-get-font-spec 'ascii 'normal)))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1533 (if font-spec
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1534 (progn
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1535 (ps-mule-prologue-generated)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1536 (ps-mule-init-external-library font-spec)
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
1537 (let ((ps-current-font 0))
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
1538 (dolist (font (ps-font-alist 'ps-font-for-text))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1539 ;; Be sure to download a glyph for SPACE in advance.
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
1540 (ps-mule-prepare-font (ps-mule-get-font-spec 'ascii font)
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1541 " " 'ascii 'no-setfont)
82095
b5773fe4ea48 (ps-multibyte-buffer): Docstring fixes.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 81629
diff changeset
1542 (setq ps-current-font (1+ ps-current-font)))))))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1543
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1544 ;; If the header contains non-ASCII and non-Latin1 characters, prepare a font
45899
e44f3ea2c30c Fix typo.
Juanma Barranquero <lekktu@gmail.com>
parents: 45334
diff changeset
1545 ;; and glyphs for the first occurrence of such characters.
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1546 (if (and ps-mule-header-charsets
60201
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1547 (not (eq (car ps-mule-header-charsets) 'latin-iso8859-1))
0d38d6148c13 (ps-mule-header-string-charsets): Delete it.
Kenichi Handa <handa@m17n.org>
parents: 56986
diff changeset
1548 (= (charset-dimension (car ps-mule-header-charsets)) 1))
37137
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1549 (let ((font-spec (ps-mule-get-font-spec (car ps-mule-header-charsets)
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1550 'normal)))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1551 (if font-spec
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1552 ;; Be sure to download glyphs for "0123456789/" in advance for page
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1553 ;; numbering.
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1554 (let ((ps-current-font 0))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1555 (ps-mule-prepare-font font-spec "0123456789/" 'ascii t t)))))
b960119b9c18 XEmacs compatibility. Doc fix.
Gerd Moellmann <gerd@gnu.org>
parents: 30561
diff changeset
1556
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1557 (if ps-mule-charset-list
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1558 ;; We must change this regexp for multi-byte buffer.
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1559 (setq ps-control-or-escape-regexp
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1560 (cond ((eq ps-print-control-characters '8-bit)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1561 "[^\040-\176]")
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1562 ((eq ps-print-control-characters 'control-8-bit)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1563 (string-as-multibyte "[^\040-\176\240-\377]"))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1564 ((eq ps-print-control-characters 'control)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1565 (string-as-multibyte "[^\040-\176\200-\377]"))
25086
799c44a895fe (ps-mule-begin-job): Fix malformed regexp.
Kenichi Handa <handa@m17n.org>
parents: 24722
diff changeset
1566 (t (string-as-multibyte "[^\000-\011\013\015-\377]"))))))
23894
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1567
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1568 ;;;###autoload
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1569 (defun ps-mule-begin-page ()
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1570 (setq ps-mule-current-charset 'ascii))
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1571
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1572
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1573 (provide 'ps-mule)
f96c37cbdeef New file. Mule related code extracted from
Kenichi Handa <handa@m17n.org>
parents: 23893
diff changeset
1574
81629
e293b291c59f Set generated-autoload-file to "ps-print.el".
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
1575 ;; Local Variables:
e293b291c59f Set generated-autoload-file to "ps-print.el".
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
1576 ;; 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
1577 ;; End:
e293b291c59f Set generated-autoload-file to "ps-print.el".
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
1578
e293b291c59f Set generated-autoload-file to "ps-print.el".
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 75347
diff changeset
1579 ;; 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
1580 ;;; ps-mule.el ends here