Files
pdfcraft/crates/edit/src
e4f370cda3 fix(edit): preserve existing fonts when adding text (#7762) (#7766)
* fix(edit): preserve occupied font names when adding text

* fix(edit): preserve reused indirect font resources

* fix(edit): reuse a matching font whatever the order of its entries

Dict compares its entries in order, so a Helvetica on the page with the
entries we write in another order was not reused, and added text took a
suffixed resource it didn't need. The fonts are compared by key now.

A test keeps a Helvetica that differs only in its /Encoding, has none, or has
an entry more: the Courier fixture also differs in /BaseFont and would pass
without the encoding check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* Adapt mixed-script font test to DrawnItem

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: FredApps <[email protected]>
2026-12-04 14:22:40 +01:00
..