libFont: ship Noto Sans as the fallback font #1917
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1917
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1917/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@MrBigBritches on GitHub · 2026-10-26 18:23 UTC · original
MrBigBritches:font-buildstep→main· +56 −46 · 4 files · 4 commits · merged 2026-10-27 06:51 UTCInstalled builds drew every character of a PS5 system font as
?. Fonts that stb_truetype can't read, including every font set opened withsceFontOpenFontSet, fell back to Roboto from Tracy's source folder. That folder was found relative to the source tree or the working directory, and installed builds have neither.This PR downloads Noto Sans at configure time, ships it beside the emulator, and loads it from there.
cmake: download Noto Sans at configure time: fetches the hinted Regular, Bold, Italic and Bold Italic styles of Noto Sans v2.015, plus the licence, from notofonts.github.io with FetchContent. The source commit and each file's SHA-256 are pinned, and TLS verification is on. The four files are fetched individually instead of the 117 MB release archive.cmake: ship Noto Sans beside the emulator: copies the fonts toassets/fontsnext tokyty_emulatoron every build, the same way as the touch cursors and trophy sound. They're installed toassets/fontsand, on macOS, intoKytyPS5.app/Contents/Resources/assets/fonts. The SIL Open Font License goes underlicenses/noto-sans.libFont: fall back to the shipped Noto Sans instead of Tracy's Roboto: loads the matching style fromassets/fontsunderSDL_GetBasePath(). It logs when a font file is missing or the base path can't be found.Testing
launcherbuild succeed. The fonts land in_Build/windows/assets/fontsand inassets/fontsin the install folder.ctest: 63 of 65 tests pass. Neither failure involves fonts:vdecswdoesn't build on MSVC's C runtime:tests/VdecswTests.cppusesstd::aligned_alloc, which it doesn't provide. This was already onmain, froma7a734b5.kernel_file_systemcrashes with0xc0000028every time. No test uses fonts, but this hasn't been confirmed againstmain.@coderabbitai[bot] on GitHub · 2026-10-26 18:29 UTC · original · edited 2026-10-27 06:09 UTC
Walkthrough
The build downloads four Noto Sans font styles and their license with SHA-256 verification. It copies the fonts into the emulator’s assets directory and adds font and license installation rules, including for the macOS bundle. Fallback font loading uses Noto Sans filenames and reads from the SDL-reported executable base path.
Suggested reviewers:
nmzikPriority:
Normal
Change: Feature
Merge Risk:
Low · up to
dceddThe remaining issues are bounded: font downloads lack the intended TLS verification, and a missing style file can make fallback glyphs unavailable for that style. Address both before merging if practical.
Pre-merge checks:
4 ·
1
Full details: Docstring Coverage
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 1 files. (2 skipped: 2 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@coderabbitai[bot] on GitHub · 2026-10-26 18:29 UTC · original
On
src/libs/libFont.cppline 722 (outdated):Convert the SDL base path from UTF-8 explicitly.
If the Windows installation path contains non-ASCII characters,
std::filesystem::path(base_path)can interpret SDL’s UTF-8 bytes using a different code page. The font read then uses the wrong path or fails, so the shipped fallback font remains unavailable. Use a UTF-8-aware conversion, such asCommon::PathFromUtf8(base_path), before appendingassets/fonts. (wiki.libsdl.org)@coderabbitai[bot] on GitHub · 2026-10-26 18:29 UTC · original · reviewed
Actionable comments posted: 1
c0d393ca-f6fa-4b3f-b7b0-52f7d95c61a6Reviewing files that changed from the base of the PR and between
f90a8b1589and 53b10d213e2d5508aa0741c1e701a7d6a975aa2e.3rdparty/CMakeLists.txtCMakeLists.txtsrc/launcher/CMakeLists.txtsrc/libs/libFont.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
@ -45,0 +50,4 @@function(kyty_fetch_noto_sans path sha256)get_filename_component(name "${path}" NAME)file(DOWNLOAD "${KYTY_NOTO_SANS_BASE_URL}/${path}" "${KYTY_NOTO_SANS_DIR}/${name}"EXPECTED_HASH SHA256=${sha256})@coderabbitai[bot] on GitHub · 2026-10-27 06:08 UTC · original
Enable TLS certificate verification for font downloads.
On supported CMake 3.19,
file(DOWNLOAD)does not verify HTTPS certificates by default. AddTLS_VERIFY ONso the download meets the stated TLS requirement. The pinned SHA-256 hashes still protect file contents, but they do not enable certificate verification. (cmake.org)Proposed change
Committable suggestion
@ -747,2 +720,3 @@static const auto bold_italic = load_fallback_font_data("NotoSans-BoldItalic.ttf");if (bold && italic && !bold_italic.empty()) {if (bold && italic) {@coderabbitai[bot] on GitHub · 2026-10-27 06:08 UTC · original
Use the regular font when a styled file is unavailable.
If one styled file is missing but
NotoSans-Regular.ttfis present, these branches return empty data.init_font_facethen uses the bitmap fallback, so unsupported characters render as?for that style. Return the selected style only when its data is nonempty; otherwise returnregular. (raw.githubusercontent.com)Also applies to: 725-725, 728-728
@coderabbitai[bot] on GitHub · 2026-10-27 06:08 UTC · original · reviewed
Actionable comments posted: 2
236b3f6f-b92b-4589-8f5f-55e7e3294313Reviewing files that changed from the base of the PR and between
9f03886cc4anddceddb3db6.3rdparty/CMakeLists.txtCMakeLists.txtsrc/libs/libFont.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.