Restoring old bigFont, making new headFont instead.

Now we'll see the original font for the credits and the clock.
This commit is contained in:
Electric Keet 2023-08-02 20:49:01 -07:00
parent 14d1e83cd6
commit ebf8ebf7c0
4 changed files with 69 additions and 68 deletions

View file

@ -285,7 +285,7 @@ void FurnaceGUI::drawAbout() {
for (size_t i=0; i<aboutCount; i++) { for (size_t i=0; i<aboutCount; i++) {
double posX=(canvasW/2.0)+(sin(double(i)*0.5+double(aboutScroll)/(90.0*dpiScale))*120*dpiScale)-(ImGui::CalcTextSize(aboutLine[i]).x*0.5); double posX=(canvasW/2.0)+(sin(double(i)*0.5+double(aboutScroll)/(90.0*dpiScale))*120*dpiScale)-(ImGui::CalcTextSize(aboutLine[i]).x*0.5);
double posY=(canvasH-aboutScroll+settings.bigFontSize*7/6*i*dpiScale); double posY=(canvasH-aboutScroll+42*i*dpiScale);
if (posY<-80*dpiScale || posY>canvasH) continue; if (posY<-80*dpiScale || posY>canvasH) continue;
dl->AddText(bigFont,bigFont->FontSize, dl->AddText(bigFont,bigFont->FontSize,
ImVec2(posX+dpiScale,posY+dpiScale), ImVec2(posX+dpiScale,posY+dpiScale),

View file

@ -1835,7 +1835,7 @@ void FurnaceGUI::openFileDialog(FurnaceGUIFileDialogs type) {
dpiScale dpiScale
); );
break; break;
case GUI_FILE_LOAD_BIG_FONT: case GUI_FILE_LOAD_HEAD_FONT:
if (!dirExists(workingDirFont)) workingDirFont=getHomeDir(); if (!dirExists(workingDirFont)) workingDirFont=getHomeDir();
hasOpened=fileDialog->openLoad( hasOpened=fileDialog->openLoad(
"Select Font", "Select Font",
@ -4632,7 +4632,7 @@ bool FurnaceGUI::loop() {
workingDirROMExport=fileDialog->getPath()+DIR_SEPARATOR_STR; workingDirROMExport=fileDialog->getPath()+DIR_SEPARATOR_STR;
break; break;
case GUI_FILE_LOAD_MAIN_FONT: case GUI_FILE_LOAD_MAIN_FONT:
case GUI_FILE_LOAD_BIG_FONT: case GUI_FILE_LOAD_HEAD_FONT:
case GUI_FILE_LOAD_PAT_FONT: case GUI_FILE_LOAD_PAT_FONT:
workingDirFont=fileDialog->getPath()+DIR_SEPARATOR_STR; workingDirFont=fileDialog->getPath()+DIR_SEPARATOR_STR;
break; break;
@ -5094,8 +5094,8 @@ bool FurnaceGUI::loop() {
case GUI_FILE_LOAD_MAIN_FONT: case GUI_FILE_LOAD_MAIN_FONT:
settings.mainFontPath=copyOfName; settings.mainFontPath=copyOfName;
break; break;
case GUI_FILE_LOAD_BIG_FONT: case GUI_FILE_LOAD_HEAD_FONT:
settings.bigFontPath=copyOfName; settings.headFontPath=copyOfName;
break; break;
case GUI_FILE_LOAD_PAT_FONT: case GUI_FILE_LOAD_PAT_FONT:
settings.patFontPath=copyOfName; settings.patFontPath=copyOfName;

View file

@ -423,7 +423,7 @@ enum FurnaceGUIFileDialogs {
GUI_FILE_EXPORT_CMDSTREAM_BINARY, GUI_FILE_EXPORT_CMDSTREAM_BINARY,
GUI_FILE_EXPORT_ROM, GUI_FILE_EXPORT_ROM,
GUI_FILE_LOAD_MAIN_FONT, GUI_FILE_LOAD_MAIN_FONT,
GUI_FILE_LOAD_BIG_FONT, GUI_FILE_LOAD_HEAD_FONT,
GUI_FILE_LOAD_PAT_FONT, GUI_FILE_LOAD_PAT_FONT,
GUI_FILE_IMPORT_COLORS, GUI_FILE_IMPORT_COLORS,
GUI_FILE_IMPORT_KEYBINDS, GUI_FILE_IMPORT_KEYBINDS,
@ -1370,6 +1370,7 @@ class FurnaceGUI {
ImFont* iconFont; ImFont* iconFont;
ImFont* patFont; ImFont* patFont;
ImFont* bigFont; ImFont* bigFont;
ImFont* headFont;
ImWchar* fontRange; ImWchar* fontRange;
ImVec4 uiColors[GUI_COLOR_MAX]; ImVec4 uiColors[GUI_COLOR_MAX];
ImVec4 volColors[128]; ImVec4 volColors[128];
@ -1388,7 +1389,7 @@ class FurnaceGUI {
char emptyLabel2[32]; char emptyLabel2[32];
struct Settings { struct Settings {
int mainFontSize, bigFontSize, patFontSize, iconSize; int mainFontSize, headFontSize, patFontSize, iconSize;
int audioEngine; int audioEngine;
int audioQuality; int audioQuality;
int audioChans; int audioChans;
@ -1405,7 +1406,7 @@ class FurnaceGUI {
String tg100Path; String tg100Path;
String mu5Path; String mu5Path;
int mainFont; int mainFont;
int bigFont; int headFont;
int patFont; int patFont;
int audioRate; int audioRate;
int audioBufSize; int audioBufSize;
@ -1528,7 +1529,7 @@ class FurnaceGUI {
int noDMFCompat; int noDMFCompat;
unsigned int maxUndoSteps; unsigned int maxUndoSteps;
String mainFontPath; String mainFontPath;
String bigFontPath; String headFontPath;
String patFontPath; String patFontPath;
String audioDevice; String audioDevice;
String midiInDevice; String midiInDevice;
@ -1684,7 +1685,7 @@ class FurnaceGUI {
noDMFCompat(0), noDMFCompat(0),
maxUndoSteps(100), maxUndoSteps(100),
mainFontPath(""), mainFontPath(""),
bigFontPath(""), headFontPath(""),
patFontPath(""), patFontPath(""),
audioDevice(""), audioDevice(""),
midiInDevice(""), midiInDevice(""),

View file

@ -58,7 +58,7 @@ const char* mainFonts[]={
"<Custom...>" "<Custom...>"
}; };
const char* bigFonts[]={ const char* headFonts[]={
"IBM Plex Sans", "IBM Plex Sans",
"Liberation Sans", "Liberation Sans",
"Exo", "Exo",
@ -252,7 +252,7 @@ const char* specificControls[18]={
} else { \ } else { \
_subInit=true; \ _subInit=true; \
} \ } \
ImGui::PushFont(bigFont); \ ImGui::PushFont(headFont); \
ImGui::TextUnformatted(what); \ ImGui::TextUnformatted(what); \
ImGui::PopFont(); ImGui::PopFont();
@ -1867,19 +1867,19 @@ void FurnaceGUI::drawSettings() {
if (settings.mainFontSize<3) settings.mainFontSize=3; if (settings.mainFontSize<3) settings.mainFontSize=3;
if (settings.mainFontSize>96) settings.mainFontSize=96; if (settings.mainFontSize>96) settings.mainFontSize=96;
} }
ImGui::Text("Big font"); ImGui::Text("Head font");
ImGui::SameLine(); ImGui::SameLine();
ImGui::Combo("##BigFont",&settings.bigFont,bigFonts,7); ImGui::Combo("##HeadFont",&settings.headFont,headFonts,7);
if (settings.bigFont==6) { if (settings.headFont==6) {
ImGui::InputText("##BigFontPath",&settings.bigFontPath); ImGui::InputText("##HeadFontPath",&settings.headFontPath);
ImGui::SameLine(); ImGui::SameLine();
if (ImGui::Button(ICON_FA_FOLDER "##BigFontLoad")) { if (ImGui::Button(ICON_FA_FOLDER "##HeadFontLoad")) {
openFileDialog(GUI_FILE_LOAD_BIG_FONT); openFileDialog(GUI_FILE_LOAD_HEAD_FONT);
} }
} }
if (ImGui::InputInt("Size##BigFontSize",&settings.bigFontSize)) { if (ImGui::InputInt("Size##HeadFontSize",&settings.headFontSize)) {
if (settings.bigFontSize<3) settings.bigFontSize=3; if (settings.headFontSize<3) settings.headFontSize=3;
if (settings.bigFontSize>96) settings.bigFontSize=96; if (settings.headFontSize>96) settings.headFontSize=96;
} }
ImGui::Text("Pattern font"); ImGui::Text("Pattern font");
ImGui::SameLine(); ImGui::SameLine();
@ -2736,7 +2736,7 @@ void FurnaceGUI::drawSettings() {
void FurnaceGUI::syncSettings() { void FurnaceGUI::syncSettings() {
settings.mainFontSize=e->getConfInt("mainFontSize",18); settings.mainFontSize=e->getConfInt("mainFontSize",18);
settings.bigFontSize=e->getConfInt("bigFontSize",36); settings.headFontSize=e->getConfInt("headFontSize",36);
settings.patFontSize=e->getConfInt("patFontSize",18); settings.patFontSize=e->getConfInt("patFontSize",18);
settings.iconSize=e->getConfInt("iconSize",16); settings.iconSize=e->getConfInt("iconSize",16);
settings.audioEngine=(e->getConfString("audioEngine","SDL")=="SDL")?1:0; settings.audioEngine=(e->getConfString("audioEngine","SDL")=="SDL")?1:0;
@ -2762,10 +2762,10 @@ void FurnaceGUI::syncSettings() {
settings.tg100Path=e->getConfString("tg100Path",""); settings.tg100Path=e->getConfString("tg100Path","");
settings.mu5Path=e->getConfString("mu5Path",""); settings.mu5Path=e->getConfString("mu5Path","");
settings.mainFont=e->getConfInt("mainFont",0); settings.mainFont=e->getConfInt("mainFont",0);
settings.bigFont=e->getConfInt("bigFont",0); settings.headFont=e->getConfInt("headFont",0);
settings.patFont=e->getConfInt("patFont",0); settings.patFont=e->getConfInt("patFont",0);
settings.mainFontPath=e->getConfString("mainFontPath",""); settings.mainFontPath=e->getConfString("mainFontPath","");
settings.bigFontPath=e->getConfString("bigFontPath",""); settings.headFontPath=e->getConfString("headFontPath","");
settings.patFontPath=e->getConfString("patFontPath",""); settings.patFontPath=e->getConfString("patFontPath","");
settings.patRowsBase=e->getConfInt("patRowsBase",0); settings.patRowsBase=e->getConfInt("patRowsBase",0);
settings.orderRowsBase=e->getConfInt("orderRowsBase",1); settings.orderRowsBase=e->getConfInt("orderRowsBase",1);
@ -2893,7 +2893,7 @@ void FurnaceGUI::syncSettings() {
settings.noDMFCompat=e->getConfInt("noDMFCompat",0); settings.noDMFCompat=e->getConfInt("noDMFCompat",0);
clampSetting(settings.mainFontSize,2,96); clampSetting(settings.mainFontSize,2,96);
clampSetting(settings.bigFontSize,2,96); clampSetting(settings.headFontSize,2,96);
clampSetting(settings.patFontSize,2,96); clampSetting(settings.patFontSize,2,96);
clampSetting(settings.iconSize,2,48); clampSetting(settings.iconSize,2,48);
clampSetting(settings.audioEngine,0,1); clampSetting(settings.audioEngine,0,1);
@ -3095,7 +3095,7 @@ void FurnaceGUI::commitSettings() {
); );
e->setConf("mainFontSize",settings.mainFontSize); e->setConf("mainFontSize",settings.mainFontSize);
e->setConf("bigFontSize",settings.bigFontSize); e->setConf("headFontSize",settings.headFontSize);
e->setConf("patFontSize",settings.patFontSize); e->setConf("patFontSize",settings.patFontSize);
e->setConf("iconSize",settings.iconSize); e->setConf("iconSize",settings.iconSize);
e->setConf("audioEngine",String(audioBackends[settings.audioEngine])); e->setConf("audioEngine",String(audioBackends[settings.audioEngine]));
@ -3121,10 +3121,10 @@ void FurnaceGUI::commitSettings() {
e->setConf("tg100Path",settings.tg100Path); e->setConf("tg100Path",settings.tg100Path);
e->setConf("mu5Path",settings.mu5Path); e->setConf("mu5Path",settings.mu5Path);
e->setConf("mainFont",settings.mainFont); e->setConf("mainFont",settings.mainFont);
e->setConf("bigFont",settings.mainFont); e->setConf("headFont",settings.mainFont);
e->setConf("patFont",settings.patFont); e->setConf("patFont",settings.patFont);
e->setConf("mainFontPath",settings.mainFontPath); e->setConf("mainFontPath",settings.mainFontPath);
e->setConf("bigFontPath",settings.bigFontPath); e->setConf("headFontPath",settings.headFontPath);
e->setConf("patFontPath",settings.patFontPath); e->setConf("patFontPath",settings.patFontPath);
e->setConf("patRowsBase",settings.patRowsBase); e->setConf("patRowsBase",settings.patRowsBase);
e->setConf("orderRowsBase",settings.orderRowsBase); e->setConf("orderRowsBase",settings.orderRowsBase);
@ -3297,7 +3297,7 @@ void FurnaceGUI::commitSettings() {
ImGui::GetIO().Fonts->Clear(); ImGui::GetIO().Fonts->Clear();
mainFont=ImGui::GetIO().Fonts->AddFontDefault(); mainFont=ImGui::GetIO().Fonts->AddFontDefault();
patFont=mainFont; patFont=mainFont;
bigFont=mainFont; headFont=mainFont;
if (rend) rend->destroyFontsTexture(); if (rend) rend->destroyFontsTexture();
if (!ImGui::GetIO().Fonts->Build()) { if (!ImGui::GetIO().Fonts->Build()) {
logE("error again while building font atlas!"); logE("error again while building font atlas!");
@ -3681,10 +3681,10 @@ void FurnaceGUI::popWarningColor() {
// TODO! // TODO!
#define SYSTEM_FONT_PATH_3 "C:\\Windows\\Fonts\\tahoma.ttf" #define SYSTEM_FONT_PATH_3 "C:\\Windows\\Fonts\\tahoma.ttf"
// TODO! // TODO!
#define SYSTEM_BIG_FONT_PATH_1 "C:\\Windows\\Fonts\\segoeui.ttf" #define SYSTEM_HEAD_FONT_PATH_1 "C:\\Windows\\Fonts\\segoeui.ttf"
#define SYSTEM_BIG_FONT_PATH_2 "C:\\Windows\\Fonts\\tahoma.ttf" #define SYSTEM_HEAD_FONT_PATH_2 "C:\\Windows\\Fonts\\tahoma.ttf"
// TODO! // TODO!
#define SYSTEM_BIG_FONT_PATH_3 "C:\\Windows\\Fonts\\tahoma.ttf" #define SYSTEM_HEAD_FONT_PATH_3 "C:\\Windows\\Fonts\\tahoma.ttf"
// TODO! // TODO!
#define SYSTEM_PAT_FONT_PATH_1 "C:\\Windows\\Fonts\\consola.ttf" #define SYSTEM_PAT_FONT_PATH_1 "C:\\Windows\\Fonts\\consola.ttf"
#define SYSTEM_PAT_FONT_PATH_2 "C:\\Windows\\Fonts\\cour.ttf" #define SYSTEM_PAT_FONT_PATH_2 "C:\\Windows\\Fonts\\cour.ttf"
@ -3694,9 +3694,9 @@ void FurnaceGUI::popWarningColor() {
#define SYSTEM_FONT_PATH_1 "/System/Library/Fonts/SFAANS.ttf" #define SYSTEM_FONT_PATH_1 "/System/Library/Fonts/SFAANS.ttf"
#define SYSTEM_FONT_PATH_2 "/System/Library/Fonts/Helvetica.ttc" #define SYSTEM_FONT_PATH_2 "/System/Library/Fonts/Helvetica.ttc"
#define SYSTEM_FONT_PATH_3 "/System/Library/Fonts/Helvetica.dfont" #define SYSTEM_FONT_PATH_3 "/System/Library/Fonts/Helvetica.dfont"
#define SYSTEM_BIG_FONT_PATH_1 "/System/Library/Fonts/SFAANS.ttf" #define SYSTEM_HEAD_FONT_PATH_1 "/System/Library/Fonts/SFAANS.ttf"
#define SYSTEM_BIG_FONT_PATH_2 "/System/Library/Fonts/Helvetica.ttc" #define SYSTEM_HEAD_FONT_PATH_2 "/System/Library/Fonts/Helvetica.ttc"
#define SYSTEM_BIG_FONT_PATH_3 "/System/Library/Fonts/Helvetica.dfont" #define SYSTEM_HEAD_FONT_PATH_3 "/System/Library/Fonts/Helvetica.dfont"
#define SYSTEM_PAT_FONT_PATH_1 "/System/Library/Fonts/SFNSMono.ttf" #define SYSTEM_PAT_FONT_PATH_1 "/System/Library/Fonts/SFNSMono.ttf"
#define SYSTEM_PAT_FONT_PATH_2 "/System/Library/Fonts/Courier New.ttf" #define SYSTEM_PAT_FONT_PATH_2 "/System/Library/Fonts/Courier New.ttf"
#define SYSTEM_PAT_FONT_PATH_3 "/System/Library/Fonts/Courier New.ttf" #define SYSTEM_PAT_FONT_PATH_3 "/System/Library/Fonts/Courier New.ttf"
@ -3705,9 +3705,9 @@ void FurnaceGUI::popWarningColor() {
#define SYSTEM_FONT_PATH_2 "/system/fonts/DroidSans.ttf" #define SYSTEM_FONT_PATH_2 "/system/fonts/DroidSans.ttf"
#define SYSTEM_FONT_PATH_3 "/system/fonts/DroidSans.ttf" #define SYSTEM_FONT_PATH_3 "/system/fonts/DroidSans.ttf"
// ??? // ???
#define SYSTEM_BIG_FONT_PATH_1 "/system/fonts/Roboto-Regular.ttf" #define SYSTEM_HEAD_FONT_PATH_1 "/system/fonts/Roboto-Regular.ttf"
#define SYSTEM_BIG_FONT_PATH_2 "/system/fonts/DroidSans.ttf" #define SYSTEM_HEAD_FONT_PATH_2 "/system/fonts/DroidSans.ttf"
#define SYSTEM_BIG_FONT_PATH_3 "/system/fonts/DroidSans.ttf" #define SYSTEM_HEAD_FONT_PATH_3 "/system/fonts/DroidSans.ttf"
#define SYSTEM_PAT_FONT_PATH_1 "/system/fonts/RobotoMono-Regular.ttf" #define SYSTEM_PAT_FONT_PATH_1 "/system/fonts/RobotoMono-Regular.ttf"
#define SYSTEM_PAT_FONT_PATH_2 "/system/fonts/DroidSansMono.ttf" #define SYSTEM_PAT_FONT_PATH_2 "/system/fonts/DroidSansMono.ttf"
#define SYSTEM_PAT_FONT_PATH_3 "/system/fonts/CutiveMono.ttf" #define SYSTEM_PAT_FONT_PATH_3 "/system/fonts/CutiveMono.ttf"
@ -3715,9 +3715,9 @@ void FurnaceGUI::popWarningColor() {
#define SYSTEM_FONT_PATH_1 "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" #define SYSTEM_FONT_PATH_1 "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
#define SYSTEM_FONT_PATH_2 "/usr/share/fonts/TTF/DejaVuSans.ttf" #define SYSTEM_FONT_PATH_2 "/usr/share/fonts/TTF/DejaVuSans.ttf"
#define SYSTEM_FONT_PATH_3 "/usr/share/fonts/ubuntu/Ubuntu-R.ttf" #define SYSTEM_FONT_PATH_3 "/usr/share/fonts/ubuntu/Ubuntu-R.ttf"
#define SYSTEM_BIG_FONT_PATH_1 "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf" #define SYSTEM_HEAD_FONT_PATH_1 "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"
#define SYSTEM_BIG_FONT_PATH_2 "/usr/share/fonts/TTF/DejaVuSans.ttf" #define SYSTEM_HEAD_FONT_PATH_2 "/usr/share/fonts/TTF/DejaVuSans.ttf"
#define SYSTEM_BIG_FONT_PATH_3 "/usr/share/fonts/ubuntu/Ubuntu-R.ttf" #define SYSTEM_HEAD_FONT_PATH_3 "/usr/share/fonts/ubuntu/Ubuntu-R.ttf"
#define SYSTEM_PAT_FONT_PATH_1 "/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf" #define SYSTEM_PAT_FONT_PATH_1 "/usr/share/fonts/truetype/dejavu/DejaVuSansMono.ttf"
#define SYSTEM_PAT_FONT_PATH_2 "/usr/share/fonts/TTF/DejaVuSansMono.ttf" #define SYSTEM_PAT_FONT_PATH_2 "/usr/share/fonts/TTF/DejaVuSansMono.ttf"
#define SYSTEM_PAT_FONT_PATH_3 "/usr/share/fonts/ubuntu/UbuntuMono-R.ttf" #define SYSTEM_PAT_FONT_PATH_3 "/usr/share/fonts/ubuntu/UbuntuMono-R.ttf"
@ -3958,16 +3958,16 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
} }
if (settings.mainFont<0 || settings.mainFont>6) settings.mainFont=0; if (settings.mainFont<0 || settings.mainFont>6) settings.mainFont=0;
if (settings.bigFont<0 || settings.bigFont>6) settings.bigFont=0; if (settings.headFont<0 || settings.headFont>6) settings.headFont=0;
if (settings.patFont<0 || settings.patFont>6) settings.patFont=0; if (settings.patFont<0 || settings.patFont>6) settings.patFont=0;
if (settings.mainFont==6 && settings.mainFontPath.empty()) { if (settings.mainFont==6 && settings.mainFontPath.empty()) {
logW("UI font path is empty! reverting to default font"); logW("UI font path is empty! reverting to default font");
settings.mainFont=0; settings.mainFont=0;
} }
if (settings.bigFont==6 && settings.bigFontPath.empty()) { if (settings.headFont==6 && settings.headFontPath.empty()) {
logW("UI font path is empty! reverting to default font"); logW("UI font path is empty! reverting to default font");
settings.bigFont=0; settings.headFont=0;
} }
if (settings.patFont==6 && settings.patFontPath.empty()) { if (settings.patFont==6 && settings.patFontPath.empty()) {
logW("pattern font path is empty! reverting to default font"); logW("pattern font path is empty! reverting to default font");
@ -4054,41 +4054,41 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
// 0x39B = Λ // 0x39B = Λ
static const ImWchar bigFontRange[]={0x20,0xFF,0x39b,0x39b,0}; static const ImWchar bigFontRange[]={0x20,0xFF,0x39b,0x39b,0};
/*
if ((bigFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(font_plexSans_compressed_data,font_plexSans_compressed_size,MAX(1,40*dpiScale),NULL,bigFontRange))==NULL) { if ((bigFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(font_plexSans_compressed_data,font_plexSans_compressed_size,MAX(1,40*dpiScale),NULL,bigFontRange))==NULL) {
logE("could not load big UI font!"); logE("could not load big UI font!");
} }
*/
if (settings.mainFontSize==settings.bigFontSize && settings.bigFont<5 && builtinFontM[settings.bigFont]==builtinFont[settings.mainFont]) { if (settings.mainFontSize==settings.headFontSize && settings.headFont<5 && builtinFontM[settings.headFont]==builtinFont[settings.mainFont]) {
logD("using main font for big font."); logD("using main font for header font.");
bigFont=mainFont; headFont=mainFont;
} else { } else {
if (settings.bigFont==6) { // custom font if (settings.headFont==6) { // custom font
if ((bigFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(settings.bigFontPath.c_str(),MAX(1,e->getConfInt("bigFontSize",36)*dpiScale),NULL,upTo800))==NULL) { if ((headFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(settings.headFontPath.c_str(),MAX(1,e->getConfInt("headFontSize",36)*dpiScale),NULL,upTo800))==NULL) {
logW("could not load big font! reverting to default font"); logW("could not load header font! reverting to default font");
settings.bigFont=0; settings.headFont=0;
if ((bigFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.bigFont],builtinFontMLen[settings.bigFont],MAX(1,e->getConfInt("bigFontSize",36)*dpiScale),NULL,bigFontRange))==NULL) { if ((headFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.headFont],builtinFontMLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",36)*dpiScale),NULL,upTo800))==NULL) {
logE("could not load big font! falling back to IBM Plex Sans."); logE("could not load header font! falling back to IBM Plex Sans.");
bigFont=ImGui::GetIO().Fonts->AddFontDefault(); headFont=ImGui::GetIO().Fonts->AddFontDefault();
} }
} }
} else if (settings.bigFont==5) { // system font } else if (settings.headFont==5) { // system font
if ((bigFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_BIG_FONT_PATH_1,MAX(1,e->getConfInt("bigFontSize",36)*dpiScale),NULL,upTo800))==NULL) { if ((headFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_HEAD_FONT_PATH_1,MAX(1,e->getConfInt("headFontSize",36)*dpiScale),NULL,upTo800))==NULL) {
if ((bigFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_BIG_FONT_PATH_2,MAX(1,e->getConfInt("bigFontSize",36)*dpiScale),NULL,upTo800))==NULL) { if ((headFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_HEAD_FONT_PATH_2,MAX(1,e->getConfInt("headFontSize",36)*dpiScale),NULL,upTo800))==NULL) {
if ((bigFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_BIG_FONT_PATH_3,MAX(1,e->getConfInt("bigFontSize",36)*dpiScale),NULL,upTo800))==NULL) { if ((headFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_HEAD_FONT_PATH_3,MAX(1,e->getConfInt("headFontSize",36)*dpiScale),NULL,upTo800))==NULL) {
logW("could not load big font! reverting to default font"); logW("could not load header font! reverting to default font");
settings.bigFont=0; settings.headFont=0;
if ((bigFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.bigFont],builtinFontMLen[settings.bigFont],MAX(1,e->getConfInt("bigFontSize",36)*dpiScale),NULL,upTo800))==NULL) { if ((headFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.headFont],builtinFontMLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",36)*dpiScale),NULL,upTo800))==NULL) {
logE("could not load big font! falling back to IBM Plex Sans."); logE("could not load header font! falling back to IBM Plex Sans.");
bigFont=ImGui::GetIO().Fonts->AddFontDefault(); headFont=ImGui::GetIO().Fonts->AddFontDefault();
} }
} }
} }
} }
} else { } else {
if ((bigFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.bigFont],builtinFontMLen[settings.bigFont],MAX(1,e->getConfInt("bigFontSize",36)*dpiScale),NULL,upTo800))==NULL) { if ((headFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.headFont],builtinFontMLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",36)*dpiScale),NULL,upTo800))==NULL) {
logE("could not load big font!"); logE("could not load header font!");
bigFont=ImGui::GetIO().Fonts->AddFontDefault(); headFont=ImGui::GetIO().Fonts->AddFontDefault();
} }
} }
} }