Repository navigation
PDFBOX-6306: Make PDTYpe0Font and GlyphLayout* extensible - #561
Open
vk-github18 wants to merge 1 commit into
Open
vk-github18 wants to merge 1 commit into
vk-github18 wants to merge 1 commit into
Conversation
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.
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
PDType0Fontimplementations—for example, to provide custom font behavior alongside glyph layout. The existing implementation directly createdPDType0Fontinstances and instantiated its font loaders internally, limiting customization without duplicating implementation code.Changes
GlyphLayoutProcessorAwtandGlyphLayoutProcessorFop.loadPDType0Font(...)methods to the AWT and FOP font loaders.PDType0Fontconstructor that accepts aTrueTypeFontprotected, enabling subclasses to create specialized Type 0 fonts.supportsFont(...)verify that the supplied font is aPDType0Fontbefore 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.