Use *font for Xft font names for Lucid menus and dialogs.
[bpt/emacs.git] / lwlib / lwlib-Xaw.c
index 19c2440..9c9a007 100644 (file)
@@ -577,13 +577,20 @@ make_dialog (char* name,
     if (w) 
       {
         XtResource rec[] = 
-          { { "faceName", "FaceName", XtRString, sizeof(String), 0, XtRString,
-              (XtPointer)"Sans-14" }};
-        char *faceName;
-        XtVaGetSubresources (dialog, &faceName, "Dialog", "dialog",
+          { { "font", "Font", XtRString, sizeof(String), 0, XtRString,
+              (XtPointer)"Sans-10" }};
+        char *fontName = NULL;
+        XtVaGetSubresources (dialog, &fontName, "Dialog", "dialog",
                              rec, 1, (String)NULL);
-        if (strcmp ("none", faceName) != 0)
-          xft_font = openFont (dialog, faceName);
+        if (fontName)
+          {
+            XFontStruct *xfn = XLoadQueryFont (XtDisplay (dialog), fontName);
+            if (!xfn)
+              xft_font = openFont (dialog, fontName);
+            else
+              XFreeFont (XtDisplay (dialog), xfn);
+          }
+        
         if (xft_font) 
           {
             instance->nr_xft_data = left_buttons + right_buttons + 1;