/* This file brings from GetFont.c */
#include <FVWMconfig.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <fvwm/fvwmlib.h>
/*
** loads fontset or "fixed" on failure
*/
XFontSet GetFontSetOrFixed(Display *disp, char *fontname)
{
XFontSet fontset;
char **ml;
int mc;
char *ds;
if ((fontset = XCreateFontSet(disp,fontname,&ml,&mc,&ds))==NULL)
{
fprintf(stderr,
"[GetFontSetOrFixed]: WARNING -- can't get fontset %s, trying 'fixed'",
fontname);
/* fixed should always be avail, so try that */
if ((fontset = XCreateFontSet(disp,"fixed",&ml,&mc,&ds))==NULL)
{
fprintf(stderr,"[GetFontSetOrFixed]: ERROR -- can't get fontset 'fixed'");
}
}
return fontset;
}
syntax highlighted by Code2HTML, v. 0.9.1