From 4a406e27d42fb750992323c4b0ef846d2a7a5663 Mon Sep 17 00:00:00 2001 From: Filip Sykala Date: Wed, 13 Oct 2021 12:09:59 +0200 Subject: [PATCH] fix macro --- src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp index d316be15cd..d71ccd7121 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoEmboss.cpp @@ -1085,15 +1085,6 @@ std::optional WxFontUtils::load_font(const wxFont &font) if (!font.IsOk()) return {}; #ifdef _WIN32 return Emboss::load_font(font.GetHFONT()); -#elif FontConfigExist - static FontConfigHelp help; - std::string font_path = help.get_font_path(font); - if (font_path.empty()) return {}; - return Emboss::load_font(font_path.c_str()); - - // HERE is place to add implementation for linux to - // convert from wxFont to filePath(as MacOS) or fontData pointer(as WinOs) - return {}; #elif __APPLE__ // use file path const wxNativeFontInfo *info = font.GetNativeFontInfo(); @@ -1109,6 +1100,16 @@ std::optional WxFontUtils::load_font(const wxFont &font) if (file_path.empty() || file_path.size() <= start) return {}; file_path = file_path.substr(start, file_path.size()-start); return Emboss::load_font(file_path.c_str()); +#elif defined(FontConfigExist) + static FontConfigHelp help; + std::string font_path = help.get_font_path(font); + if (font_path.empty()) return {}; + return Emboss::load_font(font_path.c_str()); +#else + // HERE is place to add implementation for another platform + // to convert wxFont to font data as windows or font file path as linux + // Do not forget to allow macro USE_FONT_DIALOG + return {}; #endif }