MCPcopy Create free account
hub / github.com/NetHack/NetHack / wc_set_font_name

Function wc_set_font_name

src/options.c:9978–10010  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9976}
9977
9978staticfn void
9979wc_set_font_name(int opttype, char *fontname)
9980{
9981 char **fn = (char **) 0;
9982
9983 if (!fontname)
9984 return;
9985 switch (opttype) {
9986 case MAP_OPTION:
9987 fn = &iflags.wc_font_map;
9988 break;
9989 case MESSAGE_OPTION:
9990 fn = &iflags.wc_font_message;
9991 break;
9992 case TEXT_OPTION:
9993 fn = &iflags.wc_font_text;
9994 break;
9995 case MENU_OPTION:
9996 fn = &iflags.wc_font_menu;
9997 break;
9998 case STATUS_OPTION:
9999 fn = &iflags.wc_font_status;
10000 break;
10001 default:
10002 return;
10003 }
10004 if (fn) {
10005 if (*fn)
10006 free((genericptr_t) *fn);
10007 *fn = dupstr(fontname);
10008 }
10009 return;
10010}
10011
10012static char **fgp[] = { &iflags.wcolors[wcolor_menu].fg,
10013 &iflags.wcolors[wcolor_message].fg,

Callers 1

pfxfn_fontFunction · 0.85

Calls 1

dupstrFunction · 0.85

Tested by

no test coverage detected