feat(font): implement writing lines #769
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/769"
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 adriadam10 on 2026-10-05T22:39:39Z.
What
Implements the libSceFont writing line:
sceFontCreateWritingLine,sceFontDestroyWritingLine,sceFontWritingLineClear,sceFontWritingLineWritesOrder,sceFontWritingLineRefersRenderStep,sceFontWritingLineGetRenderMetrics. Astro's Playroom imports all six.src/libs/libFont.cpp), the only reference with a body (shadPS4 and prosper only return OK). Each written run is placed at the line's advance so far (y0, no spacing or adjustment); the line advance is the sum of the run advances and the extent is the union of the run extents shifted by their pen position.RefersRenderStepreturns the runs in order, then null, and starts over after a new run is written or the line is cleared. Destroying a null handle returns OK and the refer call returns null for a null line, as in KytyPS5.SceFontWritingLineStep(0x40 bytes) /SceFontCreateWritingLineDetail(id0x0FD5) layouts come from SharpProspero (SceFont.Engine.cs,SceFontStructs.cs). Writing form values are the SharpProspero onesText.cppalready uses.0x10) and left-to-right (0x12) lines, writing attribute 0 and non-null run metrics are modelled. RTL lines, other attributes, a detail with another id, the metrics of an empty line (KytyPS5 returns placeholder values) and unknown or null handles throw: KytyPS5 returns-1there and no reference gives the real error code.sceFontWritingLineGetOrderingSpace(KytyPS5 returns head = tail = line advance: a placeholder) andsceFontGlyphDefineAttribute(its pairsceFontGlyphGetAttributehas no body anywhere).#699 adds stubs right after the last block this PR removes from
Unimplemented.cpp, so whichever merges second has a one-hunk conflict there.Tested
Linux (GCC Release + the fast build). New
guest_font_writing_linetest: creates lines, writes three runs and checks every step field and the line metrics after each write, the restart after a write and after clear, a second LTR line, and every throwing path (bad form, detail id, attribute, null metrics, empty-line metrics, null/unknown/destroyed handles). It fails onmain(the stubs throw). Each piece was checked to make the test fail when broken (12 mutations: pen position, extent shift, min/max, advance sum, orderer, cursor restart, clear, form/attribute/detail/empty checks, handle registry).guest_fontstill passes.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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-05T22:40:04Z.
Progress report (
964dd3c→83442e1)📈 System libraries: 80.18% (+0.19%, +6 implemented functions)
✅ 6 implemented
sceFontCreateWritingLinesceFontDestroyWritingLinesceFontWritingLineClearsceFontWritingLineGetRenderMetricssceFontWritingLineRefersRenderStepsceFontWritingLineWritesOrderImported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-05T23:32:36Z.
Rebased on main after the new
sceFontGraphicsDrawupFillTexture*Objectstubs inUnimplemented.cpp(conflict next to the removed WritingLine stubs; both kept).guest_font_writing_linepasses.