Skip to content

Commit

Permalink
font-patcher: Fix wrong argument for postprocess
Browse files Browse the repository at this point in the history
[why]
When the patched font does not have a fullname (which can never happen)
the postprocess is called with a wrong filename.

[note]
Also output the file name of the patched font, for easier access by the user.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
  • Loading branch information
Finii committed Aug 20, 2022
1 parent 8990712 commit 85324cc
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,17 @@ class font_patcher:

# the `PfEd-comments` flag is required for Fontforge to save '.comment' and '.fontlog'.
if self.sourceFont.fullname != None:
self.sourceFont.generate(self.args.outputdir + "/" + self.sourceFont.fullname + self.extension, flags=(str('opentype'), str('PfEd-comments')))
print("\nGenerated: {}".format(self.sourceFont.fontname))
outfile = self.args.outputdir + "/" + self.sourceFont.fullname + self.extension
self.sourceFont.generate(outfile, flags=(str('opentype'), str('PfEd-comments')))
print("\nGenerated: {} in {}".format(self.sourceFont.fontname, outfile))
else:
self.sourceFont.generate(self.args.outputdir + "/" + self.sourceFont.cidfontname + self.extension, flags=(str('opentype'), str('PfEd-comments')))
print("\nGenerated: {}".format(self.sourceFont.fullname))
outfile = self.sourceFont.generate(self.args.outputdir + "/" + self.sourceFont.cidfontname + self.extension
self.sourceFont.generate(outfile, flags=(str('opentype'), str('PfEd-comments')))
print("\nGenerated: {} in {}".format(self.sourceFont.fullname, outfile))

if self.args.postprocess:
subprocess.call([self.args.postprocess, self.args.outputdir + "/" + self.sourceFont.fullname + self.extension])
print("\nPost Processed: {}".format(self.sourceFont.fullname))
subprocess.call([self.args.postprocess, outfile])
print("\nPost Processed: {}".format(outfile))


def setup_arguments(self):
Expand Down

0 comments on commit 85324cc

Please sign in to comment.