Files
package-language-reader-pre…/RENDERER_PROVENANCE.md
T

2.4 KiB

Renderer provenance

This renderer follows the measured source-span layout and aligned overhead annotations from Fluxtapose's reading-chapter-ui, including its later highlight and underline work. The recovered source was the Nix-cached package at /nix/store/2ka0jcdpyijmpjsrwqkap682l4xk88zi-source, rather than the earlier prose-probe prototype. Fluxtapose's reading-app-2 references package revision 4e479c1a74c13d7467071da60b98fc148128dd99; exact cache revision is unconfirmed.

Recovered file SHA-256:

File SHA-256
text-layout.ts e6c330f60b7f1c16235454d1ce9c7656ef2379e744322ac13826753831e13d72
text-rendering.ts ce2ea4f15f4d3b86d4b8f72d6ac7221cb131c996d19ec24052d80e3235012f77
text-processing.ts 7d8a72aa2d8791ad37351d1c7c872419b288b5e0e51214983a29ff48c8465038

The original shared source/annotation flow is preserved: every annotation source has one row per physical text line. Long words and translations request horizontal padding around their source ranges and continue across subsequent lines. A forward capacity constraint replaces the ten-pass spacing loop; collisions never create additional annotation rows. Conflicting ranges from the same source share an ordered horizontal run. Row heights use all glyphs/ranges, and mixed font sizes share a baseline. Text keeps original UTF-16 offsets, including leading spaces and grapheme clusters. Measurement is injected for tests and uses a bounded cache in browsers. Canvas drawing and selection have no Konva or memoizee dependency.

Legal wrap positions use the pinned @cto.af/linebreak 4.0.3 implementation of Unicode 17 UAX #14, intersected with Intl grapheme boundaries. Intl word segmentation remains responsible for word targeting and preferred word affinity. Source text and overhead labels use the same line-breaking layer. Closing marks stay with preceding text, opening brackets stay with following text, and annotation padding cannot insert a break inside those punctuation spans. Oversized words and numbers use emergency tailoring of the alphabetic/numeric rules while retaining punctuation rules; viewports narrower than an inseparable span still require clipping. The package's Yarn lock and generated Nix dependency closure retain the library and its transitive dependencies for reproducible browser builds.