mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Fixed default font for legends in respect to the OS
This commit is contained in:
parent
046466164f
commit
127a78d953
2 changed files with 15 additions and 8 deletions
|
@ -794,10 +794,15 @@ bool GLCanvas3D::WarningTexture::_generate(const std::string& msg_utf8, const GL
|
||||||
wxString msg = GUI::from_u8(msg_utf8);
|
wxString msg = GUI::from_u8(msg_utf8);
|
||||||
|
|
||||||
wxMemoryDC memDC;
|
wxMemoryDC memDC;
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
// set scaled application normal font as default font
|
||||||
|
wxFont font = wxGetApp().normal_font();
|
||||||
|
#else
|
||||||
// select default font
|
// select default font
|
||||||
const float scale = canvas.get_canvas_size().get_scale_factor();
|
const float scale = canvas.get_canvas_size().get_scale_factor();
|
||||||
// wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).Scale(scale);
|
wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).Scale(scale);
|
||||||
wxFont font = wxGetApp().normal_font();//! #ys_FIXME_experiment
|
#endif
|
||||||
|
|
||||||
font.MakeLarger();
|
font.MakeLarger();
|
||||||
font.MakeBold();
|
font.MakeBold();
|
||||||
|
@ -899,7 +904,7 @@ void GLCanvas3D::WarningTexture::render(const GLCanvas3D& canvas) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLCanvas3D::WarningTexture::rescale(const GLCanvas3D& canvas)
|
void GLCanvas3D::WarningTexture::msw_rescale(const GLCanvas3D& canvas)
|
||||||
{
|
{
|
||||||
if (m_msg_text.empty())
|
if (m_msg_text.empty())
|
||||||
return;
|
return;
|
||||||
|
@ -976,14 +981,16 @@ bool GLCanvas3D::LegendTexture::generate(const GCodePreviewData& preview_data, c
|
||||||
const int scaled_square_contour = Px_Square_Contour * scale;
|
const int scaled_square_contour = Px_Square_Contour * scale;
|
||||||
const int scaled_border = Px_Border * scale;
|
const int scaled_border = Px_Border * scale;
|
||||||
|
|
||||||
// select default font
|
|
||||||
// wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).Scale(scale_gl);
|
|
||||||
wxFont font = wxGetApp().normal_font();//! #ys_FIXME_experiment
|
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
|
// set scaled application normal font as default font
|
||||||
|
wxFont font = wxGetApp().normal_font();
|
||||||
|
|
||||||
// Disabling ClearType works, but the font returned is very different (much thicker) from the default.
|
// Disabling ClearType works, but the font returned is very different (much thicker) from the default.
|
||||||
// msw_disable_cleartype(font);
|
// msw_disable_cleartype(font);
|
||||||
bool cleartype = is_font_cleartype(font);
|
bool cleartype = is_font_cleartype(font);
|
||||||
#else
|
#else
|
||||||
|
// select default font
|
||||||
|
wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).Scale(scale_gl);
|
||||||
bool cleartype = false;
|
bool cleartype = false;
|
||||||
#endif /* __WXMSW__ */
|
#endif /* __WXMSW__ */
|
||||||
|
|
||||||
|
@ -3190,7 +3197,7 @@ double GLCanvas3D::get_size_proportional_to_max_bed_size(double factor) const
|
||||||
|
|
||||||
void GLCanvas3D::msw_rescale()
|
void GLCanvas3D::msw_rescale()
|
||||||
{
|
{
|
||||||
m_warning_texture.rescale(*this);
|
m_warning_texture.msw_rescale(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GLCanvas3D::_is_shown_on_screen() const
|
bool GLCanvas3D::_is_shown_on_screen() const
|
||||||
|
|
|
@ -354,7 +354,7 @@ private:
|
||||||
void render(const GLCanvas3D& canvas) const;
|
void render(const GLCanvas3D& canvas) const;
|
||||||
|
|
||||||
// function used to get an information for rescaling of the warning
|
// function used to get an information for rescaling of the warning
|
||||||
void rescale(const GLCanvas3D& canvas);
|
void msw_rescale(const GLCanvas3D& canvas);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const unsigned char Background_Color[3];
|
static const unsigned char Background_Color[3];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue