summarylogtreecommitdiffstats
path: root/fix_font_name.py
blob: 3e0b3ef860f609507d78a79e225ba3a549101da7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/env python
# coding=utf8
# Fixes the 'fontname' property of the MonacoB2 font family
# so that Nerd Fonts patcher can generate all fonts correctly

import sys, re, fontforge

font = fontforge.open(sys.argv[1])

print(font.fontname)

if re.match(r"^MonacoB(?:-Bold)?$", font.fontname):
    font.fontname = font.fontname.replace("MonacoB", "MonacoB2")
    font.generate(sys.argv[1])