[PDFBOX-6103] Add DFLT script support in GSUB system for OpenType fonts #351
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.
This pull request adds support for the DFLT (default) script to the GSUB (Glyph Substitution) system in FontBox, enabling script-neutral typographic features for fonts that use the DFLT script table. It introduces a new
GsubWorkerForDfltclass, updates the language enum, and provides comprehensive tests to ensure correct behavior for both pass-through and ligature substitution scenarios.DFLT Script Support:
GsubWorkerForDfltimplementation to handle script-neutral GSUB features in the DFLT script, following OpenType recommendations for feature processing order (ccmp,liga,clig,calt). (fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GsubWorkerForDflt.java)Languageenum to include the DFLT script, allowing it to be recognized and processed. (fontbox/src/main/java/org/apache/fontbox/ttf/model/Language.java)GsubWorkerFactoryto return aGsubWorkerForDfltinstance when the DFLT script is detected. (fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GsubWorkerFactory.java)Testing and Validation:
GsubWorkerForDflt, verifying correct pass-through for fonts without ligature features and proper ligature substitution for fonts with standard ligatures in the DFLT script. (fontbox/src/test/java/org/apache/fontbox/ttf/gsub/GsubWorkerForDfltTest.java)