mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-16 07:55:53 +08:00
Os specific text descriptor
This commit is contained in:
parent
999aef0440
commit
02f6b1efe9
@ -90,6 +90,7 @@ public:
|
|||||||
/// <param name="file_path">Location of .ttf or .ttc font file</param>
|
/// <param name="file_path">Location of .ttf or .ttc font file</param>
|
||||||
/// <returns>Font object when loaded.</returns>
|
/// <returns>Font object when loaded.</returns>
|
||||||
static std::optional<Font> load_font(const char *file_path);
|
static std::optional<Font> load_font(const char *file_path);
|
||||||
|
// data = raw file data
|
||||||
static std::optional<Font> load_font(std::vector<unsigned char> data);
|
static std::optional<Font> load_font(std::vector<unsigned char> data);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
// fix for unknown pointer HFONT
|
// fix for unknown pointer HFONT
|
||||||
|
@ -107,6 +107,12 @@ void GLGizmoEmboss::on_render_input_window(float x, float y, float bottom_limit)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::string os_font;
|
||||||
|
|
||||||
|
wxSystemSettings ss;
|
||||||
|
wxFont ssFont = ss.GetFont(wxSYS_ANSI_VAR_FONT);
|
||||||
|
ImGui::Text("Desc %s", std::string(ssFont.GetNativeFontInfoDesc().c_str()).c_str());
|
||||||
|
|
||||||
static std::string fontName;
|
static std::string fontName;
|
||||||
if (ImGui::Button(_L("choose font").c_str())) {
|
if (ImGui::Button(_L("choose font").c_str())) {
|
||||||
static wxFontData data; // keep last selected font
|
static wxFontData data; // keep last selected font
|
||||||
@ -114,8 +120,13 @@ void GLGizmoEmboss::on_render_input_window(float x, float y, float bottom_limit)
|
|||||||
font_dialog.SetTitle(_L("Select font FFF"));
|
font_dialog.SetTitle(_L("Select font FFF"));
|
||||||
if (font_dialog.ShowModal() == wxID_OK) {
|
if (font_dialog.ShowModal() == wxID_OK) {
|
||||||
data = font_dialog.GetFontData();
|
data = font_dialog.GetFontData();
|
||||||
wxFont font = data.GetChosenFont();
|
wxFont font2 = data.GetChosenFont();
|
||||||
fontName = boost::nowide::narrow(font.GetFaceName());
|
wxString fontDesc2 = font2.GetNativeFontInfoDesc();
|
||||||
|
fontName = std::string(fontDesc2.c_str());
|
||||||
|
fontName = "Arial 10";
|
||||||
|
wxString fontDesc(fontName);
|
||||||
|
wxFont font(fontDesc);
|
||||||
|
//font.IsOk()
|
||||||
m_font = Emboss::load_font(font.GetHFONT());
|
m_font = Emboss::load_font(font.GetHFONT());
|
||||||
m_font_glyph_cache.clear();
|
m_font_glyph_cache.clear();
|
||||||
process();
|
process();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user