1 #include "xrisk.h"
2 #include "risklibex.h"
3
load_risk_font(disp,pxfs,name)4 int load_risk_font(disp, pxfs, name)
5 Display *disp;
6 XFontStruct **pxfs;
7 char *name;
8 {
9 if ( ! ((*pxfs) = XLoadQueryFont(disp,name))
10 || (*pxfs)->max_bounds.width != 6
11 || (*pxfs)->ascent + (*pxfs)->descent != 13)
12 return(0);
13 return(1);
14 }
15
assign_font(player)16 int assign_font(player)
17 playerp player;
18 {
19 XFontStruct *xfs;
20 xconp xinfo;
21 XGCValues values;
22
23 xinfo = player->xcon;
24 if (!load_risk_font(xinfo->disp,&xfs,"fixed")
25 && !load_risk_font(xinfo->disp,&xfs,"6x13"))
26 risk_exit("Unable to find 6x13 font on client %s\n",
27 player->client);
28 values.font = xfs->fid;
29 XChangeGC(xinfo->disp,xinfo->gc,GCFont,&values);
30 return(1);
31 }
32