compress fonts using zlib
- smaller - better - ugly big-endian workaround no longer necessary
This commit is contained in:
parent
c894ababc0
commit
44973de675
19 changed files with 168771 additions and 65734 deletions
|
|
@ -5694,7 +5694,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
if ((mainFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(settings.mainFontPath.c_str(),MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fontConf,fontRange))==NULL) {
|
||||
logW("could not load UI font! reverting to default font");
|
||||
settings.mainFont=0;
|
||||
if ((mainFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFont[settings.mainFont],builtinFontLen[settings.mainFont],MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fontConf,fontRange))==NULL) {
|
||||
if ((mainFont=addFontZlib(builtinFont[settings.mainFont],builtinFontLen[settings.mainFont],MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fontConf,fontRange))==NULL) {
|
||||
logE("could not load UI font! falling back to Proggy Clean.");
|
||||
mainFont=ImGui::GetIO().Fonts->AddFontDefault();
|
||||
}
|
||||
|
|
@ -5705,7 +5705,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
if ((mainFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_FONT_PATH_3,MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fontConf,fontRange))==NULL) {
|
||||
logW("could not load UI font! reverting to default font");
|
||||
settings.mainFont=0;
|
||||
if ((mainFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFont[settings.mainFont],builtinFontLen[settings.mainFont],MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fontConf,fontRange))==NULL) {
|
||||
if ((mainFont=addFontZlib(builtinFont[settings.mainFont],builtinFontLen[settings.mainFont],MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fontConf,fontRange))==NULL) {
|
||||
logE("could not load UI font! falling back to Proggy Clean.");
|
||||
mainFont=ImGui::GetIO().Fonts->AddFontDefault();
|
||||
}
|
||||
|
|
@ -5713,16 +5713,16 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if ((mainFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFont[settings.mainFont],builtinFontLen[settings.mainFont],MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fontConf,fontRange))==NULL) {
|
||||
if ((mainFont=addFontZlib(builtinFont[settings.mainFont],builtinFontLen[settings.mainFont],MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fontConf,fontRange))==NULL) {
|
||||
logE("could not load UI font! falling back to Proggy Clean.");
|
||||
mainFont=ImGui::GetIO().Fonts->AddFontDefault();
|
||||
}
|
||||
}
|
||||
|
||||
// two fallback fonts
|
||||
mainFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(font_liberationSans_compressed_data,font_liberationSans_compressed_size,MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fc1,fontRange);
|
||||
mainFont=addFontZlib(font_liberationSans_compressed_data,font_liberationSans_compressed_size,MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fc1,fontRange);
|
||||
if (settings.loadJapanese || settings.loadChinese || settings.loadChineseTraditional || settings.loadKorean) {
|
||||
mainFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(font_unifont_compressed_data,font_unifont_compressed_size,MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fc1,fontRange);
|
||||
mainFont=addFontZlib(font_unifont_compressed_data,font_unifont_compressed_size,MAX(1,e->getConfInt("mainFontSize",18)*dpiScale),&fc1,fontRange);
|
||||
}
|
||||
|
||||
ImFontConfig fc;
|
||||
|
|
@ -5732,12 +5732,12 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
fc.PixelSnapH=true;
|
||||
fc.GlyphMinAdvanceX=e->getConfInt("iconSize",16)*dpiScale;
|
||||
static const ImWchar fontRangeIcon[]={ICON_MIN_FA,ICON_MAX_FA,0};
|
||||
if ((iconFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(iconFont_compressed_data,iconFont_compressed_size,MAX(1,e->getConfInt("iconSize",16)*dpiScale),&fc,fontRangeIcon))==NULL) {
|
||||
if ((iconFont=addFontZlib(iconFont_compressed_data,iconFont_compressed_size,MAX(1,e->getConfInt("iconSize",16)*dpiScale),&fc,fontRangeIcon))==NULL) {
|
||||
logE("could not load icon font!");
|
||||
}
|
||||
|
||||
static const ImWchar fontRangeFurIcon[]={ICON_MIN_FUR,ICON_MAX_FUR,0};
|
||||
if ((furIconFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(furIcons_compressed_data,furIcons_compressed_size,MAX(1,e->getConfInt("iconSize",16)*dpiScale),&fc,fontRangeFurIcon))==NULL) {
|
||||
if ((furIconFont=addFontZlib(furIcons_compressed_data,furIcons_compressed_size,MAX(1,e->getConfInt("iconSize",16)*dpiScale),&fc,fontRangeFurIcon))==NULL) {
|
||||
logE("could not load Furnace icons font!");
|
||||
}
|
||||
|
||||
|
|
@ -5749,7 +5749,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
if ((patFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(settings.patFontPath.c_str(),MAX(1,e->getConfInt("patFontSize",18)*dpiScale),&fontConfP,upTo800))==NULL) {
|
||||
logW("could not load pattern font! reverting to default font");
|
||||
settings.patFont=0;
|
||||
if ((patFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.patFont],builtinFontMLen[settings.patFont],MAX(1,e->getConfInt("patFontSize",18)*dpiScale),&fontConfP,upTo800))==NULL) {
|
||||
if ((patFont=addFontZlib(builtinFontM[settings.patFont],builtinFontMLen[settings.patFont],MAX(1,e->getConfInt("patFontSize",18)*dpiScale),&fontConfP,upTo800))==NULL) {
|
||||
logE("could not load pattern font! falling back to Proggy Clean.");
|
||||
patFont=ImGui::GetIO().Fonts->AddFontDefault();
|
||||
}
|
||||
|
|
@ -5760,7 +5760,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
if ((patFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_PAT_FONT_PATH_3,MAX(1,e->getConfInt("patFontSize",18)*dpiScale),&fontConfP,upTo800))==NULL) {
|
||||
logW("could not load pattern font! reverting to default font");
|
||||
settings.patFont=0;
|
||||
if ((patFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.patFont],builtinFontMLen[settings.patFont],MAX(1,e->getConfInt("patFontSize",18)*dpiScale),&fontConfP,upTo800))==NULL) {
|
||||
if ((patFont=addFontZlib(builtinFontM[settings.patFont],builtinFontMLen[settings.patFont],MAX(1,e->getConfInt("patFontSize",18)*dpiScale),&fontConfP,upTo800))==NULL) {
|
||||
logE("could not load pattern font! falling back to Proggy Clean.");
|
||||
patFont=ImGui::GetIO().Fonts->AddFontDefault();
|
||||
}
|
||||
|
|
@ -5768,7 +5768,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if ((patFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFontM[settings.patFont],builtinFontMLen[settings.patFont],MAX(1,e->getConfInt("patFontSize",18)*dpiScale),&fontConfP,upTo800))==NULL) {
|
||||
if ((patFont=addFontZlib(builtinFontM[settings.patFont],builtinFontMLen[settings.patFont],MAX(1,e->getConfInt("patFontSize",18)*dpiScale),&fontConfP,upTo800))==NULL) {
|
||||
logE("could not load pattern font!");
|
||||
patFont=ImGui::GetIO().Fonts->AddFontDefault();
|
||||
}
|
||||
|
|
@ -5778,7 +5778,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
// 0x39B = Λ
|
||||
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),&fontConfB,bigFontRange))==NULL) {
|
||||
if ((bigFont=addFontZlib(font_plexSans_compressed_data,font_plexSans_compressed_size,MAX(1,40*dpiScale),&fontConfB,bigFontRange))==NULL) {
|
||||
logE("could not load big UI font!");
|
||||
}
|
||||
|
||||
|
|
@ -5790,7 +5790,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
if ((headFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(settings.headFontPath.c_str(),MAX(1,e->getConfInt("headFontSize",27)*dpiScale),&fontConfH,upTo800))==NULL) {
|
||||
logW("could not load header font! reverting to default font");
|
||||
settings.headFont=0;
|
||||
if ((headFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFont[settings.headFont],builtinFontLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",27)*dpiScale),&fontConfH,upTo800))==NULL) {
|
||||
if ((headFont=addFontZlib(builtinFont[settings.headFont],builtinFontLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",27)*dpiScale),&fontConfH,upTo800))==NULL) {
|
||||
logE("could not load header font! falling back to IBM Plex Sans.");
|
||||
headFont=ImGui::GetIO().Fonts->AddFontDefault();
|
||||
}
|
||||
|
|
@ -5801,7 +5801,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
if ((headFont=ImGui::GetIO().Fonts->AddFontFromFileTTF(SYSTEM_HEAD_FONT_PATH_3,MAX(1,e->getConfInt("headFontSize",27)*dpiScale),&fontConfH,upTo800))==NULL) {
|
||||
logW("could not load header font! reverting to default font");
|
||||
settings.headFont=0;
|
||||
if ((headFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFont[settings.headFont],builtinFontLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",27)*dpiScale),&fontConfH,upTo800))==NULL) {
|
||||
if ((headFont=addFontZlib(builtinFont[settings.headFont],builtinFontLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",27)*dpiScale),&fontConfH,upTo800))==NULL) {
|
||||
logE("could not load header font! falling back to IBM Plex Sans.");
|
||||
headFont=ImGui::GetIO().Fonts->AddFontDefault();
|
||||
}
|
||||
|
|
@ -5809,7 +5809,7 @@ void FurnaceGUI::applyUISettings(bool updateFonts) {
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if ((headFont=ImGui::GetIO().Fonts->AddFontFromMemoryCompressedTTF(builtinFont[settings.headFont],builtinFontLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",27)*dpiScale),&fontConfH,upTo800))==NULL) {
|
||||
if ((headFont=addFontZlib(builtinFont[settings.headFont],builtinFontLen[settings.headFont],MAX(1,e->getConfInt("headFontSize",27)*dpiScale),&fontConfH,upTo800))==NULL) {
|
||||
logE("could not load header font!");
|
||||
headFont=ImGui::GetIO().Fonts->AddFontDefault();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue