Repository navigation
Conversation
…is kept under dflt
OTFAdvancedTypographicTableReader.readScriptTable compared each LangSys record's offset
with the default LangSys offset and, when they were equal, dropped the default and made
that language the script's default tag:
if (dl == lo) { dl = 0; dt = lt; }
constructLookups then registered the features under (script, that language) only and
nothing under (script, "dflt"). Font builders share the table on purpose: FontForge writes
one LangSys table for the default and for every language whose feature list equals it. So
a request for the script's default language system found nothing and fell back to the DFLT
script, which lists whatever the font's author put there.
DejaVu Sans is the visible case. Its GPOS latn default is the table latn/ROM and the Sami
systems point at, listing kern lookups 14 and 15; DFLT/dflt lists lookup 15 alone, a
20-glyph subtable with no Latin letter. Measured on this branch, 14pt "AVATAR To Ye",
kerning on, line width from mutool draw -F stext:
no language language="ROM" language="en"
before 99.68 pt 91.55 pt 99.68 pt
after 91.55 pt 91.55 pt 99.68 pt
Before, the font kerned only when the language named the record that shares the table.
(language="en" is the separate FOP-3341: the FO language code is never translated to the
font's tag and the fallback skips the script's default.)
Its arab default is shared with KUR in GSUB and GPOS both, and DFLT lists no contextual
form and no mark lookup, so Arabic set in DejaVu Sans under a default language was drawn
as isolated letters. Of 1356 OpenType fonts installed on one
Linux machine, 252 share a default this way.
The default LangSys table is now read and registered under "dflt" whether or not a named
record points at the same table; a named language sharing it is still read under its own
tag. SharedDefaultLanguageSystemTestCase uses the DejaVuLGCSerif already in the test tree,
whose GPOS latn default is shared with AZE and whose GPOS has no DFLT script:
(latn, dflt, kern) must match and "AV" must kern. Its first case fails without the change.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Fixes FOP-3342.
OTFAdvancedTypographicTableReader.readScriptTable compared each LangSys record's offset
with the default LangSys offset and, when they were equal, dropped the default and made
that language the script's default tag:
constructLookups then registered the features under (script, that language) only and
nothing under (script, "dflt"). Font builders share the table on purpose: FontForge writes
one LangSys table for the default and for every language whose feature list equals it. So
a request for the script's default language system found nothing and fell back to the DFLT
script, which lists whatever the font's author put there.
DejaVu Sans is the visible case. Its GPOS latn default is the table latn/ROM and the Sami
systems point at, listing kern lookups 14 and 15; DFLT/dflt lists lookup 15 alone, a
20-glyph subtable with no Latin letter. Measured on this branch, 14pt "AVATAR To Ye",
kerning on, line width from mutool draw -F stext:
Before, the font kerned only when the language named the record that shares the table.
(language="en" is the separate FOP-3341: the FO language code is never translated to the
font's tag and the fallback skips the script's default.)
Its arab default is shared with KUR in GSUB and GPOS both, and DFLT lists no contextual
form and no mark lookup, so Arabic set in DejaVu Sans under a default language was drawn
as isolated letters. Of 1356 OpenType fonts installed on one
Linux machine, 252 share a default this way.
The default LangSys table is now read and registered under "dflt" whether or not a named
record points at the same table; a named language sharing it is still read under its own
tag. SharedDefaultLanguageSystemTestCase uses the DejaVuLGCSerif already in the test tree,
whose GPOS latn default is shared with AZE and whose GPOS has no DFLT script:
(latn, dflt, kern) must match and "AV" must kern. Its first case fails without the change.
🤖 Generated with Claude Code