20 Compound Strings
This chapter describes Motif's technology for encoding font changes and character directions in the strings that are
used by almost all of the Motif widgets.
Compound strings are designed to address two issues frequently encountered by application designers: the use of
foreign character sets to display text in other languages and the use of multiple fonts to render text. With the addition
of internationalized string rendering capabilities in X11R5, the use of compound strings for internationalization
purposes is theoretically no longer necessary. However, the Motif widget set still uses compound strings extensively,
so applications have no choice but to create them to display text.
20.1 Internationalized Text Output
The internationalization features in X11R5 are based on the ANSI−C locale model. Under this model, an application
uses a library that reads a customization database at run−time to get information about the user's language
environment. An Xt−based application can establish its language environment (or locale) by registering a language
procedure with XtSetLanguageProc(), as described in Section #slangproc. The language procedure returns a
language string that is used by XtResolvePathname() to find locale−specific resource files. See Volume Four,
X Toolkit Intrinsics Programming Manual, for more information on the localization of the resource database.
One of the important characteristics of a language environment is the encoding that is used to represent the