Visitar URL original
Support the Remove Features instance parameter by lehni · Pull Request #1216 · googlefonts/glyphsLib · GitHub
Skip to content

Support the Remove Features instance parameter - #1216

Merged
anthrotype merged 1 commit into
googlefonts:mainfrom
lehni:remove-features
Oct 31, 2026
Merged

anthrotype merged 1 commit into
googlefonts:mainfrom
lehni:remove-features

Conversation

@lehni

@lehni lehni commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

An instance's "Remove Features" parameter (a list of feature tags) is not applied today. This removes those features' blocks from the instance's feature code, along with their feature xxxx; references in other features such as aalt, following the existing "Replace Feature" handler.

Glyphs that only the removed features reach are left in the font; dropping them is left to the subsetter.

@google-cla

google-cla Bot commented Oct 28, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@anthrotype anthrotype left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

One minor gap which we may (or not?) wish to handle here as well: the features that ufo2ft's feature writers generate are not yet in the feature text by the time this runs, so with Remove Features = ["kern"] and some kerning, the instance still comes out with a kern feature, whereas a native Glyphs 3.5 export has none. I'd expect the same for the other generated features (mark, mkmk, curs, dist).

Maybe the handler could also restrict the feature writers in the instance UFO's lib. Each writer takes a features option, so e.g. {"class": "KernFeatureWriter", "options": {"features": ["dist"]}} drops kern (I tried that). A writer left with no features would have to be removed from the list, since ufo2ft rejects an empty one.

Glyphs also applies "Remove Features" to variable font exports, while here it's lost just as "Replace Feature" already is (fine to leave that for later).

@lehni

lehni commented Oct 30, 2026

Copy link
Copy Markdown
Contributor Author

Done! The handler now also restricts the feature writers in the UFO lib (falling back to the default writers), dropping any writer left without features. Added a test that runs the writers and checks no kern is generated. Variable fonts left for later, as with "Replace Feature".

@anthrotype
anthrotype merged commit 05d0a18 into googlefonts:main Oct 31, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants