Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Common Desktop Environment: Internationalization Programmer's Guide > Chapter 2 Internationalization and the Common Desktop Environment

Drawing Localized Text

» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

There are several mechanisms provided to render a localized string, depending on the Motif or Xlib library being used. The following discusses the interfaces that are recommended for internationalized applications. Yet, it is recommended that all localized data be externalized from the program using the simple text. For more information on this subject, refer to Xlib - C Language Interface.

Simple Text

The following Xlib multibyte (char*) drawing functions are available for internationalization:

  • XmbDrawImageString()

  • XmbDrawString()

  • XmbDrawText()

The following Xlib wide character (wchar_t*) drawing functions are available for internationalization:

  • XwcDrawImageString()

  • XwcDrawString()

  • XwcDrawText()

The following Xlib multibyte (char*) font metric functions are available for internationalization:

  • XExtentsOfFontSet()

  • XmbTextEscapement()

  • XmbTextExtents()

  • XmbTextPerCharExtents

The following Xlib wide character (char_t*) font metric functions are available for internationalization:

  • XExtentsOfFontSet()

  • XwcTextEscapement()

  • XwcTextExtents()

  • XwcTextPerCharExtents

XmString (Compound String)

For the Motif library, localized text should be inserted into XmString segments using XmStringGenerate(). The tag associated with localized text is XmFONTLIST_DEFAULT_TAG, which is used to match an entry in a render table.

A localized string can be written in resource files because a compound string specified in resource files has a locale-encoded segment with Xm_FONTLIST_DEFAULT_TAG. For example, the renderTable resource in the following example is automatically associated with XmFONTLIST_DEFAULT_TAG.

labelString: Japanese string
*renderTable:-dt-interface system-medium-r-normal-L*-*-*-*-*-*-*:

The following set of XmString functions is recommend for internationalization:

  • XmStringCreateLocalized()

  • XmStringDraw()

  • XmStringDrawImage()

  • XmStringDrawUnderline()

The following set of XmString functions is not recommend for internationalization because it takes a direction that may not work with languages not covered:

  • XmStringCreateLtoR()

  • XmStringSegmentCreate()

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.