Skip to content

hayro: expose the font dictionary of a glyph run #584

Open

Description

@yhay81

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:

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

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

  1. added this to the Phase 0: Foundation milestone on Nov 3, 2026
  2. added
    upstreamWork that lands in an engine or dependency repository
    area:enginecrates/pyropdf-engine: interpretation, rendering, writing, understanding
    engine:hayroEngine or dependency: hayro
    upstream:draftUpstream: prepared here, not yet published upstream; waits on the owner's go-ahead
    on Nov 3, 2026
  3. added
    upstream:filedUpstream: issue or pull request filed upstream; waits on the maintainer
    and removed
    upstream:draftUpstream: prepared here, not yet published upstream; waits on the owner's go-ahead
    on Nov 3, 2026
  4. yhay81 commented on Nov 3, 2026

    @yhay81
    OwnerAuthor

    Opened upstream with the owner's go-ahead ("PR を出す"): LaurenzV/hayro#1734, branch yhay81/hayro:identify-fonts-and-mask-groups, commit 0101c86f on upstream main 4f7d16fa. 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 from claude/18-hayro-0.9-u32 (handoff on #18).

  5. changed the title [-]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[/+] on Nov 3, 2026
  6. yhay81 commented on Nov 3, 2026

    @yhay81
    OwnerAuthor

    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.

    • hayro: local branch glyph-run-font-dict, commit 394e4a0 on main 4f7d16fa, not pushed. fmt, clippy and rustdoc with -D warnings, the crate tests, and the release suite pass: 1,786 passed, and raster::pdfjs_bug1703683 fails on main too, because its reference image download returns 404.
    • pyropdf: claude/18-hayro-0.9-u32 at ba1e824f uses 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.

  7. yhay81 commented on Nov 3, 2026

    @yhay81
    OwnerAuthor

    Updated LaurenzV/hayro#1734 with the owner's go-ahead ("反映して"): force-pushed 394e4a0d over 0101c86f to yhay81/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 from claude/18-hayro-0.9-u32 (handoff on #18).

  8. yhay81 commented on Nov 3, 2026

    @yhay81
    OwnerAuthor

    pyropdf adopts the patched commit 394e4a0d in #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.

  9. added a commit that references this issue on Nov 3, 2026
  10. added
    in-progressClaimed; the latest comment names the branch
    on Nov 5, 2026
  11. yhay81 commented on Nov 5, 2026

    @yhay81
    OwnerAuthor

    Audited on codex/584-font-release-audit at 13ea858a096493bb49e681c450a2a44302ecfaa7; 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/hayro tag pyropdf/glyph-run-font-dict and 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 and upstream:filed remains appropriate.

  12. removed
    in-progressClaimed; the latest comment names the branch
    on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:enginecrates/pyropdf-engine: interpretation, rendering, writing, understandingengine:hayroEngine or dependency: hayroupstreamWork that lands in an engine or dependency repositoryupstream:filedUpstream: issue or pull request filed upstream; waits on the maintainer

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions