mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 11:56:06 +08:00
Dynamic skew not only for linux
This commit is contained in:
parent
310d53c1b9
commit
2c3477d3d7
@ -314,10 +314,9 @@ void GLGizmoEmboss::on_render_input_window(float x, float y, float bottom_limit)
|
|||||||
// ImGuiWindowFlags_NoResize |
|
// ImGuiWindowFlags_NoResize |
|
||||||
ImGuiWindowFlags_NoCollapse;
|
ImGuiWindowFlags_NoCollapse;
|
||||||
m_imgui->begin(on_get_name(), flag);
|
m_imgui->begin(on_get_name(), flag);
|
||||||
|
|
||||||
ImGui::GetWindowSize();
|
|
||||||
draw_window();
|
draw_window();
|
||||||
m_imgui->end();
|
m_imgui->end();
|
||||||
|
|
||||||
ImGui::PopStyleVar(); // WindowMinSize
|
ImGui::PopStyleVar(); // WindowMinSize
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1043,6 +1042,14 @@ bool GLGizmoEmboss::choose_font_by_wxdialog()
|
|||||||
wxFont font = data.GetChosenFont();
|
wxFont font = data.GetChosenFont();
|
||||||
size_t font_index = m_font_list.size();
|
size_t font_index = m_font_list.size();
|
||||||
FontItem font_item = WxFontUtils::get_font_item(font);
|
FontItem font_item = WxFontUtils::get_font_item(font);
|
||||||
|
|
||||||
|
// fix dynamic creation of italic font
|
||||||
|
wxFontStyle wx_style = font.GetStyle();
|
||||||
|
if ((wx_style == wxFONTSTYLE_ITALIC || wx_style == wxFONTSTYLE_SLANT) &&
|
||||||
|
!Emboss::is_italic(*m_font)) {
|
||||||
|
font_item.prop.skew = 0.2;
|
||||||
|
}
|
||||||
|
|
||||||
make_unique_name(font_item.name, m_font_list);
|
make_unique_name(font_item.name, m_font_list);
|
||||||
m_font_list.emplace_back(font_item);
|
m_font_list.emplace_back(font_item);
|
||||||
|
|
||||||
@ -1053,7 +1060,8 @@ bool GLGizmoEmboss::choose_font_by_wxdialog()
|
|||||||
if (!use_deserialized_font) m_font_selected = font_index;
|
if (!use_deserialized_font) m_font_selected = font_index;
|
||||||
// Try load and use new added font
|
// Try load and use new added font
|
||||||
if ((!use_deserialized_font && !load_font(font)) ||
|
if ((!use_deserialized_font && !load_font(font)) ||
|
||||||
(use_deserialized_font && !load_font(font_index)) || !process()) {
|
(use_deserialized_font && !load_font(font_index)) ||
|
||||||
|
!process()) {
|
||||||
// reverse index for font_selected
|
// reverse index for font_selected
|
||||||
std::swap(font_index, m_font_selected); // when not process
|
std::swap(font_index, m_font_selected); // when not process
|
||||||
// remove form font list
|
// remove form font list
|
||||||
|
@ -209,13 +209,4 @@ void WxFontUtils::update_property(FontProp &font_prop, const wxFont &font)
|
|||||||
auto it = from_weight.find(wx_weight);
|
auto it = from_weight.find(wx_weight);
|
||||||
if (it != from_weight.end()) font_prop.weight = it->second;
|
if (it != from_weight.end()) font_prop.weight = it->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __linux__
|
|
||||||
// dynamic creation of italic, on linux is italic made by skew of normal font
|
|
||||||
wxFontStyle style = font.GetStyle();
|
|
||||||
if ((style == wxFONTSTYLE_ITALIC || style == wxFONTSTYLE_SLANT) &&
|
|
||||||
!Emboss::is_italic(*m_font)) {
|
|
||||||
font_prop.skew = 0.2;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user