post changes after merging BS1.7.4

Remove tracking etc..
This commit is contained in:
SoftFever 2023-08-26 18:24:13 +08:00
parent e65b11a831
commit 2a478ab4f9
615 changed files with 46215 additions and 54844 deletions

View file

@ -1,6 +1,7 @@
#include "libslic3r/Utils.hpp"
#include "Label.hpp"
#include "StaticBox.hpp"
#include <wx/intl.h> // For wxLocale
wxFont Label::sysFont(int size, bool bold)
{
@ -11,13 +12,22 @@ wxFont Label::sysFont(int size, bool bold)
size = size * 4 / 5;
#endif
auto face = wxString::FromUTF8("HarmonyOS Sans SC");
wxString face = "HarmonyOS Sans SC";
// Check if the current locale is Korean
if (wxLocale::GetSystemLanguage() == wxLANGUAGE_KOREAN) {
face = "Noto Sans KR";
}
wxFont font{size, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, bold ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL, false, face};
font.SetFaceName(face);
if (!font.IsOk()) {
font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
if (bold) font.MakeBold();
font.SetPointSize(size);
BOOST_LOG_TRIVIAL(warning) << boost::format("Can't find %1% font") % face;
font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
BOOST_LOG_TRIVIAL(warning) << boost::format("Use system font instead: %1%") % font.GetFaceName();
if (bold)
font.MakeBold();
font.SetPointSize(size);
}
return font;
}
@ -45,16 +55,25 @@ wxFont Label::Body_9;
void Label::initSysFont()
{
#ifdef __linux__
const std::string& resource_path = Slic3r::resources_dir();
wxString font_path = wxString::FromUTF8(resource_path+"/fonts/HarmonyOS_Sans_SC_Bold.ttf");
#if defined(__linux__) || defined(_WIN32)
const std::string &resource_path = Slic3r::resources_dir();
wxString font_path = wxString::FromUTF8(resource_path + "/fonts/HarmonyOS_Sans_SC_Bold.ttf");
bool result = wxFont::AddPrivateFont(font_path);
//BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Bold returns %1%")%result;
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Bold returns %1%")%result;
printf("add font of HarmonyOS_Sans_SC_Bold returns %d\n", result);
font_path = wxString::FromUTF8(resource_path+"/fonts/HarmonyOS_Sans_SC_Regular.ttf");
font_path = wxString::FromUTF8(resource_path + "/fonts/HarmonyOS_Sans_SC_Regular.ttf");
result = wxFont::AddPrivateFont(font_path);
//BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Regular returns %1%")%result;
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Regular returns %1%")%result;
printf("add font of HarmonyOS_Sans_SC_Regular returns %d\n", result);
// Adding Noto Sans KR Regular and Bold
font_path = wxString::FromUTF8(resource_path + "/fonts/NotoSansKR-Regular.otf");
result = wxFont::AddPrivateFont(font_path);
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of NotoSansKR-Regular returns %1%")%result;
printf("add font of NotoSansKR-Regular returns %d\n", result);
font_path = wxString::FromUTF8(resource_path + "/fonts/NotoSansKR-Bold.otf");
result = wxFont::AddPrivateFont(font_path);
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of NotoSansKR-Bold returns %1%")%result;
printf("add font of NotoSansKR-Bold returns %d\n", result);
#endif
Head_48 = Label::sysFont(48, true);
Head_32 = Label::sysFont(32, true);
@ -283,7 +302,7 @@ void Label::SetWindowStyleFlag(long style)
wxStaticText::SetWindowStyleFlag(style);
if (style & LB_HYPERLINK) {
this->m_color = GetForegroundColour();
static wxColor clr_url("#00AE42");
static wxColor clr_url("#009688");
SetFont(this->m_font.Underlined());
SetForegroundColour(clr_url);
SetCursor(wxCURSOR_HAND);