Repository navigation
feat(pdf): HarfBuzz/FriBidi complex-script shaping for Unicode XObjects - #36
Merged
Merged
Conversation
Add isolated native shaping, bidirectional run segmentation, GPOS glyph placement and logical text extraction support for Arabic, Hebrew and combining marks. Preserve the existing direct Unicode path and reject unsafe native output or excessive shaping workloads. Refs: #33 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Validate real PDF round trips for Arabic, Hebrew, ligatures, combining marks and mixed-script names. Add negative/data-provider coverage for untrusted native output, unsafe inputs, timeouts, temporary font files and glyph cluster boundaries. Refs: #33 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Install HarfBuzz and FriBidi tools for integration, coverage and mutation CI jobs without modifying runtime deployment settings. Refs: #33 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Reject invalid explicit glyph identifiers before emitting PDF objects, use scalar-only font selection and eliminate duplicate shaping when building the content stream and resource dictionary. Preserve glyph placement and existing public builder methods. Refs: #33 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
… bounds Cover absolute glyph offsets and equal-cluster order, shared shaping per document, invalid shaped glyph IDs, and Unicode widths. Preserve existing script round trips with targeted regressions. Refs: #33 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Describe trusted font configuration, HarfBuzz/FriBidi deployment, validating signed PDFs, full font embedding and interoperability limitations without changing README usage examples. Refs: #33 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Compile the exact Western, Greek, Cyrillic, Arabic, Hebrew and Japanese examples with fallback fonts and assert two embedded Unicode resources, logical extraction and six preserved lines in one exported PDF. Refs: #33 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Select fonts without splitting grapheme clusters, preserve bidi order and shaping context, and use a common glyph plan for measurement and rendering. Cover mixed-script rendering, fallback boundaries, resource mappings and logical text extraction. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Exercise Unicode input, supplementary scalars, mixed-font fallback, unsupported coverage and native shaping through named data providers. Verify the destination PDF signature appearance with the actual core object allocator, independent Poppler extraction and matching raster output. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Split automatic hyphenation candidates at extended grapheme boundaries rather than individual Unicode scalars. Regressions cover Latin accents, Hebrew niqqud and Arabic vowel marks with actual embedded-font metrics. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Use explicit primary script properties and keep combining marks attached to their base across PCRE Unicode database versions. Add run segmentation regressions. Return the initialized grapheme match list directly to remove an equivalent mutation while preserving invalid UTF-8 behavior. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
Base automatically changed from
feat/issue33-signerphp-resource-bridge
to
main
November 24, 2026 02:37
vitormattos
marked this pull request as ready for review
November 24, 2026 02:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Implements complex-script shaping for #33. Stacked on #35, which depends on SignerPHP/pdf-core#5. Keep this PR in draft until its dependencies are integrated and a downstream signed-PDF release is verified.
Design
Evidence
7f1f22b, combined with the latest feat(pdf): embed Unicode font and image objects in signed XObjects #35 fixes. The Unicode integration suite has 62 cases / 930 assertions (35 additional cases), including all six literal examples from Support Unicode text in PDF XObject output #33 together in one PDF.pdf-coresignature widget serialized as an incremental PDF update, without altering the preceding revision. The released core API is exercised by explicitly invoking the resource-builder callback before attaching the appearance. This does not claim that the widget fixture is cryptographically signed.FriBidiParagraphMapperandTextLineBreaker: 199/199 killed, 100% MSI with no skipped or errored mutants.1f55bbcand pdf-signer main12031a0: synthetic SHA-256 CMS PDF signature valid in SignerPHP and Popplerpdfsig. Poppler and MuPDF independently rendered and extracted the six required languages and mixed-script lines; the test used a self-signed synthetic certificate, not production trust.Open-source comparison
Merge / issue closure
Known boundaries
No merge or issue closure requested by this PR.