feat(libSceFreeType): implement the six FreeType functions OpenOrbis samples use #6376
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6376"
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?
Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-15T13:34:15Z.
What
PS4 homebrew built with the OpenOrbis toolchain draws text through the PS4
libSceFreeType. The OpenOrbis font, keyboard, threading, system and SDL2 samples import six of its functions and stop at start-up without them:FAIL: unresolved ELF import GNsiLzm4SH8(FT_Init_FreeType),j-uMQE+unFY(FT_New_Face),lJxMIwj81SQ(FT_Set_Pixel_Sizes),obnSzeb-KXk(FT_Get_Char_Index),M156RuYoUbU(FT_Load_Glyph) andTCRmigbq7lc(FT_Render_Glyph).This adds
libSceFreeTypewith those six functions on top of the bundled FreeType 2.13.3.FT_LongandFT_Posare 64 bits. On Windows they are 32 bits, so the guest gets copies of the face, size, charmap and glyph slot in the LP64 layout, refreshed after each call that changes them. The offsets are checked withstatic_assertand match what the font sample reads:face->glyphat 0x98,slot->advanceat 0x80,slot->bitmapat 0x98,slot->bitmap_leftat 0xc0. Outline points are copied as 64-bit coordinates, and edits the guest makes to them are written back beforeFT_Render_Glyph.FT_New_Faceresolves the guest path, as libSceFont does, and opens the file from memory.--exclude-libs, as libSceSsl does). Another FreeType function a title imports still fails at start-up instead of resolving to a host function with the Windows calling convention.The limits, such as private fields that are null, faces that are never freed and macOS exports, are in the new
docs/dev/debt/libSceFreeType.md. Part of the PS4 homebrew work tracked in #3093.Tested
Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, full build with
BUILD_TESTING=ON, onmain9811e9d4b:guest_freetypetest writes a one-glyph TrueType font toapp0/and opens it through the guest path/app0/font.ttf. It loads the same bytes with the host FreeType and compares every mirrored field of the face, size, charmap and slot, before and after rendering: metrics, bitmap bytes, outline points, tags and contours. It also checks:aface;0x180000000opening face 0 and0x80000001failing as index 1;FT_Get_Char_Index(face, 0x100000041)returning the glyph ofA;libSceFreeType.prxexports the six NIDs and none of FreeType's own functions.main92cdc7b62with #5990 to #5994, #5138 and a local change that answers the LinuxTIOCGWINSZ(0x5413) withENOTTY, as #5569 does:prx_thread_local_destructorsandagc_driver_store_over_untrackedfail the same way onmain92cdc7b62without these changes;agc_driver_preparation_scope_settleandguest_raise_exceptionpass when run alone.tools/check_conventions.py --base origin/mainpasses.Not tested on Linux or macOS.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T13:35:05Z.
Progress report (
0e4ea13→38fd195)📈 System libraries: 88.71% (+0.01%, +6 implemented functions)
✅ 6 implemented
FT_Get_Char_Index_nid_postfixFT_Init_FreeType_nid_postfixFT_Load_Glyph_nid_postfixFT_New_Face_nid_postfixFT_Render_Glyph_nid_postfixFT_Set_Pixel_Sizes_nid_postfixImported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-15T20:04:17Z.
Review: COMMENTED
Linux run (Ubuntu 26.04, Intel i7-8700, GCC 15.2, full build, non-GPU tests), head
38fd195e9merged ontomain44df21632.guest_freetypepasses (no early exit; the wholemainruns, exit 0).Non-GPU suite (
ctest -E "^agc"): same result asmain; onlyfile_writer_binaryandfile_writer_textfail, and they fail onmaintoo on this machine (Ubuntu 26.04 coreutils).Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by Get-fix on 2026-10-15T23:26:35Z.
Thanks for the Linux run and the NID patching check, @jotitadev.
AI-assisted: yes (Claude Code).
🤖 Generated with Claude Code