X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/0d9f702fd085bc8ad560a3e1f08d5e93054a5d33..7031be6d49cb78d4cc4a2604b899144824abfeca:/lwlib/lwlib-Xaw.c diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c index ba7740a452..9c9a007bc1 100644 --- a/lwlib/lwlib-Xaw.c +++ b/lwlib/lwlib-Xaw.c @@ -1,7 +1,7 @@ /* The lwlib interface to Athena widgets. + Copyright (C) 1993 Chuck Thompson -Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005, 2006, - 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +Copyright (C) 1994, 2001-2011 Free Software Foundation, Inc. This file is part of the Lucid Widget Library. @@ -28,7 +28,7 @@ Boston, MA 02110-1301, USA. */ #include #include -#include "../src/lisp.h" +#include #include "lwlib-Xaw.h" @@ -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; @@ -834,4 +841,3 @@ xaw_creation_table [] = {"main", xaw_create_main}, {NULL, NULL} }; -