Motif Internationalization Programming
Text Output

In Motif, text is usually represented as a compound string (XmString) and rendered with a font list (XmFontList). Motif widgets are internationalized so that labels and menu items on a widget are drawn in a locale-specific language if localized, using compound text and font list.

The following are the Motif functions related to font list:

-------------------------------------------------------------------
Function		  Description
-------------------------------------------------------------------
XmFontListEntryLoad	  Creates a font list
XmFontListEntryCreate	  Creates a font list entry
XmFontListAppendEntry     Appends a font list entry to a font list
XmFontListFree		  Frees the memory of a font list
XmFontListEntryFree	  Frees the memory of a font list entry
-------------------------------------------------------------------
The following are the Motif functions related to compound string:
------------------------------------------------------------------------------
Function		    Description
------------------------------------------------------------------------------
XmStringCreateLocalized	    Creates a compound string from a multibyte string
XmStringFree		    Frees the memory of a compound string
------------------------------------------------------------------------------
The following are the mappings of international functions and non-international functions regarding compound string:
-------------------------------------------------
Non-international	 International
function		 function
-------------------------------------------------
XmStringCreateSimple     XmStringCreateLocalized
XmStringCreateLtoR	 XmStringCreateLocalized
-------------------------------------------------

Note that it is easier to define Motif widgets in resource files or UIL files statically than create them dynamically in source codes. This is the case for font list and compound string. You should call the above functions only when you control the text and font dynamically.

Go to Internationalization Programming Top


Copyright (C) 2012 Kokusaika JP, Inc.
All rights reserved. No reproduction or republication without written permission.