-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port fontc' propagate_anchors.rs to .py, apply as preflight transform…
… on GSFont Fixes #368 Translate fontc' propagate_anchors.rs from Rust to Python and apply to the GSFont in the 'preflight' step before it's passed on to UFOBuilder The Rust code was based off the original Glyphs.app's Objective-C code (Georg shared a snippet with us privately) and is as such more 'correct' then the old, reverse-engineered implementation. The old glyphsLib.builder.anchor_propagation module is deprecated but kept around in case users may instantiate the UFOBuilder class directly with propagate_anchors=True. Also, the existing `propagate_anchors` parameters of `to_designspace`, `to_ufos` and other high-level methods continues to have an equivalent effect but now controls the **new** propagate anchors logic. Clients such as fontmake do not need to do anything besides upgrading glyphsLib to use this.
1 parent
cedaacd
commit 9cabd52
Showing
8 changed files
with
527 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,20 @@ | ||
TRANSFORMATIONS = [] | ||
from types import MappingProxyType | ||
from typing import NamedTuple | ||
|
||
from .propagate_anchors import propagate_all_anchors | ||
|
||
TRANSFORMATIONS = [ | ||
propagate_all_anchors, | ||
] | ||
|
||
|
||
class _CustomParameter(NamedTuple): | ||
name: str | ||
default: bool | ||
|
||
|
||
TRANSFORMATION_CUSTOM_PARAMS = MappingProxyType( | ||
{ | ||
propagate_all_anchors: _CustomParameter("Propagate Anchors", True), | ||
} | ||
) |
426 changes: 426 additions & 0 deletions
426
Lib/glyphsLib/builder/transformations/propagate_anchors.py
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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