Change NotoSansKR to NanumGothic for Korean font (#1957)

* Update Korean translation

* 1. Fix blank button text after translation
2. Fix some mistranslated korean

* -fix bottom surface in gcode viewer
-update korean translation

* - Fixed UI being broken 'cause "display" text size could not be calculated when cjk language is use

* Change NotoSansKR to NanumGothic, which has a height similar to the main font.
This commit is contained in:
Hotsolidinfill 2023-09-02 11:59:31 +09:00 committed by GitHub
parent 9bf8cbc7de
commit b50dfb69a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 15 additions and 11 deletions

View file

@ -2095,8 +2095,8 @@ void ImGuiWrapper::init_font(bool compress)
auto font_name_regular = "HarmonyOS_Sans_SC_Regular.ttf";
auto font_name_bold = "HarmonyOS_Sans_SC_Bold.ttf";
if(m_glyph_ranges == ImGui::GetIO().Fonts->GetGlyphRangesKorean()) {
font_name_regular = "NotoSansKR-Regular.otf";
font_name_bold = "NotoSansKR-Bold.otf";
font_name_regular = "NanumGothic-Regular.ttf";
font_name_bold = "NanumGothic-Bold.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) {

View file

@ -16,7 +16,7 @@ wxFont Label::sysFont(int size, bool bold)
// Check if the current locale is Korean
if (wxLocale::GetSystemLanguage() == wxLANGUAGE_KOREAN) {
face = "Noto Sans KR";
face = "NanumGothic";
}
wxFont font{size, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, bold ? wxFONTWEIGHT_BOLD : wxFONTWEIGHT_NORMAL, false, face};
@ -65,15 +65,15 @@ void Label::initSysFont()
result = wxFont::AddPrivateFont(font_path);
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of HarmonyOS_Sans_SC_Regular returns %1%")%result;
printf("add font of HarmonyOS_Sans_SC_Regular returns %d\n", result);
// Adding Noto Sans KR Regular and Bold
font_path = wxString::FromUTF8(resource_path + "/fonts/NotoSansKR-Regular.otf");
// Adding NanumGothic Regular and Bold
font_path = wxString::FromUTF8(resource_path + "/fonts/NanumGothic-Regular.ttf");
result = wxFont::AddPrivateFont(font_path);
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of NotoSansKR-Regular returns %1%")%result;
printf("add font of NotoSansKR-Regular returns %d\n", result);
font_path = wxString::FromUTF8(resource_path + "/fonts/NotoSansKR-Bold.otf");
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of NanumGothic-Regular returns %1%")%result;
printf("add font of NanumGothic-Regular returns %d\n", result);
font_path = wxString::FromUTF8(resource_path + "/fonts/NanumGothic-Bold.ttf");
result = wxFont::AddPrivateFont(font_path);
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of NotoSansKR-Bold returns %1%")%result;
printf("add font of NotoSansKR-Bold returns %d\n", result);
// BOOST_LOG_TRIVIAL(info) << boost::format("add font of NanumGothic-Bold returns %1%")%result;
printf("add font of NanumGothic-Bold returns %d\n", result);
#endif
Head_48 = Label::sysFont(48, true);
Head_32 = Label::sysFont(32, true);