mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-06-10 14:02:47 +00:00
l10n: Update Thai translation (th) and fix font issues (#14006)
* i18n: complete Thai (th) localization * feat: fix thi translation * feat: fix Thai language localization file * feat: implement ImGuiWrapper with icon/font support and add Thai localization files * l10n: Update Thai translation and fix font rendering issues --------- Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
committed by
GitHub
parent
9a053f15eb
commit
dfe4b52822
@@ -2789,6 +2789,9 @@ void ImGuiWrapper::init_font(bool compress)
|
||||
if(m_glyph_ranges == ImGui::GetIO().Fonts->GetGlyphRangesKorean()) {
|
||||
font_name_regular = "NanumGothic-Regular.ttf";
|
||||
font_name_bold = "NanumGothic-Bold.ttf";
|
||||
} else if (m_glyph_ranges == ImGui::GetIO().Fonts->GetGlyphRangesThai()) {
|
||||
font_name_regular = "Sarabun-Medium.ttf";
|
||||
font_name_bold = "Sarabun-SemiBold.ttf";
|
||||
}
|
||||
default_font = io.Fonts->AddFontFromFileTTF((Slic3r::resources_dir() + "/fonts/" + font_name_regular).c_str(), m_font_size, &cfg, ranges.Data);
|
||||
if (default_font == nullptr) {
|
||||
@@ -2804,6 +2807,11 @@ void ImGuiWrapper::init_font(bool compress)
|
||||
if (bold_font == nullptr) { throw Slic3r::RuntimeError("ImGui: Could not load deafult font"); }
|
||||
}
|
||||
|
||||
if (m_glyph_ranges == ImGui::GetIO().Fonts->GetGlyphRangesThai()) {
|
||||
default_font->Scale *= 1.25f;
|
||||
bold_font->Scale *= 1.25f;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
// Render the text a bit larger (see GLCanvas3D::_resize() and issue #3401), but only if the scale factor
|
||||
// for the Display is greater than 300%.
|
||||
|
||||
Reference in New Issue
Block a user