1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2024-12-13 17:18:37 +02:00

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 <xsrvmy>
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2022-01-04 08:04:23 +01:00 committed by Fini
parent abf3016dcf
commit 263b1693c9

View File

@ -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 )]