From ad2bd608c88b166bc483982fd8dba3e3ea1b0b30 Mon Sep 17 00:00:00 2001 From: Ryan L McIntyre Date: Sat, 29 Jul 2017 21:41:42 -0400 Subject: [PATCH] Deouples changelog.md being required in patcher - simplifies dependency - simplifies fontlog and comments in the actual font - adds links to website, project, and changelog --- font-patcher | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/font-patcher b/font-patcher index 5a80e175b..4f946a298 100755 --- a/font-patcher +++ b/font-patcher @@ -63,7 +63,6 @@ parser.add_argument('-out', '--outputdir', type=str, nargs='?', dest='outputdir' args = parser.parse_args() __dir__ = os.path.dirname(__file__) -changelog = open(__dir__ + "/changelog.md", "r") minimumVersion = 20141231 actualVersion = int(fontforge.version()) # un-comment following line for testing invalid version error handling @@ -170,6 +169,7 @@ if args.windows: familyname = familyname[:maxFamilyLength] else: familyname += " " + projectNameSingular + if args.single: familyname += " Mono" @@ -212,7 +212,15 @@ reservedFontNameReplacements = { 'Terminus': 'Terminess' } -projectInfo = "Patched with '" + projectName + " Patcher' (https://github.com/ryanoasis/nerd-fonts)" +# remove overly verbose font names +# particularly regarding Powerline sourced Fonts (https://github.com/powerline/fonts) +additionalFontNameReplacements = { + 'for Powerline' : '', + 'Powerline' : '' +} + +projectInfo = "Patched with '" + projectName + " Patcher' (https://github.com/ryanoasis/nerd-fonts)\n\n* Website: https://www.nerdfonts.com\n* Version: " + version + "\n + * Development Website: https://github.com/ryanoasis/nerd-fonts\n* Changelog: https://github.com/ryanoasis/nerd-fonts/blob/master/changelog.md" sourceFont.familyname = replace_all(familyname, reservedFontNameReplacements) sourceFont.fullname = replace_all(fullname, reservedFontNameReplacements) @@ -221,7 +229,7 @@ sourceFont.appendSFNTName(str('English (US)'), str('Preferred Family'), sourceFo sourceFont.appendSFNTName(str('English (US)'), str('Compatible Full'), sourceFont.fullname) sourceFont.appendSFNTName(str('English (US)'), str('SubFamily'), subFamily) sourceFont.comment = projectInfo -sourceFont.fontlog = projectInfo + "\n\n" + changelog.read() +sourceFont.fontlog = projectInfo # todo version not being set for all font types (e.g. ttf) #print("Version was {}".format(sourceFont.version))