Only include a format 4 cmap subtable when there are BMP codepoints #899
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.
Seeking thoughts on the below - a reasonable path to fewer diffs with fontc, or too dramatic a change given what shipped software might rely on, and we should change the the Rusty behaviour instead? As seen in the snapshots, this would mean we would ship TTFs with zero subtables for the first time.
This produces minutely smaller fonts when there are no characters represented inside of the Unicode BMP (U+0000 to U+FFFF), and matches fontations' current behaviour.
The OpenType specification state that a format 4 subtable is not mandatory, but that it may be included for backwards compatibility for legacy environments that do not support format 12. As in our case there are no overlapping codepoints, this suggests that we can drop the format 4 subtable entirely (at least, unless there has been software developed since that unconditionally assumes its existence).
Extra Notes
(!) On a re-read, in both fontations and ufo2ft we are not following the separate recommendation to include all BMP codepoints in the format 12 table too; this does not seem to have caused problems though.(ignore this, we explicitly extend the mapping to include)cmap
entirely, as it is a required table.Note: this is a personal contribution independent of my employer, and so I've submitted from a fork under my personal profile and email to make this distinction