mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2025-01-06 21:49:40 +02:00
name-parser: Fix Oblique handling
[why]
Oblique is not detected correctly anymore.
[how]
With commit
ae656bad8
name-parser: Further formalize style handling
'Oblique' has been taken out of the direct 'known_names' which has been
replaced by a more detailed list of known name parts. It ended up in
known_slopes.
But known_sloped is not taken into consideration as 'weight' when parsing
the font name - no it ends up in 'rest'.
This has been obviously overlooked.
Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This commit is contained in:
parent
fd416d480d
commit
f603633536
@ -47,8 +47,7 @@ class FontnameParser:
|
||||
if not self.use_short_families[0]:
|
||||
return (self.basename, self.rest)
|
||||
else:
|
||||
rest = self.rest.replace('Oblique', 'Obl')
|
||||
return (FontnameTools.concat(self.basename, rest).replace(' ', ''), '')
|
||||
return (FontnameTools.concat(self.basename, self.rest).replace(' ', ''), '')
|
||||
|
||||
def set_keep_regular_in_family(self, keep):
|
||||
"""Familyname may contain 'Regular' where it should normally be suppressed"""
|
||||
@ -195,6 +194,7 @@ class FontnameParser:
|
||||
aggressive = self.use_short_families[2]
|
||||
if self.use_short_families[1]:
|
||||
[ other, weight ] = FontnameTools.short_styles([ other, weight ], aggressive)
|
||||
weight = [ w if w != 'Oblique' else 'Obl' for w in weight ]
|
||||
return FontnameTools.concat(name, rest, other, self.short_family_suff, weight)
|
||||
|
||||
def subfamily(self):
|
||||
|
@ -338,7 +338,7 @@ class FontnameTools:
|
||||
weights = [ m + s
|
||||
for s in list(FontnameTools.known_weights2) + list(FontnameTools.known_widths)
|
||||
for m in list(FontnameTools.known_modifiers) + [''] if m != s
|
||||
] + list(FontnameTools.known_weights1)
|
||||
] + list(FontnameTools.known_weights1) + list(FontnameTools.known_slopes)
|
||||
styles = [ 'Bold', 'Italic', 'Regular', 'Normal', ]
|
||||
weights = [ w for w in weights if w not in styles ]
|
||||
# Some font specialities:
|
||||
|
Loading…
Reference in New Issue
Block a user