Repository navigation
Fix false positive in googlefonts/colorfont_tables for variable fonts with non-varying SVG glyphs - #5060
Open
Sanjays2402 wants to merge 1 commit into
Open
Fix false positive in googlefonts/colorfont_tables for variable fonts with non-varying SVG glyphs#5060Sanjays2402 wants to merge 1 commit into
Sanjays2402 wants to merge 1 commit into
Conversation
… whose SVG color glyphs do not vary (issue fonttools#4946)
This branch has not been deployed
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.
Description
Fixes #4946.
The
googlefonts/colorfont_tablescheck unconditionally emitted avariable-svgFAIL for every variable font containing an SVG table, on thegrounds that SVG does not support OpenType Variations. But not every glyph
in a variable font varies: a variable font whose SVG color glyphs have no
variation data renders identically at every point in the design space, so
flagging it is a false positive (e.g. aliftype/raqq v2.00).
The check now inspects the SVG table's document list and only emits
variable-svgwhen at least one of the covered color glyphs actually hasvariation data — in
gvar, or viablendoperators inCFF2charstrings(including called subroutines). Fonts with a degenerate/empty SVG table
keep the previous conservative behavior. The check rationale was updated
to describe this.
Test evidence
before the fix it got
FAIL variable-svg; after the fix it no longerdoes (45 SVG color glyphs, none with variation data).
tests/test_checks_googlefonts_colorfont_tables.py:gvarvariation data now PASSes;
gvarvariationdata still FAILs with
variable-svg;source-sans-pro/VAR/SourceSansVariable-Italic.otf:SVG covering
space(noblendops) does not FAIL, SVG coveringA(has
blendops) FAILs withvariable-svg.pytest tests/test_checks_googlefonts_colorfont_tables.py: 2 passed.black --checkclean on both changed files;pylintclean on the check module.CHANGELOG.md.