font-patcher: Fix wrong data source

[why]
For tweaking we use the self.sourceFont, but in the loop the real
correct value is the local sourceFont. Usually it's the same, but from a
logical standpoint this is wrong.

The name is a bit unfortunate and C++ would have generated a warning.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2023-06-04 10:02:24 +02:00 committed by Fini
parent 3ecf7f1ef8
commit 7a31c67670

View file

@ -433,14 +433,14 @@ class font_patcher:
sanitize_filename(self.args.outputdir, True),
sanitize_filename(fontname) + self.args.extension))
bitmaps = str()
if len(self.sourceFont.bitmapSizes):
logger.debug("Preserving bitmaps %s", repr(self.sourceFont.bitmapSizes))
if len(sourceFont.bitmapSizes):
logger.debug("Preserving bitmaps %s", repr(sourceFont.bitmapSizes))
bitmaps = str('otf') # otf/ttf, both is bf_ttf
if self.args.dry_run:
logger.debug("=====> Filename '%s'", outfile)
return
sourceFont.generate(outfile, bitmap_type=bitmaps, flags=gen_flags)
message = " {}\n \===> '{}'".format(self.sourceFont.fullname, outfile)
message = " {}\n \===> '{}'".format(sourceFont.fullname, outfile)
# Adjust flags that can not be changed via fontforge
if re.search('\\.[ot]tf$', self.args.font, re.IGNORECASE) and re.search('\\.[ot]tf$', outfile, re.IGNORECASE):