Hello,
below is a set of patches describing how Mule deals with fonts (that's
what I promised to write during "Re: some MULE inconsistencies [with
patch]" discussion that happened at the end of April.
First, a patch to lisp/mule/cyrillic.el that uncomments the definition
of needed ccl-program and slightly renames it:
--- cyrillic.el 2001/06/05 20:16:35 1.1
+++ cyrillic.el 2001/06/05 20:16:44
@@ -137,11 +137,11 @@
;; `iso-8-1' is not correct, but XEmacs doesn't have a `ccl' category
(coding-system-put 'koi8-r 'category 'iso-8-1)
-;; (define-ccl-program ccl-encode-koi8-font
-;; `(0
-;; ((r1 |= 128)
-;; (r1 = r1 ,cyrillic-koi8-r-encode-table)))
-;; "CCL program to encode Cyrillic chars to KOI font.")
+(define-ccl-program ccl-encode-koi8-r-font
+ `(0
+ ((r1 |= 128)
+ (r1 = r1 ,cyrillic-koi8-r-encode-table)))
+ "CCL program to encode Cyrillic chars to koi8-r font.")
;; (setq font-ccl-encoder-alist
;; (cons (cons "koi8" ccl-encode-koi8-font) font-ccl-encoder-alist))
Second, a patch to man/xemacs/mule.texi that adds a new section called
"Mule and fonts". Please feel free to edit it wrt English or
functionality. I'm not sure if it adequately describes the situation,
but at least something should be said about fonts.
This patch is supposed to apply to what I think is current beta
mule.texi (from 21.4.1 + patches from Martin):
[ look below for third]
--- mule.texi 2001/06/05 19:23:59 1.3
+++ mule.texi 2001/06/05 20:44:45
@@ -30,6 +30,7 @@
* Language Environments:: Setting things up for the language you use.
* Input Methods:: Entering text characters not on your keyboard.
* Select Input Method:: Specifying your choice of input methods.
+* Mule and Fonts:: Additional font-related issues
* Coding Systems:: Character set conversion when you read and
write files, and so on.
* Recognize Coding:: How XEmacs figures out which conversion to use.
@@ -71,7 +72,7 @@
@cindex language environments
All supported character sets are supported in XEmacs buffers if it is
-compile with mule; there is no need to select a particular language in
+compiled with Mule; there is no need to select a particular language in
order to display its characters in an XEmacs buffer. However, it is
important to select a @dfn{language environment} in order to set various
defaults. The language environment really represents a choice of
@@ -190,7 +191,7 @@
characters to type next is displayed in the echo area (but not when you
are in the minibuffer).
-@node Select Input Method, Coding Systems, Input Methods, Mule
+@node Select Input Method, Mule and Fonts, Input Methods, Mule
@section Selecting an Input Method
@table @kbd
@@ -252,7 +253,71 @@
list-input-methods}. The list gives information about each input
method, including the string that stands for it in the mode line.
-@node Coding Systems, Recognize Coding, Select Input Method, Mule
+@node Mule and Fonts, Coding Systems, Select Input Method, Mule
+@section Mule and Fonts
+@cindex fonts
+@cindex font registry
+@cindex font encoding
+@cindex CCL programs
+
+(This section is X11-specific.)
+
+Text in XEmacs buffers is displayed using various faces. In addition to
+specifying properties of a face, such as font and color, there are some
+additional properties of Mule charsets that are used in text.
+
+There is currently two properties of a charset that could be adjusted by
+user: font registry and so called @dfn{ccl-program}.
+
+Font registry is a regular expression matching the font registry field
+for this character set. For example, both the @code{ascii} and
+@w{@code{latin-iso8859-1}} charsets use the registry @code{"ISO8859-1"}.
+This field is used to choose an appropriate font when the user gives a
+general font specification such as @w{@samp{-*-courier-medium-r-*-140-*}},
+i.e. a 14-point upright medium-weight Courier font.
+
+You can set font registry for a charset using
+@samp{set-charset-registry} function in one of your startup files. This
+function takes two arguments: character set (as a symbol) and font
+registry (as a string).
+
+E.@w{ }g., for Cyrillic texts Mule uses @w{@code{cyrillic-iso8859-5}}
+charset with @samp{"ISO8859-5"} as a default registry, and we want to
+use @samp{"koi8-r"} instead, because fonts in that encoding are
+installed on our system. Use:
+
+@example
+(set-charset-registry 'cyrillic-iso8859-5 "koi8-r")
+@end example
+
+(Please note that you probably also want to set font registry for
+@samp{ascii} charset so that mixed English/Cyrillic texts be displayed
+using the same font.)
+
+"CCL-programs" are a little special-purpose scripts defined within
+XEmacs or in some package. Those scripts allow XEmacs to use fonts that
+are in different encoding from the encoding that is used by Mule for
+text in buffer. Returning to the above example, we need to somehow tell
+XEmacs that we have different encodings of fonts and text and so it
+needs to convert characters between those encodings when displaying.
+That's what @samp{set-charset-ccl-program} function is used for. There
+are quite a few various CCL programs defined within XEmacs, and there is
+no comprehensive list of them, so you currently have to consult sources.
+@c FIXME: there must be a list of CCL programs
+
+We know that there is a CCL program called @samp{ccl-encode-koi8-r-font}
+that is used exactly for needed purpose: to convert characters between
+@samp{ISO8859-5} encoding and @samp{koi8-r}. Use:
+
+@example
+(set-charset-ccl-program 'cyrillic-iso8859-5 'ccl-encode-koi8-r-font)
+@end example
+
+There are several more uses for CCL programs, not related to fonts, but
+those uses are not described here.
+
+
+@node Coding Systems, Recognize Coding, Mule and Fonts, Mule
@section Coding Systems
@cindex coding systems
Third, an obvious patch to man/lispref/mule.texi, to catch up with
reality:
--- mule.texi 2001/06/03 19:27:35 1.1
+++ mule.texi 2001/06/03 19:56:48
@@ -442,14 +442,19 @@
position codes of characters in @var{charset} into font indices.
@end defun
- The only property of a charset that can currently be set after
-the charset has been created is the CCL program.
+ The two properties of a charset that can currently be set after the
+charset has been created are the CCL program and the font registry.
@defun set-charset-ccl-program charset ccl-program
This function sets the @code{ccl-program} property of @var{charset} to
@var{ccl-program}.
@end defun
+@defun set-charset-registry charset registry
+This function sets the @code{registry} property of @var{charset} to
+@var{registry}.
+@end defun
+
@node Predefined Charsets, , Charset Property Functions, Charsets
@subsection Predefined Charsets
@@ -501,8 +506,8 @@
ethiopic 94x94 2 0 l2r Ethio
ascii-r2l 94 B 0 r2l ISO8859-1
ipa 96 0 1 l2r MuleIPA
-vietnamese-lower 96 1 1 l2r VISCII1.1
-vietnamese-upper 96 2 1 l2r VISCII1.1
+vietnamese-viscii-lower 96 1 1 l2r VISCII1.1
+vietnamese-viscii-upper 96 2 1 l2r VISCII1.1
@end example
For all of the above charsets, the dimension and number of columns are
--alexm