mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-09-19 09:51:48 +02:00
Deouples changelog.md being required in patcher
- simplifies dependency - simplifies fontlog and comments in the actual font - adds links to website, project, and changelog
This commit is contained in:
parent
57e76e5ca5
commit
ad2bd608c8
1 changed files with 11 additions and 3 deletions
14
font-patcher
14
font-patcher
|
@ -63,7 +63,6 @@ parser.add_argument('-out', '--outputdir', type=str, nargs='?', dest='outputdir'
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
__dir__ = os.path.dirname(__file__)
|
__dir__ = os.path.dirname(__file__)
|
||||||
changelog = open(__dir__ + "/changelog.md", "r")
|
|
||||||
minimumVersion = 20141231
|
minimumVersion = 20141231
|
||||||
actualVersion = int(fontforge.version())
|
actualVersion = int(fontforge.version())
|
||||||
# un-comment following line for testing invalid version error handling
|
# un-comment following line for testing invalid version error handling
|
||||||
|
@ -170,6 +169,7 @@ if args.windows:
|
||||||
familyname = familyname[:maxFamilyLength]
|
familyname = familyname[:maxFamilyLength]
|
||||||
else:
|
else:
|
||||||
familyname += " " + projectNameSingular
|
familyname += " " + projectNameSingular
|
||||||
|
|
||||||
if args.single:
|
if args.single:
|
||||||
familyname += " Mono"
|
familyname += " Mono"
|
||||||
|
|
||||||
|
@ -212,7 +212,15 @@ reservedFontNameReplacements = {
|
||||||
'Terminus': 'Terminess'
|
'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.familyname = replace_all(familyname, reservedFontNameReplacements)
|
||||||
sourceFont.fullname = replace_all(fullname, 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('Compatible Full'), sourceFont.fullname)
|
||||||
sourceFont.appendSFNTName(str('English (US)'), str('SubFamily'), subFamily)
|
sourceFont.appendSFNTName(str('English (US)'), str('SubFamily'), subFamily)
|
||||||
sourceFont.comment = projectInfo
|
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)
|
# todo version not being set for all font types (e.g. ttf)
|
||||||
#print("Version was {}".format(sourceFont.version))
|
#print("Version was {}".format(sourceFont.version))
|
||||||
|
|
Loading…
Reference in a new issue