From 263b1693c942908e90aaf116df30aa25fd6f8170 Mon Sep 17 00:00:00 2001 From: Fini Jastrow Date: Tue, 4 Jan 2022 08:04:23 +0100 Subject: [PATCH] font-patcher: Remove WWS names [why] Under certain circumstances the WWS names (Family and Subfamily) are used to identify a font. We do not touch these SFNT table entries, so when the font is renamed these are wrong (have the original name). Font-grouping will go wrong then. [how] The typographic ('Preferred') Family and Styles are set correctly already and they follow the WWS pattern, so the WWS fields can be (and should) be empty. They exist to allow font grouping in the case where the typographic names do not follow that pattern. Remove preexisting WWS entries (because they are not needed anymore, otherwise we would need to write the corrected new names there). We already set the WWS bit in fsSelection that is needed: def fs_selection(self, fs): """Modify a given fsSelection value for current name, bits 0, 5, 6, 8, 9 touched""" [...] b |= WWS # We assert this by our naming process return b Unfortunately we have no way (jet) to set fsSelection. This is only the case for Iosevka for all fonts in src/unpatched-fonts. Reported-by: Rui Ming (Max) Xiong Signed-off-by: Fini Jastrow --- bin/scripts/name_parser/FontnameParser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/scripts/name_parser/FontnameParser.py b/bin/scripts/name_parser/FontnameParser.py index 0119ccf10..804d0916d 100644 --- a/bin/scripts/name_parser/FontnameParser.py +++ b/bin/scripts/name_parser/FontnameParser.py @@ -285,7 +285,8 @@ class FontnameParser: # shown if you query the sfnt_names *rolleyes* sfnt_list = [] - TO_DEL = ['Family', 'SubFamily', 'Fullname', 'Postscriptname', 'Preferred Family', 'Preferred Styles', 'Compatible Full'] + TO_DEL = ['Family', 'SubFamily', 'Fullname', 'Postscriptname', 'Preferred Family', + 'Preferred Styles', 'Compatible Full', 'WWS Family', 'WWS Subfamily'] for l, k, v in list(font.sfnt_names): if not k in TO_DEL: sfnt_list += [( l, k, v )]