[Scummvm-git-logs] scummvm master -> e5758226ff619b1bccd954007f8398ebbc843cb2
bluegr
noreply at scummvm.org
Mon Sep 14 08:28:07 UTC 2026
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
48dc73e266 GUI: Enable CJK fonts in RichTextWidget
e5758226ff GUI: Correct Chinese font family mappings
Commit: 48dc73e266236976a8de2cd7f283830e21c48e17
https://github.com/scummvm/scummvm/commit/48dc73e266236976a8de2cd7f283830e21c48e17
Author: Hajin Jang (jb6804 at naver.com)
Date: 2026-09-14T11:28:03+03:00
Commit Message:
GUI: Enable CJK fonts in RichTextWidget
In RichTextWidget, CJK texts were never being rendered in ScummVM help dialog because the CJK fonts were never mapped.
Fix it by providing CJK fonts mapping to the RichTextWidget.
Assisted-by: Codex:gpt-5.6
Changed paths:
gui/widgets/richtext.cpp
diff --git a/gui/widgets/richtext.cpp b/gui/widgets/richtext.cpp
index 7d0effa9395..a76feceadf4 100644
--- a/gui/widgets/richtext.cpp
+++ b/gui/widgets/richtext.cpp
@@ -45,6 +45,46 @@ const Graphics::TTFMap ttfFamily[] = {
{nullptr, 0}
};
+const Graphics::TTFMap ttfFamilyJapanese[] = {
+ {"NotoSansJP-Regular.otf", Graphics::kMacFontRegular},
+ {"NotoSansJP-Bold.otf", Graphics::kMacFontBold},
+ {nullptr, 0}
+};
+
+const Graphics::TTFMap ttfFamilyKorean[] = {
+ {"NotoSansKR-Regular.otf", Graphics::kMacFontRegular},
+ {"NotoSansKR-Bold.otf", Graphics::kMacFontBold},
+ {nullptr, 0}
+};
+
+const Graphics::TTFMap ttfFamilySimplifiedChinese[] = {
+ {"NotoSansSC-Regular.otf", Graphics::kMacFontRegular},
+ {"NotoSansSC-Bold.otf", Graphics::kMacFontBold},
+ {nullptr, 0}
+};
+
+const Graphics::TTFMap ttfFamilyTraditionalChinese[] = {
+ {"NotoSansTC-Regular.otf", Graphics::kMacFontRegular},
+ {"NotoSansTC-Bold.otf", Graphics::kMacFontBold},
+ {nullptr, 0}
+};
+
+static const Graphics::TTFMap *getTTFFamily() {
+#ifdef USE_TRANSLATION
+ const Common::String language = TransMan.getCurrentLanguage();
+ if (language == "ja")
+ return ttfFamilyJapanese;
+ if (language == "ko")
+ return ttfFamilyKorean;
+ if (language == "zh_Hans" || language == "zh")
+ return ttfFamilySimplifiedChinese;
+ if (language == "zh_Hant")
+ return ttfFamilyTraditionalChinese;
+#endif
+
+ return ttfFamily;
+}
+
RichTextWidget::RichTextWidget(GuiObject *boss, int x, int y, int w, int h, bool scale, const Common::U32String &text, const Common::U32String &tooltip)
: Widget(boss, x, y, w, h, scale, tooltip), CommandSender(nullptr) {
@@ -289,7 +329,7 @@ void RichTextWidget::createWidget() {
#endif
if (useTTF)
- newId = wm->_fontMan->registerTTFFont(ttfFamily);
+ newId = wm->_fontMan->registerTTFFont(getTTFFamily());
else
newId = Graphics::kMacFontNewYork;
Commit: e5758226ff619b1bccd954007f8398ebbc843cb2
https://github.com/scummvm/scummvm/commit/e5758226ff619b1bccd954007f8398ebbc843cb2
Author: Hajin Jang (jb6804 at naver.com)
Date: 2026-09-14T11:28:03+03:00
Commit Message:
GUI: Correct Chinese font family mappings
Map the legacy zh locale to Traditional Chinese and fix the swapped Simplified and Traditional Chinese regular fonts in the ScummModern theme.
Assisted-by: Codex:gpt-5
Changed paths:
gui/themes/scummmodern/scummmodern_gfx.stx
gui/widgets/richtext.cpp
diff --git a/gui/themes/scummmodern/scummmodern_gfx.stx b/gui/themes/scummmodern/scummmodern_gfx.stx
index 990fbceb6e1..85e7798ebfd 100644
--- a/gui/themes/scummmodern/scummmodern_gfx.stx
+++ b/gui/themes/scummmodern/scummmodern_gfx.stx
@@ -157,8 +157,8 @@
point_size = '11'>
<language id = 'ja' scalable_file = 'NotoSansJP-Regular.otf'/>
<language id = 'ko' scalable_file = 'NotoSansKR-Regular.otf'/>
- <language id = 'zh_Hans' scalable_file = 'NotoSansTC-Regular.otf'/>
- <language id = 'zh_Hant' scalable_file = 'NotoSansSC-Regular.otf'/>
+ <language id = 'zh_Hans' scalable_file = 'NotoSansSC-Regular.otf'/>
+ <language id = 'zh_Hant' scalable_file = 'NotoSansTC-Regular.otf'/>
<language id = 'hi' scalable_file = 'NotoSans-Regular.ttf'/>
<language id = 'ar' scalable_file = 'NotoNaskhArabic-Regular.ttf'/>
<language id = 'he' scalable_file = 'NotoSansHebrew-Regular.ttf'/>
diff --git a/gui/widgets/richtext.cpp b/gui/widgets/richtext.cpp
index a76feceadf4..2dbff820511 100644
--- a/gui/widgets/richtext.cpp
+++ b/gui/widgets/richtext.cpp
@@ -76,9 +76,9 @@ static const Graphics::TTFMap *getTTFFamily() {
return ttfFamilyJapanese;
if (language == "ko")
return ttfFamilyKorean;
- if (language == "zh_Hans" || language == "zh")
+ if (language == "zh_Hans")
return ttfFamilySimplifiedChinese;
- if (language == "zh_Hant")
+ if (language == "zh_Hant" || language == "zh")
return ttfFamilyTraditionalChinese;
#endif
More information about the Scummvm-git-logs
mailing list