font-patcher: Fix incomplete separation of naming and patching

[why]
The font_patcher object should be self contained, and code outside of it
should not depend on stuff done within it that does not have to do
anything with patching.
In fact the code should run even if font_patcher.patch() has not been
called.

[how]
Pull name backup out of the patching process.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2023-06-04 09:59:11 +02:00 committed by Fini
parent 0e77d86ff9
commit 3ecf7f1ef8

View file

@ -334,7 +334,6 @@ class font_patcher:
self.sourceFont = font
self.setup_version()
self.get_essential_references()
self.setup_name_backup(font)
self.assert_monospace()
self.remove_ligatures()
self.get_sourcefont_dimensions()
@ -2007,6 +2006,7 @@ def main():
subfont)
sys.exit(1)
patcher.setup_name_backup(sourceFonts[-1])
patcher.patch(sourceFonts[-1])
print("Done with Patch Sets, generating font...")