@@ -393,8 +393,12 @@ def parse_font_name(name):
393
393
# Weights end up as Typographic Family parts ('after the dash')
394
394
# Styles end up as Family parts (for classic grouping of four)
395
395
# Others also end up in Typographic Family ('before the dash')
396
+ widths = [ m + s
397
+ for s in list (FontnameTools .known_widths )
398
+ for m in list (FontnameTools .known_modifiers ) + ['' ]
399
+ ]
396
400
weights = [ m + s
397
- for s in list (FontnameTools .known_weights2 ) + list ( FontnameTools . known_widths )
401
+ for s in list (FontnameTools .known_weights2 )
398
402
for m in list (FontnameTools .known_modifiers ) + ['' ] if m != s
399
403
] + list (FontnameTools .known_weights1 ) + list (FontnameTools .known_slopes )
400
404
weights = [ w for w in weights if w not in FontnameTools .known_styles ]
@@ -408,9 +412,11 @@ def parse_font_name(name):
408
412
r'(?:uni-)?1[14]' , # GohuFont uni
409
413
]
410
414
415
+ ( style , width_token ) = FontnameTools .get_name_token (style , widths )
411
416
( style , weight_token ) = FontnameTools .get_name_token (style , weights )
412
417
( style , style_token ) = FontnameTools .get_name_token (style , FontnameTools .known_styles )
413
418
( style , other_token ) = FontnameTools .get_name_token (style , other )
419
+ weight_token = width_token + weight_token
414
420
while 'Regular' in style_token and len (style_token ) > 1 :
415
421
# Correct situation where "Regular" and something else is given
416
422
style_token .remove ('Regular' )
0 commit comments