Skip to content

feat(libSceFreeType): reverse and translate guest outlines - #9075

Merged
3 commits merged into
boykopovar:mainfrom
santhoshkumar-dev:codex/freetype-outline-mutations
Oct 23, 2026
Merged

3 commits merged into
boykopovar:mainfrom
santhoshkumar-dev:codex/freetype-outline-mutations

Conversation

@santhoshkumar-dev

@santhoshkumar-dev santhoshkumar-dev commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Implement FT_Outline_Reverse and FT_Outline_Translate over the existing guest outline arrays. Reversal preserves each contour's first point, reverses the remaining points and corresponding tags, and toggles the reverse-fill flag. Translation uses defined unsigned addition and bit-preserving conversion for the guest's 64-bit coordinates, including wrap at the signed limits.

The exports are present in the PS5 3.20 inventory. Behavior follows bundled FreeType 2.13.3's outline routines and its ADD_LONG definition. Console signatures, unsigned count assumptions and overflow compatibility remain unverified and are recorded in debt.

This is a follow-up to #9069 and its #9064 parent; merge #9069 first. #8247 is merged; the remaining shared CMake edits with #8286 follow that dependency order. Open, closed and merged PR searches found no implementation of these two functions.

Tested

Windows 11 x64, WinLibs MinGW-w64 GCC 15.2.0 r7, Release, BUILD_TESTING=ON, main 3e91c8edf5 plus #9069.

  • All system libraries and five FreeType test targets built. ctest --test-dir build --output-on-failure -R '^guest_freetype(_charmap|_outline|_charmap_info|_outline_mutations)?$': 5 passed (0.05 / 0.06 / 0.06 / 0.06 / 0.06 s).
  • The new test compares reversal against native permutations for every contour partition through eight points, keeps full-width guest coordinate payloads, checks point/tag guards, and verifies that reversing twice restores the outline. Maximum 65,535-point and 65,535-contour cases are covered.
  • Translation compares native results for safe-range inputs and checks positive/negative 64-bit offsets, signed-limit wrap, inverse translations, null/empty outlines and 65,535 points.
  • A generated glyph is reversed and translated through guest calls, then rendered through the existing guest bridge. Bitmap pixels, dimensions, pitch, grayscale/pixel mode and bearings match native FreeType.
  • Compiled mutations that reverse a contour's first point or narrow offsets to signed 32 bits fail the regression. Strict -Wall -Wextra -Werror checks and conventions passed. The packaged PRX contains bH12z-W8uIM and 7HoSJ30RWXk.

Latest main 47fa6eecf8 was checked before publication; its newer changes do not touch FreeType or libc.

Historical build limitation (2026-10-21): the default Windows build on the stated base failed at ImageArrayWindowPastLayerLimit.cpp because static alignment 65536 exceeded MinGW COFF's maximum 8192. Merged #8310 fixes that declaration; this is no longer a current-main blocker. The library/test results above retain their stated PR head and base.

No title, PS5 hardware or Linux runtime was tested.

Rebase audit (2026-10-21): rebased onto main d099bc6cd8, including the now-merged #8247 and #8289. All system libraries built. A temporary combination of the seven remaining FreeType branches passed all nine tests (0.07 / 0.07 / 0.06 / 0.06 / 0.16 / 0.04 / 0.06 / 0.06 / 0.05 s); all seven branches passed conventions. Temporary integration commits were not published.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: feat(libSceFreeType): expose charmap metadata #9069
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Progress report (2f161d4 → a5b7e4d)

📈 System libraries: 42.45% (+0.03%, +7 implemented functions)

✅ 7 implemented
Library Name
libSceFreeType FT_Get_CMap_Format_nid_postfix
libSceFreeType FT_Get_CMap_Language_ID_nid_postfix
libSceFreeType FT_Get_Charmap_Index_nid_postfix
libSceFreeType FT_Outline_Check_nid_postfix
libSceFreeType FT_Outline_Get_CBox_nid_postfix
libSceFreeType FT_Outline_Reverse_nid_postfix
libSceFreeType FT_Outline_Translate_nid_postfix

@santhoshkumar-dev
santhoshkumar-dev marked this pull request as ready for review October 21, 2026 12:03
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 21, 2026
@santhoshkumar-dev
santhoshkumar-dev force-pushed the codex/freetype-outline-mutations branch from 418fbe4 to a5b7e4d Compare October 21, 2026 12:28
@github-actions github-actions Bot added build docs prx and removed needs rebase Conflicts with main, rebase needed labels Oct 21, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 22, 2026
@github-actions

github-actions Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 9453 FT_Get_CMap_Format
FT_Get_CMap_Language_ID
FT_Get_Charmap_Index

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 9848 core/libs/prx/libSceFreeType/CMakeLists.txt
docs/dev/debt/libSceFreeType.md

@oneandonlydean oneandonlydean closed this pull request by merging all changes into boykopovar:main in b3d9852 Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants