Skip to content

Optimize font compression, CJK/Japan1 CMaps, and SFNT subsetting - #285

Open
balazs-szucs wants to merge 7 commits into
refactor/font-24-perf-optimizationsfrom
refactor/font-25-cjk-and-subset-hardening
Open

balazs-szucs wants to merge 7 commits into
refactor/font-24-perf-optimizationsfrom
refactor/font-25-cjk-and-subset-hardening

Conversation

@balazs-szucs

@balazs-szucs balazs-szucs commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

Description of Changes

Hardens UTF-8 font inventory lookup, proportional and vertical Adobe-Japan1 CMaps, SFNT Unicode cmap pruning, and subset /CIDSet repair. Prevents lookup failures on Latin-1/UTF-8 mixed PostScript font names and fixes vertical CJK glyph/CIDSet mismatches.

Changed:

  • Decode Latin-1-preserved UTF-8 font names before fallback lookup in PdfFontEmbedder and add regression coverage in PdfFontInventoryTest.
  • Support proportional and vertical Japan1 CMaps (/90msp-RKSJ-H, /90ms-RKSJ-V), prune unused SFNT cmap records cleanly, and harden NativeJsonParser and PdfTextSearcher.
  • Update PdfFontEmbedderTest, PdfFontEmbedderRoundTripTest, PdfTextSearcherTest, and NativeJsonParserTest.

Checklist

General

  • I have read the Contributing Guide
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Notable user-facing changes are recorded under ## [Unreleased] in CHANGELOG.md

Library changes

  • Javadoc covers any new or changed public type or member
  • Public API changes are additive, or .github/workflows/compatibility.yml excludes the break with a reason
  • Version references stay consistent across the README, docs/installation.md, and the POMs

Native or FFM changes

  • Rebuilt the bridge at the stack tip (bash native/build-real.sh)
  • Ran ./gradlew :jpdfium:integrationTest
  • Updated native/bridge/include/jpdfium.h and the ABI notes for any ABI change

Testing

  • Added or updated tests that cover the change
  • ./gradlew :jpdfium:integrationTest passes

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 57 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c759d01 and 0174dac.

Files selected for processing: 12

  • CHANGELOG.md
  • jpdfium/src/main/java/stirling/software/jpdfium/doc/PdfFontEmbedder.java
  • jpdfium/src/main/java/stirling/software/jpdfium/text/PdfTextSearcher.java
  • jpdfium/src/main/java/stirling/software/jpdfium/util/NativeJsonParser.java
  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontEmbedderRoundTripTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontEmbedderTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/doc/PdfFontInventoryTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/text/PdfTextSearcherTest.java
  • jpdfium/src/test/java/stirling/software/jpdfium/util/NativeJsonParserTest.java
  • native/bridge/src/jpdfium_advanced.cpp
  • native/bridge/src/jpdfium_qpdf.cpp
  • native/bridge/src/jpdfium_qpdf_writer_lock.h
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@balazs-szucs
balazs-szucs added this pull request to stack #298 November 15, 2026 12:00
Comment thread native/bridge/src/jpdfium_advanced.cpp Resolved
@balazs-szucs
balazs-szucs force-pushed the refactor/font-25-cjk-and-subset-hardening branch from f2ab4c6 to 3b1ceb8 Compare November 15, 2026 16:52
@balazs-szucs
balazs-szucs force-pushed the refactor/font-25-cjk-and-subset-hardening branch from 3b1ceb8 to 4967c68 Compare November 18, 2026 19:55
@balazs-szucs
balazs-szucs force-pushed the refactor/font-25-cjk-and-subset-hardening branch from 4967c68 to a107c7a Compare November 18, 2026 20:33
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
Signed-off-by: Balázs Szücs <bszucs1209@gmail.com>
@balazs-szucs
balazs-szucs force-pushed the refactor/font-25-cjk-and-subset-hardening branch from a107c7a to 0174dac Compare November 19, 2026 12:57

This branch has not been deployed

No deployments
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.

2 participants