Revert "load_masters: actually assign font attributes" (#1486)
* Revert "load_masters: actually assign font attributes" This reverts commit ef1d4cd02d1e46f5dac3914f547a6e4275cf3077, which caused a crash in `interpolate_layout()` when `deepcopy`ing OTFs. Amend code and tests while I work on a real fix.
This commit is contained in:
parent
b68596cc80
commit
1e746e34ee
@ -890,7 +890,7 @@ def load_masters(designspace, master_finder=lambda s: s):
|
|||||||
# 2. A SourceDescriptor's path might point an OpenType binary, a
|
# 2. A SourceDescriptor's path might point an OpenType binary, a
|
||||||
# TTX file, or another source file (e.g. UFO), in which case we
|
# TTX file, or another source file (e.g. UFO), in which case we
|
||||||
# resolve the path using 'master_finder' function
|
# resolve the path using 'master_finder' function
|
||||||
master.font = font = _open_font(master.path, master_finder)
|
font = _open_font(master.path, master_finder)
|
||||||
master_fonts.append(font)
|
master_fonts.append(font)
|
||||||
|
|
||||||
return master_fonts
|
return master_fonts
|
||||||
|
3
NEWS.rst
3
NEWS.rst
@ -1,3 +1,6 @@
|
|||||||
|
- [varLib] Temporarily revert the fix to ``load_masters()``, which caused a
|
||||||
|
crash in ``interpolate_layout()`` when ``deepcopy``-ing OTFs.
|
||||||
|
|
||||||
3.37.1 (released 2019-02-05)
|
3.37.1 (released 2019-02-05)
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
|
@ -366,11 +366,11 @@ class BuildTest(unittest.TestCase):
|
|||||||
|
|
||||||
ds_path = self.get_test_input("SparseMasters.designspace")
|
ds_path = self.get_test_input("SparseMasters.designspace")
|
||||||
ds = DesignSpaceDocument.fromfile(ds_path)
|
ds = DesignSpaceDocument.fromfile(ds_path)
|
||||||
load_masters(ds)
|
masters = load_masters(ds)
|
||||||
|
|
||||||
# Trigger MVAR generation so varLib is forced to create deltas with a
|
# Trigger MVAR generation so varLib is forced to create deltas with a
|
||||||
# sparse master inbetween.
|
# sparse master inbetween.
|
||||||
font_0_os2 = ds.sources[0].font["OS/2"]
|
font_0_os2 = masters[0]["OS/2"]
|
||||||
font_0_os2.sTypoAscender = 1
|
font_0_os2.sTypoAscender = 1
|
||||||
font_0_os2.sTypoDescender = 1
|
font_0_os2.sTypoDescender = 1
|
||||||
font_0_os2.sTypoLineGap = 1
|
font_0_os2.sTypoLineGap = 1
|
||||||
@ -395,16 +395,16 @@ class BuildTest(unittest.TestCase):
|
|||||||
font_0_vhea.caretSlopeRise = 1
|
font_0_vhea.caretSlopeRise = 1
|
||||||
font_0_vhea.caretSlopeRun = 1
|
font_0_vhea.caretSlopeRun = 1
|
||||||
font_0_vhea.caretOffset = 1
|
font_0_vhea.caretOffset = 1
|
||||||
ds.sources[0].font["vhea"] = font_0_vhea
|
masters[0]["vhea"] = font_0_vhea
|
||||||
font_0_hhea = ds.sources[0].font["hhea"]
|
font_0_hhea = masters[0]["hhea"]
|
||||||
font_0_hhea.caretSlopeRise = 1
|
font_0_hhea.caretSlopeRise = 1
|
||||||
font_0_hhea.caretSlopeRun = 1
|
font_0_hhea.caretSlopeRun = 1
|
||||||
font_0_hhea.caretOffset = 1
|
font_0_hhea.caretOffset = 1
|
||||||
font_0_post = ds.sources[0].font["post"]
|
font_0_post = masters[0]["post"]
|
||||||
font_0_post.underlineThickness = 1
|
font_0_post.underlineThickness = 1
|
||||||
font_0_post.underlinePosition = 1
|
font_0_post.underlinePosition = 1
|
||||||
|
|
||||||
font_2_os2 = ds.sources[2].font["OS/2"]
|
font_2_os2 = masters[2]["OS/2"]
|
||||||
font_2_os2.sTypoAscender = 800
|
font_2_os2.sTypoAscender = 800
|
||||||
font_2_os2.sTypoDescender = 800
|
font_2_os2.sTypoDescender = 800
|
||||||
font_2_os2.sTypoLineGap = 800
|
font_2_os2.sTypoLineGap = 800
|
||||||
@ -429,15 +429,18 @@ class BuildTest(unittest.TestCase):
|
|||||||
font_2_vhea.caretSlopeRise = 800
|
font_2_vhea.caretSlopeRise = 800
|
||||||
font_2_vhea.caretSlopeRun = 800
|
font_2_vhea.caretSlopeRun = 800
|
||||||
font_2_vhea.caretOffset = 800
|
font_2_vhea.caretOffset = 800
|
||||||
ds.sources[2].font["vhea"] = font_2_vhea
|
masters[2]["vhea"] = font_2_vhea
|
||||||
font_2_hhea = ds.sources[2].font["hhea"]
|
font_2_hhea = masters[2]["hhea"]
|
||||||
font_2_hhea.caretSlopeRise = 800
|
font_2_hhea.caretSlopeRise = 800
|
||||||
font_2_hhea.caretSlopeRun = 800
|
font_2_hhea.caretSlopeRun = 800
|
||||||
font_2_hhea.caretOffset = 800
|
font_2_hhea.caretOffset = 800
|
||||||
font_2_post = ds.sources[2].font["post"]
|
font_2_post = masters[2]["post"]
|
||||||
font_2_post.underlineThickness = 800
|
font_2_post.underlineThickness = 800
|
||||||
font_2_post.underlinePosition = 800
|
font_2_post.underlinePosition = 800
|
||||||
|
|
||||||
|
for m, s in zip(masters, ds.sources):
|
||||||
|
s.font = m
|
||||||
|
|
||||||
varfont, _, _ = build(ds)
|
varfont, _, _ = build(ds)
|
||||||
mvar_tags = [vr.ValueTag for vr in varfont["MVAR"].table.ValueRecord]
|
mvar_tags = [vr.ValueTag for vr in varfont["MVAR"].table.ValueRecord]
|
||||||
assert all(tag in mvar_tags for tag in fontTools.varLib.mvar.MVAR_ENTRIES)
|
assert all(tag in mvar_tags for tag in fontTools.varLib.mvar.MVAR_ENTRIES)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user