mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-10 10:20:32 -06:00
Inside a text object q/Q save and restore Tm and Tlm too (ISO 32000-2 §9.4.1, as corrected by the PDF Association's erratum, pdf-association/pdf-issues #368). The renderer's saved state already holds both. The text-editing interpreter and the heading detector kept them across Q: text after Q was listed (and, once edited, moved) where the q ... Q block left the pen, and a word continued after Q was split ("Chap ter One"). Both saved stacks now hold the two matrices. Tests: pdfcraft-edit and pdfcraft-a11y tests::q_inside_a_text_object_restores_the_text_matrices. Reverting the edit fix puts the first case at y = 600, not 700; restoring only Tm puts the T* case at 586, not 686; reverting the a11y fix reads "Chap ter One". Each fails its test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SqmHYx8FiWM5PcsoiErgp9