Revert "FIX: korean font display issue"

This reverts commit 9c54bb7897352376b90da1e44d93a665746b8a2d.

Reason for revert: the korean translation is not supported on this branch

Change-Id: I8a35760f623ec8f9b3143675a3b041e7b6b05d40
This commit is contained in:
七喜 2023-09-14 10:06:45 +08:00 committed by Lane.Wei
parent 3cc423c191
commit 3ae2a6f176
4 changed files with 2 additions and 10 deletions

Binary file not shown.

View file

@ -371,7 +371,6 @@ void ImGuiWrapper::set_language(const std::string &language)
} else if (lang == "ko") {
ranges = ImGui::GetIO().Fonts->GetGlyphRangesKorean(); // Default + Korean characters
m_font_cjk = true;
m_is_korean = true;
} else if (lang == "zh") {
ranges = (language == "zh_TW") ?
// Traditional Chinese
@ -2091,10 +2090,7 @@ void ImGuiWrapper::init_font(bool compress)
cfg.OversampleH = cfg.OversampleV = 1;
//FIXME replace with io.Fonts->AddFontFromMemoryTTF(buf_decompressed_data, (int)buf_decompressed_size, m_font_size, nullptr, ranges.Data);
//https://github.com/ocornut/imgui/issues/220
if (m_is_korean)
default_font = io.Fonts->AddFontFromFileTTF((Slic3r::resources_dir() + "/fonts/" + "NotoSansKR-Regular.ttf").c_str(), m_font_size, &cfg, ranges.Data);
else
default_font = io.Fonts->AddFontFromFileTTF((Slic3r::resources_dir() + "/fonts/" + "HarmonyOS_Sans_SC_Regular.ttf").c_str(), m_font_size, &cfg, ranges.Data);
default_font = io.Fonts->AddFontFromFileTTF((Slic3r::resources_dir() + "/fonts/" + "HarmonyOS_Sans_SC_Regular.ttf").c_str(), m_font_size, &cfg, m_font_cjk ? ImGui::GetIO().Fonts->GetGlyphRangesChineseFull() : ranges.Data);
if (default_font == nullptr) {
default_font = io.Fonts->AddFontDefault();
if (default_font == nullptr) {
@ -2102,9 +2098,6 @@ void ImGuiWrapper::init_font(bool compress)
}
}
if (m_is_korean)
bold_font = io.Fonts->AddFontFromFileTTF((Slic3r::resources_dir() + "/fonts/" + "NotoSansKR-Bold.ttf").c_str(), m_font_size, &cfg, ranges.Data);
else
bold_font = io.Fonts->AddFontFromFileTTF((Slic3r::resources_dir() + "/fonts/" + "HarmonyOS_Sans_SC_Bold.ttf").c_str(), m_font_size, &cfg, ranges.Data);
if (bold_font == nullptr) {
bold_font = io.Fonts->AddFontDefault();

View file

@ -48,7 +48,6 @@ class ImGuiWrapper
const ImWchar* m_glyph_basic_ranges { nullptr };
// Chinese, Japanese, Korean
bool m_font_cjk{ false };
bool m_is_korean{ false };
float m_font_size{ 18.0 };
unsigned m_font_texture{ 0 };
unsigned m_font_another_texture{ 0 };