1
0
mirror of https://github.com/ryanoasis/nerd-fonts.git synced 2025-01-25 03:32:02 +02:00

Fix regular expression for font style splitting

Modify regular expression grouping instead of stripping dash from font style string
This commit is contained in:
Jamie Rolfs 2016-03-12 15:46:33 -08:00
parent 7dc096e8b9
commit 7cbc79b9ce

View File

@ -83,9 +83,7 @@ if args.single:
sourceFont = fontforge.open(args.font)
fontname, style = re.match("^([^-]*)(?:(-.*))?$", sourceFont.fontname).groups()
style = style.replace("-", "")
fontname, style = re.match("^([^-]*)(?:-(.*))?$", sourceFont.fontname).groups()
familyname = sourceFont.familyname.replace(style, "").rstrip()
# fullname (filename) can always use long/verbose font name, even in windows
fullname = sourceFont.fullname + verboseAdditionalFontNameSuffix