|
|
HP Xlib Extensions: > Chapter 7 Internationalization Support Internationalized Output |
|
X11 R5 provides support for internationalized output through the use of font sets, which are accessed through XCreateFontSet and its associated routines. That X standard capability should be used instead of the associate font mechanism explained in this chapter. The associate font mechanism explained here was provided by HP to support internationalized text output before the X standard supported this functionality. The HP associate font mechanism is provided to maintain compatibility with software that still uses the HP associate font mechanism for internationalized output. However, this mechanism will be removed from the library at the next major release of HP-UX. Xlib provides transparent text handling capability, including mixed 8-bit and 16-bit characters, for the following six Xlib functions:
In order to allow these functions to support mixed 8-bit and 16-bit characters, the following functions will concurrently load and unload separate 8-bit (font) and 16-bit (associate font) files.
If the following conditions are fulfilled when loading a font with XLoadFont or XLoadQueryFont, an 8- and 16-bit mixed font will be loaded by Xlib, until XFreeFont or XUnloadFont are called.
In summary, XLoadFont and XLoadQueryFont look for the font properties LANGUAGE and ASSOCIATE_FONT in the specified font first. If either or both are undefined, then the environment variables LANG and XASSOCFONT are examined instead. If the logically mixed font is implicitly specified as the font argument for XTextWidth, XTextExtents, XQueryTextExtents, XDrawText, XDrawString, or XDrawImageString, then the string argument for these functions may point to a string containing mixed 8- and 16-bit characters encoded by HP-15 or EUC. Otherwise, all the characters will be interpreted as 8-bit characters. This provides transparency with standard X11 fonts. For a specified font, which includes both the language and the associate font designations, XQueryFont and XLoadQueryFont return a pointer to the XFontStruct structure of the specified font. To obtain the XFontStruct of the associate font, use the XHPGet16bitMixedFontStruct.
Title not available (Getting the Associate Font )
If the specified font is a mixed 8- and 16-bit font, XHPGet16bitMixedFontStruct returns a pointer to an XFontStruct structure of the associated font. If the specified font is not an 8- and 16-bit mixed font, then NULL is returned. The XFontStruct structure returned by this function may not be freed. To determine if two bytes are defined as a 16-bit character for a specified font, use XHPIs16bitCharacter.
Title not available (Checking for 16-bit Characters )
XHPIs16bitCharacter returns True if byte1 and byte2 are defined as the first and second bytes of a 16-bit character. In this function, the 16-bit character is based on HP-15 or EUC encoding determined by the language designation included in the specified font. This function should not be called for EUC data in HP-UX 10.0 or later releases, since EUC characters can then consist of 24-bit or 32-bit values. Results of this routine on such data is undefined. To convert an X11 Keysym into an HP Roman 8 character, use the XHPKeysymToRoman8 function.
Title not available (Conversions Between X11 Keysyms and HP Roman 8 Codes)
XHPKeysymToRoman8 takes an X11 KeySym and converts it to an HP Roman 8 character. The character is returned to the location pointed to by r8_return. If no Roman 8 character for keysym exists, then XHPKeysymToRoman8 returns 0 (zero) and *r8_return remains unchanged. Some Keysyms are unique to Hewlett-Packard equipment because Roman 8 contains characters that were not encoded in the Keysyms distributed by MIT. To convert an HP Roman 8 character into an X11 KeySym, use XHPRoman8ToKeysym.
XHPRoman8ToKeysym takes an HP Roman 8 character and returns a KeySym.
|
|