Skip to content

Commit 2257444

Browse files
committed
fix sources with layernames bug
1 parent 845e2ec commit 2257444

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

  • source/lib/batchGenerators/variableFontsGenerator

source/lib/batchGenerators/variableFontsGenerator/__init__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@
1515

1616
from ufo2fdk.kernFeatureWriter import side1Prefix, side2Prefix
1717

18-
from batchGenerators.batchTools import postProcessCollector, WOFF2Builder, buildTree, removeTree, BatchEditorOperator
18+
from batchGenerators.batchTools import postProcessCollector, WOFF2Builder, buildTree, removeTree, BatchEditorOperator, Report
1919

2020

2121
class GenerateVariableFont:
2222

2323
def __init__(self, operator, destinationPath, autohint=False, fitToExtremes=False, releaseMode=True, glyphOrder=None, report=None, debug=False):
2424
# this must be an operator with no discrete axes.
2525
# split the designspace first first
26+
if report is None:
27+
report = Report()
2628
self.operator = operator
2729
self.destinationPath = destinationPath
2830
self.binaryFormat = os.path.splitext(self.destinationPath)[-1][1:].lower()
@@ -293,19 +295,20 @@ def makeLayerMaster(self):
293295
if sourceDescriptor.layerName is not None:
294296
layerName = sourceDescriptor.layerName
295297

296-
path, ext = os.path.splitext(sourceDescriptor.path)
298+
layeredUFOPath = sourceDescriptor.path
299+
300+
path, ext = os.path.splitext(layeredUFOPath)
297301

298302
sourceDescriptor.path = os.path.join(os.path.dirname(self.destinationPath), f"{path}-{layerName}{ext}")
299303
sourceDescriptor.styleName = f"{sourceDescriptor.styleName} {layerName}"
300304
sourceDescriptor.filename = None
301305
sourceDescriptor.layerName = None
302306

303-
layeredSource = self.operator._instantiateFont(sourceDescriptor.path)
307+
layeredSource = self.operator._instantiateFont(layeredUFOPath)
304308
layeredSource.layers.defaultLayer = layeredSource.layers[layerName]
305309
layeredSource.save(sourceDescriptor.path)
306310

307311
self.operator.fonts[sourceDescriptor.name] = layeredSource
308-
309312
self.generatedFiles.add(sourceDescriptor.path)
310313

311314
def generate(self):

0 commit comments

Comments
 (0)