For information on installing and using fontsets with an application, refer to Chapter 5, "Working With Fonts."
Such multiple-codeset strings usually cannot be rendered using a single font. A fontset is a collection of fonts suitable for rendering all codesets represented in a locale's encoding. A fontset includes information to indicate which locale it was created in. Applications create fontsets for their own use; when a program creates a fontset, it is told which of the requested fonts are unavailable.
char *fontSetSpecString = "*fixed-medium-r-normal*150*";Based on the fonts available, a particular server might expand this to a string such as:
-jis-fixed-medium-r-normal--16-150-75-75-c-160-jisx0208.1983-0 -sony-fixed-medium-r-normal--16-150-75-75-c-80-iso8859-1 -sony-fixed-medium-r-normal--16-150-75-75-c-80-jisx0201.1976-0Specifying the fontset by simply enumerating the fonts is perfectly acceptable:
char *fontSetSpecString = "-jis-fixed-medium-r-normal*150-75-75*jisx0208.1983-0,\ -sony-fixed-medium-r-normal*150-75-75*iso8859-1,\ -sony-fixed-medium-r-normal*150-75-75*jisx0201.1976-0";A German locale would work with only the ISO font; a Japanese locale might use all three; a Chinese locale would have trouble with this fontset.
The developer should specify a default fontset suitable for the default locale. Furthermore, developers should ensure that the application accepts localized fontset specifications via resources (or message catalogs) or command line options. Localizers are responsible for providing default fontset specifications suitable for their locales.
Example 6-6 : Creating a Fontset
XFontSet fontset; char *base_name; /* should get from resource */ char **missingCharsetList; int missingCharsetCount; char *defaultStringForMissingCharsets; base_name = "*fixed-medium-r*150*"; /* use resources! */ fontset = XCreateFontSet(display, base_name, &missingCharsetList, &missingCharsetCount, &defaultStringForMissingCharsets);The locale in effect at create time is bound to the fontset. Fontsets are freed with XFreeFontSet().