UTF8 Support

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

I am trying to run my application on Suse Linux and Motif 2.3 under locale fr_FR.UTF-8.  If I specify a 10646 font, the characters all display as boxes, if I specify a 8859-1 font, the accented characters display as two bytes.

I tried writing a test program, and when there is no resource file it displays accented characters correctly.  But if I add a resource file containing just:

*fontList:         -adobe-helvetica-bold-r-normal--*-120-*-*-*-*-iso10646-1

Then the characters display as boxes.  The test program is:

Widget toplevel;
XtAppContext appContext;
Widget form, label, text;
XmString s1,s2;
XmRendition rendition;
XmRenderTable rtable;
Arg args[14];
Cardinal n;

String fallback[] = {
"*label.labelString: compound_string(\"?????????_int\")",
"*label1.renderTable: one",
"*label2.renderTable: two",
"*label3.renderTable: three",

"*one.fontType: FONT_IS_FONTSET",
"*one.fontName: -*-*-medium-r-normal-*-14-*-*-*-*-*-*-*:",

"*two.fontType: FONT_IS_XFT",
"*two.fontName: Times",
"*two.fontSize: 10",

"*three.fontType: FONT_IS_FONTSET",
"*three.fontName: -*-*-*-*-*-*-*-*-*-*-*-*-iso10646-*",

XtSetLanguageProc(NULL, NULL, NULL);
toplevel = XtVaAppInitialize(&appContext, "App", NULL, 0, &argc, argv, fallback,
XmNtitle, "abcdef", NULL);

form = XtVaCreateWidget("form", xmFormWidgetClass, toplevel, NULL);

char string1[] = "ÀÇÊ";
s1 = XmStringCreate(string1, "one");
label = XtVaCreateManagedWidget("label1", xmLabelGadgetClass, form, XmNlabelString, s1, XmNtopAttachment, XmATTACH_FORM, NULL);



Can anybody tell me what is happening?  Ultimately I need to use a resource file to specify the fonts.


Keith Hafen




Anonymous (not verified)
Thu, 09/20/2012 - 13:06
2 posts / 0 new
Last post
Fri, 09/21/2012 - 17:16