Skip to content

PDFBOX-6306: Make PDTYpe0Font and GlyphLayout* extensible - #561

Open
vk-github18 wants to merge 1 commit into
apache:trunkfrom
vk-github18:pr2026-11-10
Open

vk-github18 wants to merge 1 commit into
apache:trunkfrom
vk-github18:pr2026-11-10

Conversation

@vk-github18

@vk-github18 vk-github18 commented Nov 10, 2026 •

Copy link
Copy Markdown

See https://issues.apache.org/jira/browse/PDFBOX-6306

Summary

This change adds extension points to the PDFBox glyph-layout processors and font loaders, allowing subclasses to customize font creation without replacing the existing loading and layout flow.

Motivation

Some integrations require specialized PDType0Font implementations—for example, to provide custom font behavior alongside glyph layout. The existing implementation directly created PDType0Font instances and instantiated its font loaders internally, limiting customization without duplicating implementation code.

Changes

  • Add overridable font-loader factory methods to GlyphLayoutProcessorAwt and GlyphLayoutProcessorFop.
  • Add overridable loadPDType0Font(...) methods to the AWT and FOP font loaders.
  • Make the PDType0Font constructor that accepts a TrueTypeFont protected, enabling subclasses to create specialized Type 0 fonts.
  • Make supportsFont(...) verify that the supplied font is a PDType0Font before checking loader support.

Compatibility

Default font loading and glyph-layout behavior are unchanged. The new extension points are opt-in and intended for subclasses.

Testing

No test changes are included in this branch.

@vk-github18 vk-github18 changed the title Make PDTYpe0Font and GlyphLayout* extensible PDFBOX-6306: Make PDTYpe0Font and GlyphLayout* extensible Nov 10, 2026
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