8000 [VARC] Update to reinterpretation of RESET_UNSPECIFIED_AXES by behdad · Pull Request #3541 · fonttools/fonttools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[VARC] Update to reinterpretation of RESET_UNSPECIFIED_AXES #3541

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions Lib/fontTools/ttLib/ttGlyphSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,7 @@ class _TTGlyphSet(Mapping):
def __init__(self, font, location, glyphsMapping, *, recalcBounds=True):
self.recalcBounds = recalcBounds
self.font = font
self.defaultLocationNormalized = (
{axis.axisTag: 0 for axis in self.font["fvar"].axes}
if "fvar" in self.font
else {}
)
self.location = location if location is not None else {}
self.rawLocation = {} # VarComponent-only location
self.originalLocation = location if location is not None else {}
self.depth = 0
self.locationStack = []
Expand All @@ -53,21 +47,16 @@ def __init__(self, font, location, glyphsMapping, *, recalcBounds=True):
@contextmanager
def pushLocation(self, location, reset: bool):
self.locationStack.append(self.location)
self.rawLocationStack.append(self.rawLocation)
if reset:
self.location = self.originalLocation.copy()
self.rawLocation = self.defaultLocationNormalized.copy()
else:
self.location = self.location.copy()
self.rawLocation = {}
self.location.update(location)
self.rawLocation.update(location)

try:
yield None
finally:
self.location = self.locationStack.pop()
self.rawLocation = self.rawLocationStack.pop()

@contextmanager
def pushDepth(self):
Expand Down Expand Up @@ -371,7 +360,7 @@ def _draw(self, pen, isPointPen):
if not shouldDecompose:
try:
pen.addVarComponent(
comp.glyphName, transform, self.glyphSet.rawLocation
comp.glyphName, transform, self.glyphSet.location
)
except AttributeError:
shouldDecompose = True
Expand Down
Loading
0