Skip to content

PPF-2060: Allocate font resource names without assuming every name is numeric #2060

Closed

Description

@chinapandaman

Version

Reviewed baseline: PyPDFForm 6.0.0, commit 0b5cc1dc8604b36693864852d76ed7e60f903451.

Issue Description

At the reviewed snapshot, _get_new_font_name() attempted int(key[2:]) for every font resource beginning with /F. A valid existing resource such as /FontA therefore caused ValueError when registering a new font.

Work

Restrict numeric suffix parsing in font.py to the exact resource-name pattern it owns, and allocate an unused name without changing existing arbitrary resource keys.

Acceptance Criteria

  • /FontA, /FCustom, sparse /F1 and /F9 entries, and unrelated names all survive registration; the new resource does not collide and remains usable after reopening.

Basis and Dependencies

R12. Independent of registry cleanup in E2-04 and later resource ownership in E5-04.

Source and Validation

Action E1-07, Group 1 — Lowest-hanging fruit, from the October 10, 2026 action plan; supporting review evidence. Related action identifiers refer to that plan.

The behavior above is evidence from the source review, not a new reproduction performed when filing this issue. Reconfirm the relevant baseline or document intervening changes before implementation. Follow the plan's completion and validation rules and the Developer Guide, including meaningful regression assertions for behavior changes.

Activity

  1. changed the title [-]Allocate font resource names without assuming every name is numeric[/-] [+]PPF-2060: Allocate font resource names without assuming every name is numeric[/+] on Oct 11, 2026
  2. moved this from Backlog to In progress in PyPDFForm-support-2026on Oct 15, 2026
  3. moved this from In progress to In review in PyPDFForm-support-2026on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions