font-patcher: Fix windows Mono family names with --makegroups

[why]
Without --makegroups the font family is "Name NFM", but with it enabled
we get "Name NF Mono".

[how]
Mimic the old short-naming also for the groups.

This feels a bit strange, why do we need to specify the names three
times for `inject_suffix()`, slightly different. At some point this
should probably be unified.

    def inject_suffix(self, fullname, fontname, family):
        """Add a custom additonal string that shows up in the resulting names"""

In principle Family + Subfamily -> Fullname -> Fontname
Somehow we rename not according to the default rules.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2022-12-22 14:50:35 +01:00
parent bb17fde9af
commit f240e073f0

View file

@ -629,7 +629,11 @@ class font_patcher:
font.appendSFNTName(str('English (US)'), str('SubFamily'), subFamily)
else:
fam_suffix = projectNameSingular if not self.args.windows else projectNameAbbreviation
fam_suffix += ' Mono' if self.args.single else ''
if self.args.single:
if self.args.windows:
fam_suffix += 'M'
else:
fam_suffix += ' Mono'
n.inject_suffix(verboseAdditionalFontNameSuffix, additionalFontNameSuffix, fam_suffix)
n.rename_font(font)