Repository navigation
Description
Context
DESIGN.md section 5 (F5) and section 8. hayro 0.9.0 (released 2026-11-02) contains the changes that #18 and #224 wait on, but it also removes two identities that pyropdf's engine reads:
OutlineGlyph::font_cache_key()went away when fonts moved intohayro-font(hayro-font: Move the PDF font layer out of hayro-interpret LaurenzV/hayro#1696, #1699), with no replacement. pyropdf groups glyphs by the font dictionary they were drawn with: glyph subsetting incrates/pyropdf-engine/src/extract/glyphs.rscompares it withDict::cache_key()of a font object, andextract/model.rsandextract/text.rskey their font tables and spans by it.OutlineGlyph::identifier()depends only on the font program, so fonts that share a program (two dictionaries over one embedded file, or every non-embedded Helvetica) become indistinguishable.SoftMask::id(), the object identifier of the mask's group, was removed on purpose in hayro-interpret: Identify soft masks by their dictionary LaurenzV/hayro#1553: a mask is identified by its dictionary. pyropdf accepts that: the publicSoftMask.xrefwas deprecated during adoption; removal is separately gated in Remove the deprecated SoftMask.xref in the next minor release #610, and where a mask comes from belongs to provenance (hayro-interpret: provenance of painted items (I4) #104).
The owner authorized adopting the patched 0.9-based commit through merged PR #609, completing the migration in #18. The remaining release dependency is #603: remove the temporary git patches once a hayro release contains this API.
Goal
A hayro release whose GlyphRun returns the dictionary of the font that the run was shown with.
Scope
In: GlyphRun::font_dict() in hayro-interpret, None for a run that hayro draws with its fallback font. Out: the group of a soft mask (see Context), and pyropdf's adoption of 0.9, which is #18 and #224.
Paths
hayro-interpret src/font/mod.rs, src/interpret/state.rs, src/interpret/text.rs, src/context.rs; hayro tests/tests/text.rs and tests/pdfs/text/glyph_run_font_dict.pdf.
Acceptance
- A local patch with a test that runs report their font dictionary, two dictionaries over one program included, and
Nonefor the fallback font - pyropdf's engine on
claude/18-hayro-0.9-u32, moved to it, builds and passes its font and text tests against hayro with the patch - With the owner's go-ahead: hayro-interpret: Expose the font dictionary of a glyph run LaurenzV/hayro#1734 updated to this design
- A hayro release that contains it; then Build against released hayro again: remove the [patch.crates-io] of LaurenzV/hayro#1734 #603 removes the temporary git patches
Notes
LaurenzV/hayro#1734 was opened with an earlier design (commit 0101c86f): a font key on each OutlineGlyph, and the mask's group back as SoftMask::group_id(). It was redesigned because hayro 0.9 keeps glyphs dependent only on their program (#1699), a run is shown with one font (GlyphRun::writing_mode(), LaurenzV/hayro#1605, already reports a property of it), devices already receive raw dictionaries (begin_marked_content, LaurenzV/hayro#1625), the run covers Type 3 fonts as well, and #1553 removed the group ID deliberately.
Local branch: glyph-run-font-dict, commit 394e4a0 on hayro main 4f7d16fa. pyropdf keys runs by Dict::cache_key() of the run's font dictionary, as 0.8's font_cache_key did, and by a key of its own for the fallback font.
Verified on 2026-11-06: hayro#1734 remains open at 394e4a0d37baf8af513f6ebda15f4bada85d6f23, the exact commit used by the workspace. Its four checks pass with no reviews or review threads. Latest published hayro is 0.9.0 (2026-11-02), which lacks this API. Keep #584 open as upstream:filed and keep #603 blocked. The compatibility removal in #610 remains subject to its explicit minor-release gate.
Activity
yhay81 commentedon Nov 3, 2026
Opened upstream with the owner's go-ahead ("PR を出す"): LaurenzV/hayro#1734, branch
yhay81/hayro:identify-fonts-and-mask-groups, commit0101c86fon upstream main4f7d16fa. hayro-font and hayro-interpret tests, clippy-D warnings, and fmt pass. Next: follow review on #1734; once a hayro release contains it, #18 resumes fromclaude/18-hayro-0.9-u32(handoff on #18).WIP: Group glyph runs by their font dictionary (#18)
[-]hayro: expose the font of an outline glyph and the group of a soft mask again[/-][+]hayro: expose the font dictionary of a glyph run[/+]yhay81 commentedon Nov 3, 2026
Redesigned at the owner's request to rework LaurenzV/hayro#1734 ("これを適切に再設計したい"): the font dictionary of a glyph run instead of a key on each outline glyph, and no soft mask group ID, accepting LaurenzV/hayro#1553. The body now describes this design; the reasons are in its Notes.
glyph-run-font-dict, commit394e4a0onmain4f7d16fa, not pushed. fmt, clippy and rustdoc with-D warnings, the crate tests, and the release suite pass: 1,786 passed, andraster::pdfjs_bug1703683fails onmaintoo, because its reference image download returns 404.claude/18-hayro-0.9-u32atba1e824fuses it; checks and remaining failures are in the handoff on hayro-syntax: object numbers as u32 (I8) #18.Next: with the owner's go-ahead, force-push the commit to
yhay81/hayro:identify-fonts-and-mask-groups, retitle LaurenzV/hayro#1734 "hayro-interpret: Expose the font dictionary of a glyph run", and replace its body with the drafted one, which says why the earlier version changed.yhay81 commentedon Nov 3, 2026
Updated LaurenzV/hayro#1734 with the owner's go-ahead ("反映して"): force-pushed
394e4a0dover0101c86ftoyhay81/hayro:identify-fonts-and-mask-groups, retitled it "hayro-interpret: Expose the font dictionary of a glyph run", and replaced its body. CI started on the new head. Next: follow review on LaurenzV/hayro#1734; once a hayro release contains it, #18 resumes fromclaude/18-hayro-0.9-u32(handoff on #18).WIP: Move to hayro 0.9.0 (#18)
WIP: Group glyph runs by their font dictionary (#18)
Build every hayro crate from yhay81/hayro 394e4a0d (#18)
yhay81 commentedon Nov 3, 2026
pyropdf adopts the patched commit
394e4a0din #609, by the owner's decision recorded on #18. This stays open until a hayro release contains LaurenzV/hayro#1734; #603 (blocked by this) then removes the patch.Move to hayro 0.9 with LaurenzV/hayro#1734 patched in, and read strea…
yhay81 commentedon Nov 5, 2026
Audited on
codex/584-font-release-auditat13ea858a096493bb49e681c450a2a44302ecfaa7; no code change or new PR. Corrected the obsolete claim that #18 cannot adopt 0.9: #609 merged on 2026-11-03 with the owner-approved patched commit. The release transition now points to #603, and SoftMask.xref removal remains gated in #610.hayro#1734 is OPEN at
394e4a0d37baf8af513f6ebda15f4bada85d6f23, matching the workspace patch. All four checks pass; comments, reviews and review threads are empty. Latest release remains hayro 0.9.0 (2026-11-02), without the API. #603 therefore cannot yet remove the patches.Next action: follow maintainer review, verify a containing release, and resume #603 to update workspace/fuzz manifests and lockfiles with full checks and audit. Preserve
yhay81/hayrotagpyropdf/glyph-run-font-dictand its commit because published sdists still depend on it. Do not repeat the completed #18 migration or bypass #610's minor-release gate. Claim released; release acceptance stays unchecked andupstream:filedremains appropriate.