Preserve style suffixes by inserting ForPowerline before any '-'s
This commit is contained in:
parent
bee1467484
commit
38e2368682
|
@ -3,6 +3,7 @@
|
|||
|
||||
import argparse
|
||||
import sys
|
||||
import re
|
||||
import os.path
|
||||
|
||||
try:
|
||||
|
@ -41,7 +42,10 @@ class FontPatcher(object):
|
|||
if self.rename_font:
|
||||
target_font.familyname += ' for Powerline'
|
||||
target_font.fullname += ' for Powerline'
|
||||
target_font.fontname += 'ForPowerline'
|
||||
fontname, style = re.match("^([^-]*)(?:(-.*))?$", target_font.fontname).groups()
|
||||
target_font.fontname = fontname + 'ForPowerline'
|
||||
if style is not None:
|
||||
target_font.fontname += style
|
||||
target_font.appendSFNTName('English (US)', 'Preferred Family', target_font.familyname)
|
||||
target_font.appendSFNTName('English (US)', 'Compatible Full', target_font.fullname)
|
||||
|
||||
|
|
Loading…
Reference in New Issue