Fabrice Calafat created PDFBOX-6103:
---------------------------------------
Summary: Add DFLT script support in GSUB system for OpenType fonts
Key: PDFBOX-6103
URL: https://issues.apache.org/jira/browse/PDFBOX-6103
Project: PDFBox
Issue Type: New Feature
Components: FontBox
Affects Versions: 3.0.6 PDFBox
Reporter: Fabrice Calafat
Currently, the PDFBox GSUB (Glyph Substitution) system does not handle the DFLT
(default) script tag defined in the OpenType specification. According to the
OpenType spec, the DFLT script table is used to
define features that are not script-specific and should be applied when:
1. No script table exists for the specific script of the text being processed
2. Text lacks a defined script (containing only symbols or punctuation)
* Impact:*
Fonts that rely on DFLT script features may not render correctly,
particularly when processing text containing symbols, punctuation, or
unsupported scripts.
*Solution:*
This patch adds a new GsubWorkerForDflt class that implements script-neutral
typographic features according to OpenType standards. The implementation:
- Creates a dedicated GSUB worker for handling DFLT script
- Integrates with the existing GsubWorkerFactory
- Applies common typographic features in the standard recommended order
- Follows OpenType specification guidelines for universal glyph substitutions
*Testing:*
Comprehensive unit tests have been added using real-world fonts
(JosefinSans-Italic.ttf and RobotoMono-Regular.ttf) to verify correct DFLT
script processing.
*Reference:*
https://learn.microsoft.com/en-us/typography/opentype/spec/chapter2#scriptlist-table
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]