[
https://issues.apache.org/jira/browse/PDFBOX-6103?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18040369#comment-18040369
]
Tilman Hausherr commented on PDFBOX-6103:
-----------------------------------------
Yes we can do that.
Because I'm somewhat paranoid, I downloaded the fonts from google and they are
both different (where did you get yours?). So I looked at all of then and the
test with the Roboto font should work (maybe with changing the numbers), but
the Josefin font might not, because the version from the google download also
has "latn" and this would come first. There is a comment in GsubWorkerFactory
about that (only the first two lines are in the repository):
{code:java}
//TODO this needs to be redesigned / improved because if a font supports
several languages,
// it will choose one of them and maybe not the one expected.
// See also PDFBOX-5700 and PDFBOX-5729
// For example, NotoSans-Regular hits Devanagari first
// See also GlyphSubstitutionDataExtractor.getSupportedLanguage() which decides
the language?!
{code}
> 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
> Priority: Minor
>
> 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
> *Pull request*
> https://github.com/apache/pdfbox/pull/351
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]