Summary
Document.fonts only discovers fonts directly listed in each page's Font resources. Fonts reachable through nested resource dictionaries are omitted, including fonts inside Type 3 fonts and Pattern resources.
Versions tested
Test files
Reproduction
import playa
for path in (
"FontinsideType3insideType3.pdf",
"PatternTextInsideText.pdf",
):
with playa.open(path) as document:
print(path, list(document.fonts))
Actual behavior
The nested Type 3 fixture reports only ['FType3A']; it omits FType3B and Helvetica. The Pattern fixture reports only ['Helvetica']; it omits Times-Italic.
Expected behavior
Document-wide font discovery should recursively traverse reachable resource dictionaries. The nested Type 3 fixture should report FType3A, FType3B, and Helvetica, while the Pattern fixture should report Helvetica and Times-Italic.
Relevant implementation
document.FontMapping._iteritems() builds its mapping exclusively from page.fonts.values(). It does not traverse resource dictionaries reachable through Type 3 fonts, Patterns, or other nested resources.
Disclosure
This issue was prepared by an AI coding agent on behalf of @lin-string. The reproduction and results were verified against the current default branch.
Summary
Document.fontsonly discovers fonts directly listed in each page's Font resources. Fonts reachable through nested resource dictionaries are omitted, including fonts inside Type 3 fonts and Pattern resources.Versions tested
playa-pdf1.1.0 (v1.1.0, commit85a9c1e22e327bf873e4282d66ed1dba89fa7575)mainat commit9496dfea5150343c9dc05544d9c004bbcccf17e6, checked on 2026-09-06Test files
Reproduction
Actual behavior
The nested Type 3 fixture reports only
['FType3A']; it omits FType3B and Helvetica. The Pattern fixture reports only['Helvetica']; it omits Times-Italic.Expected behavior
Document-wide font discovery should recursively traverse reachable resource dictionaries. The nested Type 3 fixture should report FType3A, FType3B, and Helvetica, while the Pattern fixture should report Helvetica and Times-Italic.
Relevant implementation
document.FontMapping._iteritems()builds its mapping exclusively frompage.fonts.values(). It does not traverse resource dictionaries reachable through Type 3 fonts, Patterns, or other nested resources.Disclosure
This issue was prepared by an AI coding agent on behalf of @lin-string. The reproduction and results were verified against the current default branch.