1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-06-26 15:12:48 +00:00

fixed CAP_TABFONT

This commit is contained in:
Zeno Rogue 2025-06-22 15:42:39 +02:00
parent 537a3b8779
commit c2a9e313d2
2 changed files with 7 additions and 2 deletions

View File

@ -484,10 +484,12 @@ struct fontdata {
#endif
EX map<string, fontdata> fontdatas;
EX fontdata *cfont, *cfont_chinese;
EX fontdata* font_by_name(string fname) {
#if CAP_TABFONT
return &(fontdatas[""]);
#endif
auto& fd = fontdatas[fname];
if(fd.filename == "") {
fd.filename = fname;
@ -1527,6 +1529,9 @@ EX void init_font() {
exit(2);
}
set_cfont();
#endif
#if CAP_TABFONT
cfont = cfont_chinese = font_by_name("");
#endif
}

View File

@ -173,7 +173,7 @@ int arg::readCommon() {
else if(argis("-rsrc")) { PHASE(1); shift(); rsrcdir = args(); }
else if(argis("-nogui")) { PHASE(1); noGUI = true; }
#ifndef EMSCRIPTEN
#if CAP_SDL
#if CAP_SDLTTF
else if(argis("-font")) { PHASE(1); shift(); font_id = isize(font_filenames); font_filenames.push_back(args()); font_names.push_back({args(), "commandline"}); }
#endif
#endif