Repository navigation
feat(font): open system font sets from a font directory - #461
Merged
oneandonlydean merged 1 commit intoOct 5, 2026
Merged
Conversation
9 tasks done
9 tasks done
9 tasks done
9 tasks done
sceFontOpenFontSet failed for every set type, so PPSA21564 drew no text in system fonts (the title screen copyright line, credits, button guides). It now loads the set's primary font file from ANYPS5_SYSTEM_FONTS, or anyps5-fonts beside the executable: console files under their own names first, then openly licensed substitutes (Noto Sans, Noto Sans Mono, Noto Sans Thai, Noto Sans CJK). The PS5-only JG2 set types are accepted. System font handles use the system font context. Their faces are loaded by FreeType in host memory: about 1 MiB per CJK face does not fit the font memory the title sizes for the console's fonts, and sceFontCreateRenderer then failed with ALLOCATION_FAILED. Handles of the same font file share one copy of its bytes.
oneandonlydean
force-pushed
the
feat/font-system-font-sets
branch
from
October 5, 2026 21:29
a13642d to
9d4e6d2
Compare
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.
What
sceFontOpenFontSetfails for every set type, so titles draw no text in the system fonts. In PPSA21564 that is the copyright line on the title screen, the credits and the button guides.It now loads the set's primary font file from a font directory and opens it like a font file the title passes in:
ANYPS5_SYSTEM_FONTSif set (it must be a directory, otherwise the open throws), elseanyps5-fonts/beside the generated executable.SST-Roman.otf,SST-Bold.otf,SSTJpPro-Regular.otf,DFHEI5-SONY.ttf, ...), then an openly licensed substitute when that file is absent: Noto Sans for Latin and Vietnamese (NotoSans-{Light,Regular,Medium,Bold}.ttfand their italics), Noto Sans Mono for the typewriter sets, Noto Sans Thai for Thai, and Noto Sans CJK (NotoSansCJK-{Light,Regular,Medium,Bold}.ttc; the JP face for Japanese, SC for Chinese GB).SCE_FONT_ERROR_FONT_OPEN_FAILED, as now, and the title shows no text in that font.0x1A......) are accepted; their console file names are unknown, so they use the SSTJpPro files.No font files are added to the repository; the user provides them. The file list is in
docs/user/USAGE.md(Runtime layout, System fonts), and the gaps are inTechnicalDebt.md: only the set's primary file is opened, so characters the console takes from the set's other files are reported as unsupported glyphs, and a substitute's metrics differ from the console's.System font handles use the system font context. Their faces are loaded by FreeType in host memory: about 1 MiB per CJK face does not fit the font memory a title sizes for the console's fonts, and
sceFontCreateRendererthen failed withALLOCATION_FAILED. Handles of the same font file share one copy of its bytes.Why Noto
The Noto set is under the SIL Open Font License and covers every script the system sets need (Latin, Vietnamese, Thai, Japanese, Chinese) in the four weights they use. It is not the system font, so widths, line height and wrapping differ from the console, as the technical debt entry says. I also tried Source Sans 3, which is close for Latin text but has no Thai or CJK.
Title screen of PPSA21564, left: PS5 (phone photo), middle: Source Sans 3, right: Noto Sans. The copyright line along the bottom is the system font text:
Tested
BUILD_TESTING=ONandctestpass (318/318), rebased onmain2707b3a.guest_system_fonttest (core/libs/tests/GuestSystemFont.cpp, generated TrueType fonts in a temporary font directory): an empty directory givesFONT_OPEN_FAILEDand an unknown set typeNO_SUPPORT_FONTSET; a missingANYPS5_SYSTEM_FONTSdirectory throws; the console file is preferred, and once it is removed the substitute opens while an open handle keeps its face; each set type picks its family and weight (light, italic, Thai, Vietnamese, JG2 Japanese from the CJK file); a set with no file fails to open; glyph metrics and the horizontal layout come from the loaded face; font instances and memory fonts keep working; everything allocated is freed. Againstmain's library it fails (the missing directory does not throw, and no set opens).Unimplemented.cpp.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)