Next: , Previous: , Up: Mule   [Contents][Index]


17.5 Mule and Fonts

(This section is X11-specific.)

Text in SXEmacs 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 ccl-program.

Font registry is a regular expression matching the font registry field for this character set. For example, both the ascii and latin-iso8859-1 charsets use the registry "ISO8859-1". This field is used to choose an appropriate font when the user gives a general font specification such as ‘-*-courier-medium-r-*-140-*, i.e. a 14-point upright medium-weight Courier font.

You can set font registry for a charset using ‘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. g., for Cyrillic texts Mule uses cyrillic-iso8859-5 charset with ‘"ISO8859-5"’ as a default registry, and we want to use ‘"koi8-r"’ instead, because fonts in that encoding are installed on our system. Use:

(set-charset-registry 'cyrillic-iso8859-5 "koi8-r")

(Please note that you probably also want to set font registry for ‘ascii’ charset so that mixed English/Cyrillic texts be displayed using the same font.)

"CCL-programs" are a little special-purpose scripts defined within SXEmacs or in some package. Those scripts allow SXEmacs 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 SXEmacs that we have different encodings of fonts and text and so it needs to convert characters between those encodings when displaying. That’s what ‘set-charset-ccl-program’ function is used for. There are quite a few various CCL programs defined within SXEmacs, and there is no comprehensive list of them, so you currently have to consult sources.

We know that there is a CCL program called ‘ccl-encode-koi8-r-font’ that is used exactly for needed purpose: to convert characters between ‘ISO8859-5’ encoding and ‘koi8-r’. Use:

(set-charset-ccl-program 'cyrillic-iso8859-5 'ccl-encode-koi8-r-font)

There are several more uses for CCL programs, not related to fonts, but those uses are not described here.


Next: , Previous: , Up: Mule   [Contents][Index]