Repository navigation
fix(libSceFont): resolve a default string direction at creation - #10021
oneandonlydean merged 1 commit into
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
The new focused assertions and title trace are useful, but I can’t approve this head yet. The required conventions check fails on the existing head commit 39bb288c8 (wip-writingform): it is not a Conventional Commit subject. Please amend/squash it to a permitted subject and keep the successful convention check visible.
One behavior question: this maps every default 0x10 string to LTR 0x12, including text whose first strong character is RTL. The PR notes this limitation and says the native default result is unmeasured. Is there measured or API-contract evidence that sceFontStringGetWritingForm should always return LTR for a default-form source? If this is an evidence-based compatibility fix, documenting that basis would make the choice auditable; if the firmware resolves direction from text, this mapping could report the wrong direction for RTL strings.
|
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.
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.
|
39bb288 to
b38774d
Compare
|
Thanks for the review. Commit subject: my fault. I amended the commit in the wrong checkout, so the subject fix never reached the branch. The head is now Evidence for always returning LTR: there is none beyond what the PR states. Nothing is measured on a console, and I have no API contract for
If the firmware resolves the direction from the text, |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed head b38774ddf0306610ec8b228449442094cae4fa6b. The getter now maps only the stored default horizontal form (0x10) to 0x12; invalid handles still return 0, and explicit 0x11/0x12 values remain unchanged. This is consistent with the existing writing-line validation, which rejects 0x10 and accepts 0x11/0x12, and with the reported Tekken call sequence. The regression test checks the default and both explicit forms and restores the source's default before the existing checks. I found no defect in the scoped change.
The author reports a Windows 11 GCC build and passing guest_font and guest_font_writing_line tests, along with a title reproduction that gets past the prior error; text rendering remains unverified, and the native default getter result is explicitly unmeasured. Locally, git diff --check upstream/main...upstream/pr-10021-current and python3 tools/check_conventions.py --base upstream/main --head upstream/pr-10021-current passed. Hosted eligibility, conventions, labels, and report passed; product and auxiliary build jobs were skipped by workflow policy. I could not run the guest font binaries in this Linux environment.
|
Evidence from running the title with this change: with this PR and #9992 applied on top of That run only covers left-to-right text: the title passes the default string form (0x10) to AI-assisted: yes. Written with AI assistance and reviewed by me. |
|
@klosixgaming-arch the focused tests pass, but they assert the chosen LTR default without establishing the native rule. Can you provide a console result or an API contract for default-form strings with LTR and RTL text, and align the getter and tests with it? The Latin-text run establishes that caller path; it does not show that every default 0x10 string should report 0x12. I would keep this question open rather than substitute another unmeasured direction rule. |
MarcZX10
left a comment
There was a problem hiding this comment.
The existing test and title run show the chosen result lets the reported path proceed, but the native getter result for a default horizontal form is still explicitly unmeasured. The change maps every stored 0x10 value to 0x12, while the current evidence is a Latin-text call path and does not establish the getter contract across RTL/default-form inputs. Please add a console/API-contract result covering default-form LTR and RTL inputs, or keep the behavior scoped to the demonstrated case and mark the general mapping unresolved. This is an evidence gap in the core behavior, not a request for unrelated rendering coverage.
b38774d to
ef9fed3
Compare
|
@oneandonlydean @MarcZX10 agreed: the all-0x10 mapping was not backed by a measured result. The native getter result for a default-form string, with left-to-right or right-to-left text, has not been measured yet, so I took the second option and scoped the change to what the title shows. Head
Once a native result for the default form with right-to-left text is measured, the debt line is where it belongs, and the second branch is the only thing to change. AI-assisted: yes. Written with AI assistance and reviewed by me. |
MarcZX10
left a comment
There was a problem hiding this comment.
Re-review of current head ef9fed3a2aada48ef4c87262c8b045f3eec6ce86. The revision addresses the earlier scope concern by leaving default-form strings containing RTL characters unchanged and limiting the new result to strings without the listed RTL ranges. The tests cover both branches, and the debt note now says the native result is unknown.
The remaining core behavior is still inferred: the only evidence is that Tekken passes Latin text to sceFontCreateWritingLine; that does not establish what the PS5's sceFontStringGetWritingForm returns for that string, nor that every non-RTL default-form string should return 0x12. The observed rejection is AnyPS5's behavior, not a console measurement. Under the repo's rule that unverified behavior stays unresolved rather than being guessed, please provide a native/API-contract result for the getter or leave its unknown default-form behavior unimplemented until measured. The exact-head regression currently asserts the proposed result but cannot establish it. Hosted policy checks pass; product jobs are path-skipped. This is an evidence blocker, not a request to close the PR.
|
Firmware result for the open question, from
So the first strong character decides. RLM and LRM count as strong; RLE and RLO don't, and text between an isolate initiator and its PDI (or the end of the text) is skipped. Every case matches Unicode bidi rules P2 and P3. So the PR's Latin result ( One limit of the run: the harness has no real font, so for non-empty strings |
|
@klosixgaming-arch BunnyFl's 13.42 report answers the open question, and ef9fed3 doesn't match it yet. On firmware, Could you move the decision into |
A string created from a text source in the default horizontal form (0x10) reported 0x10. TEKKEN: DARK RESURRECTION (PPSA31371) passes the reported form to sceFontCreateWritingLine, which only accepts 0x11 and 0x12, so the call failed and the layout width was 0. On firmware 13.42 sceFontCreateString decides the direction for a default-form source and sceFontStringGetWritingForm returns the stored form. The string gets 0x12 when its first strong character is left to right, 0x11 when it is right to left, and 0x12 when it has none. Left-to-right and right-to-left marks count as strong, embeddings and overrides do not, and text between an isolate initiator and its PDI is skipped. Explicit 0x11 and 0x12 sources keep their form. The test follows the table reported on the pull request. Which characters are strong is decided by Unicode block ranges here, not by the full bidi class tables.
ef9fed3 to
0e46a0c
Compare
|
@BunnyFl thank you, that is exactly the measurement this PR was missing. @oneandonlydean you were right that the head did the opposite of the firmware. New head
AI-assisted: yes. Written with AI assistance and reviewed by me. |
What
A string created from a text source in the default horizontal form (0x10) reported 0x10. TEKKEN: DARK RESURRECTION (PPSA31371) passes the reported form to
sceFontCreateWritingLine, which only accepts 0x11 and 0x12, so the call failed and the title's text layout width was 0.On firmware 13.42,
sceFontCreateStringdecides the direction for a default-form source, andsceFontStringGetWritingFormreturns the stored form (measurement by BunnyFl, in the comments). This PR does the same: the string gets 0x12 when its first strong character is left to right, 0x11 when it is right to left, and 0x12 when it has none. LRM and RLM count as strong, embeddings and overrides do not, and text between an isolate initiator and its PDI is skipped. Explicit 0x11 and 0x12 sources keep their form.The report ran non-empty text only until a later glyph-stage failure, and only empty text ran to completion, so this is not full native right-to-left rendering. Which characters are strong is decided by Unicode block ranges, not the full bidi class tables. Both are in
docs/dev/debt/libSceFont.md.Tested
guest_fontandguest_font_writing_linepass. The font test covers every row of the reported table that can be built from code points, plus explicit 0x11 and 0x12 sources.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryAI-assisted: yes. Written with AI assistance and reviewed by me.