Repository navigation
Conversation
With the console language set to Chinese, some text showed up as "??".
This is not an encoding bug: the emulator's font code draws '?' on
purpose for any character it cannot find.
Root cause:
- The game opens the PS5 system font sets (SC/TC/JP/KR) through
FontOpenFontSet. Those fonts don't exist on the host, so libFont fell
back to Roboto (3rdparty/tracy), which only has Latin glyphs.
- stb_supported_codepoint() replaced every code point missing from the
font with '?', and the bitmap fallback (normalize_bitmap_font_code)
did the same for every code point above 255.
- The font format check only accepted .ttf/.otf, so TrueType
collections (.ttc), which most Windows CJK fonts are (e.g. msyh.ttc),
were rejected.
- The system overlay (trophy toasts, IME, system dialogs) used ImGui's
default ASCII-only font, so Chinese trophy names also became '?'.
Changes:
- Add Common::FindCjkFontFiles() (src/common/systemFonts.{h,cpp}). It
tries KYTY_CJK_FONT first, then the usual system CJK fonts on Windows
(msyh, Deng, simhei, simsun, ...), macOS (PingFang, Hiragino, STHeiti)
and Linux (Noto Sans CJK, WenQuanYi, Droid Sans Fallback).
- libFont: accept .ttc files and load face 0 through
stbtt_GetFontOffsetForIndex().
- libFont: add resolve_stb_glyph(), which picks the font per character:
the font's own face first, then the host CJK fallback, and '?' only if
neither has the glyph. Glyph metrics and bitmaps now use the face that
was actually picked.
- libFont: log which CJK fallback font is used, or warn when none is
found.
- systemOverlay: merge the host CJK font into ImGui's default font. The
Vulkan backend has a dynamic atlas, so no glyph ranges are needed.
Not verified: this was not built or tested in game.
Known limitation: fill_writing_step() and fill_writing_metrics() still
use a fixed 8px advance per character, so games that use the
FontWriting* layout API may lay out CJK text with wrong spacing.
Jetsku
pushed a commit
that referenced
this pull request
Oct 20, 2026
With the console language set to Chinese, some text showed up as "??".
This is not an encoding bug: the emulator's font code draws '?' on
purpose for any character it cannot find.
Root cause:
- The game opens the PS5 system font sets (SC/TC/JP/KR) through
FontOpenFontSet. Those fonts don't exist on the host, so libFont fell
back to Roboto (3rdparty/tracy), which only has Latin glyphs.
- stb_supported_codepoint() replaced every code point missing from the
font with '?', and the bitmap fallback (normalize_bitmap_font_code)
did the same for every code point above 255.
- The font format check only accepted .ttf/.otf, so TrueType
collections (.ttc), which most Windows CJK fonts are (e.g. msyh.ttc),
were rejected.
- The system overlay (trophy toasts, IME, system dialogs) used ImGui's
default ASCII-only font, so Chinese trophy names also became '?'.
Changes:
- Add Common::FindCjkFontFiles() (src/common/systemFonts.{h,cpp}). It
tries KYTY_CJK_FONT first, then the usual system CJK fonts on Windows
(msyh, Deng, simhei, simsun, ...), macOS (PingFang, Hiragino, STHeiti)
and Linux (Noto Sans CJK, WenQuanYi, Droid Sans Fallback).
- libFont: accept .ttc files and load face 0 through
stbtt_GetFontOffsetForIndex().
- libFont: add resolve_stb_glyph(), which picks the font per character:
the font's own face first, then the host CJK fallback, and '?' only if
neither has the glyph. Glyph metrics and bitmaps now use the face that
was actually picked.
- libFont: log which CJK fallback font is used, or warn when none is
found.
Not verified: this was not built or tested in game.
Known limitation: fill_writing_step() and fill_writing_metrics() still
use a fixed 8px advance per character, so games that use the
FontWriting* layout API may lay out CJK text with wrong spacing.
Ported from Jetsku/KytyPS5 PR #45 without its systemOverlay hunk: the
overlay already merges locale-aware system fonts (AddSystemFontFallbacks).
Owner
|
Has been merged and added to a release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With the console language set to Chinese, some text showed up as "??". This is not an encoding bug: the emulator's font code draws '?' on purpose for any character it cannot find.
Root cause:
Changes:
Not verified: this was not built or tested in game.
Known limitation: fill_writing_step() and fill_writing_metrics() still use a fixed 8px advance per character, so games that use the FontWriting* layout API may lay out CJK text with wrong spacing.