name-parser: Remove superfluous Regular from ID17

We do not need "Condensed Regular" as ID17, a simple "Condensed" is
enough.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
Fini Jastrow 2024-04-03 14:29:26 +02:00 committed by Fini
parent 8b69828c97
commit 7d3c59b072

View file

@ -206,6 +206,8 @@ class FontnameParser:
"""Get the SFNT Preferred Styles (ID 17)"""
styles = self.style_token
weights = self.weight_token
if 'Regular' in styles and len(styles) + len(weights) > 1:
styles.remove('Regular')
# For naming purposes we want Oblique to be part of the styles
(weights, styles) = FontnameTools.make_oblique_style(weights, styles)
pfs = FontnameTools.concat(weights, styles)