Skip to content

Conversation

@fcalafat
Copy link

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 GsubWorkerForDflt class, updates the language enum, and provides comprehensive tests to ensure correct behavior for both pass-through and ligature substitution scenarios.

DFLT Script Support:

  • Added a new GsubWorkerForDflt implementation 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)
  • Updated the Language enum to include the DFLT script, allowing it to be recognized and processed. (fontbox/src/main/java/org/apache/fontbox/ttf/model/Language.java)
  • Modified the GsubWorkerFactory to return a GsubWorkerForDflt instance when the DFLT script is detected. (fontbox/src/main/java/org/apache/fontbox/ttf/gsub/GsubWorkerFactory.java)

Testing and Validation:

  • Added a new integration test suite for 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)

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