From 9b7e6db9063bb0369375dd00f63c373dd73dd632 Mon Sep 17 00:00:00 2001 From: Filip Sykala - NTB T15p Date: Tue, 22 Nov 2022 15:56:17 +0100 Subject: [PATCH] Fix: ../src/slic3r/Utils/WxFontUtils.cpp:100:27: error: 'error' was not declared in this scope; did you mean 'perror'? ../src/slic3r/Utils/WxFontUtils.cpp:100:9: error: 'BOOST_LOG_TRIVIAL' was not declared in this scope ../src/slic3r/Utils/WxFontUtils.cpp:146:5: error: 'wxSystemFont' was not declared in this scope; did you mean 'wxSystem'? ../src/slic3r/Utils/WxFontUtils.cpp:147:32: error: 'wxSystemSettings' has not been declared ../src/slic3r/Utils/WxFontUtils.cpp:147:58: error: 'system_font' was not declared in this scope --- src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp | 6 ------ src/slic3r/Utils/WxFontUtils.cpp | 19 +++++++++++-------- src/slic3r/Utils/WxFontUtils.hpp | 1 - 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp index 62af648b3..a7a40b67b 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp @@ -824,7 +824,6 @@ EmbossStyles GLGizmoEmboss::create_default_styles() WxFontUtils::create_emboss_style(*wxITALIC_FONT, _u8L("ITALIC")), // A font using the wxFONTFAMILY_ROMAN family and wxFONTSTYLE_ITALIC style and of the same size of wxNORMAL_FONT. WxFontUtils::create_emboss_style(*wxSWISS_FONT, _u8L("SWISS")), // A font identic to wxNORMAL_FONT except for the family used which is wxFONTFAMILY_SWISS. WxFontUtils::create_emboss_style(wxFont(10, wxFONTFAMILY_MODERN, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD), _u8L("MODERN")) - //, WxFontUtils::get_os_font() == wxNORMAL_FONT }; } @@ -1098,11 +1097,6 @@ void GLGizmoEmboss::draw_window() #ifdef ALLOW_DEBUG_MODE if (ImGui::Button("re-process")) process(); if (ImGui::Button("add svg")) choose_svg_file(); - if (ImGui::Button("use system font")) { - size_t font_index = m_style_items.size(); - m_style_items.emplace_back(WxFontUtils::get_os_font()); - bool loaded = load_style(font_index); - } #endif // ALLOW_DEBUG_MODE bool is_activ_font = m_style_manager.is_activ_font(); diff --git a/src/slic3r/Utils/WxFontUtils.cpp b/src/slic3r/Utils/WxFontUtils.cpp index 2727c5e25..1c9fa12b0 100644 --- a/src/slic3r/Utils/WxFontUtils.cpp +++ b/src/slic3r/Utils/WxFontUtils.cpp @@ -1,5 +1,6 @@ #include "WxFontUtils.hpp" #include +#include #if defined(__APPLE__) #include @@ -141,14 +142,16 @@ EmbossStyle WxFontUtils::create_emboss_style(const wxFont &font, const std::stri return { name_item, fontDesc, type, font_prop }; } -EmbossStyle WxFontUtils::get_os_font() -{ - wxSystemFont system_font = wxSYS_DEFAULT_GUI_FONT; - wxFont font = wxSystemSettings::GetFont(system_font); - EmbossStyle es = create_emboss_style(font); - es.name += std::string(" (OS default)"); - return es; -} +// NOT working on linux GTK2 +// load font used by Operating system as default GUI +//EmbossStyle WxFontUtils::get_os_font() +//{ +// wxSystemFont system_font = wxSYS_DEFAULT_GUI_FONT; +// wxFont font = wxSystemSettings::GetFont(system_font); +// EmbossStyle es = create_emboss_style(font); +// es.name += std::string(" (OS default)"); +// return es; +//} std::string WxFontUtils::get_human_readable_name(const wxFont &font) { diff --git a/src/slic3r/Utils/WxFontUtils.hpp b/src/slic3r/Utils/WxFontUtils.hpp index ed8fb6158..3115a5bd7 100644 --- a/src/slic3r/Utils/WxFontUtils.hpp +++ b/src/slic3r/Utils/WxFontUtils.hpp @@ -28,7 +28,6 @@ public: static EmbossStyle create_emboss_style(const wxFont &font, const std::string& name = ""); // load font used by Operating system as default GUI - static EmbossStyle get_os_font(); static std::string get_human_readable_name(const wxFont &font); // serialize / deserialize font