Skip to content

Add a regression test for FontMatrix right after ROS in a CFF Top DICT - #727

Open
brandonweeks wants to merge 1 commit into
veraPDF:integrationfrom
brandonweeks:cff-ros-fontmatrix-test
Open

Add a regression test for FontMatrix right after ROS in a CFF Top DICT#727
brandonweeks wants to merge 1 commit into
veraPDF:integrationfrom
brandonweeks:cff-ros-fontmatrix-test

Conversation

@brandonweeks

@brandonweeks brandonweeks commented Sep 4, 2026

Copy link
Copy Markdown

#723 fixed this but didn't add a test. Two Libertinus subsets from Typst, identical except Copyright and FontMatrix are swapped. Widths must match /W for both.

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of CID-keyed CFF font data when Top DICT operators appear in different orders.
    • Ensured glyph widths are interpreted consistently across supported CFF font variations.

veraPDF#723 fixed this but didn't add a test. Two Libertinus subsets from Typst,
identical except Copyright and FontMatrix are swapped. Widths must match
/W for both.
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 278858f2-42ec-4229-8455-34e11d877c98

📥 Commits

Reviewing files that changed from the base of the PR and between 815f8cc and 2ca4109.

📒 Files selected for processing (3)
  • src/test/java/org/verapdf/pd/font/cff/CFFCIDFontProgramTest.java
  • src/test/resources/org/verapdf/pd/font/cff/LibertinusSerif-subset-ros-fontmatrix.cff
  • src/test/resources/org/verapdf/pd/font/cff/LibertinusSerif-subset.cff

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Adds CFFCIDFontProgramTest with regression coverage for CID-keyed CFF Top DICT operator ordering. The tests parse two fixtures, verify CID glyph widths against expected values, and confirm identical widths across both operator orderings.

Changes

CFF CID width regression tests

Layer / File(s) Summary
CID width parsing and operator-order validation
src/test/java/org/verapdf/pd/font/cff/CFFCIDFontProgramTest.java
Adds fixture constants and expected widths. Parses both fixtures as CID fonts, validates glyph counts and widths, and compares widths across the two Top DICT operator orderings.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 2ca41

This adds regression coverage for CID CFF width parsing across Top DICT operator orderings without changing runtime behavior. No current merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: adding a regression test for FontMatrix immediately after ROS in a CFF Top DICT. This matches the pull request objectives and the added test coverag…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant