55To update _ FontAwesome_ icons, one must:
66
77- check what is the latest released version here: https://github.com/FortAwesome/Font-Awesome/releases/
8+ - update font version in \_\_ init__ .py
9+ - remove outdated files in the fonts dir
810- run: ` python setup.py update_fa5 --fa-version X.X.X `
911- update FA version number, icon counts and URLs inside:
1012 - README.md
@@ -55,18 +57,29 @@ import json
5557import urllib.request
5658import hashlib
5759
60+
61+ VERSION = ' 6.9.96' # Update version as required
5862TTF_URL = ' https://raw.githubusercontent.com/Templarian/MaterialDesign-Webfont/master/fonts/materialdesignicons-webfont.ttf'
5963CSS_URL = ' https://raw.githubusercontent.com/Templarian/MaterialDesign-Webfont/master/css/materialdesignicons.css'
64+ FONT_FILENAME = " materialdesignicons6-webfont-{version} .ttf" .format(
65+ version = VERSION
66+ )
67+ FONT_CHARMAP_FILENAME = (
68+ " materialdesignicons6-webfont-charmap-{version} .json" .format(
69+ version = VERSION
70+ )
71+ )
72+
6073
61- with open (' materialdesignicons6-webfont.ttf ' , ' wb' ) as fp:
74+ with open (FONT_FILENAME , ' wb' ) as fp:
6275 req = urllib.request.urlopen(TTF_URL )
6376 if req.status != 200 :
6477 raise Exception (' Failed to download TTF' )
6578 fp.write(req.read())
6679 req.close()
6780
6881hasher = hashlib.md5()
69- with open (' materialdesignicons6-webfont.ttf ' , ' rb' ) as f:
82+ with open (FONT_FILENAME , ' rb' ) as f:
7083 content = f.read()
7184 hasher.update(content)
7285
@@ -89,7 +102,7 @@ for name, key in data:
89102 name = name.lower()
90103 charmap[name] = key
91104
92- with open (' materialdesignicons6-webfont-charmap.json ' , ' w' ) as fp:
105+ with open (FONT_CHARMAP_FILENAME , ' w' ) as fp:
93106 json.dump(charmap, fp, indent = 4 , sort_keys = True )
94107
95108```
@@ -112,18 +125,23 @@ import json
112125import urllib.request
113126import hashlib
114127
128+ VERSION = ' 1.3.0' # Update version as required
115129TTF_URL = ' https://raw.githubusercontent.com/phosphor-icons/phosphor-icons/master/src/font/phosphor.ttf'
116130CSS_URL = ' https://raw.githubusercontent.com/phosphor-icons/phosphor-icons/master/src/css/phosphor.css'
131+ FONT_FILENAME = ' phosphor-{version} .ttf' .format(version = VERSION )
132+ FONT_CHARMAP_FILENAME = " phosphor-charmap-{version} .json" .format(
133+ version = VERSION
134+ )
117135
118- with open (' phosphor.ttf ' , ' wb' ) as fp:
136+ with open (FONT_FILENAME , ' wb' ) as fp:
119137 req = urllib.request.urlopen(TTF_URL )
120138 if req.status != 200 :
121139 raise Exception (' Failed to download TTF' )
122140 fp.write(req.read())
123141 req.close()
124142
125143hasher = hashlib.md5()
126- with open (' phosphor.ttf ' , ' rb' ) as f:
144+ with open (FONT_FILENAME , ' rb' ) as f:
127145 content = f.read()
128146 hasher.update(content)
129147
@@ -145,7 +163,7 @@ for name, key in data:
145163 name = name.lower()
146164 charmap[name] = key
147165
148- with open (' phosphor-charmap.json ' , ' w' ) as fp:
166+ with open (FONT_CHARMAP_FILENAME , ' w' ) as fp:
149167 json.dump(charmap, fp, indent = 4 , sort_keys = True )
150168
151169```
@@ -168,18 +186,23 @@ import json
168186import urllib.request
169187import hashlib
170188
189+ VERSION = ' 2.5.0' # Update version as required
171190TTF_URL = ' https://raw.githubusercontent.com/Remix-Design/RemixIcon/master/fonts/remixicon.ttf'
172191CSS_URL = ' https://raw.githubusercontent.com/Remix-Design/RemixIcon/master/fonts/remixicon.css'
192+ FONT_FILENAME = ' remixicon-{version} .ttf' .format(version = VERSION )
193+ FONT_CHARMAP_FILENAME = " remixicon-charmap-{version} .json" .format(
194+ version = VERSION
195+ )
173196
174- with open (' remixicon.ttf ' , ' wb' ) as fp:
197+ with open (FONT_FILENAME , ' wb' ) as fp:
175198 req = urllib.request.urlopen(TTF_URL )
176199 if req.status != 200 :
177200 raise Exception (' Failed to download TTF' )
178201 fp.write(req.read())
179202 req.close()
180203
181204hasher = hashlib.md5()
182- with open (' remixicon.ttf ' , ' rb' ) as f:
205+ with open (FONT_FILENAME , ' rb' ) as f:
183206 content = f.read()
184207 hasher.update(content)
185208
@@ -201,7 +224,7 @@ for name, key in data:
201224 name = name.lower()
202225 charmap[name] = key
203226
204- with open (' remixicon-charmap.json ' , ' w' ) as fp:
227+ with open (FONT_CHARMAP_FILENAME , ' w' ) as fp:
205228 json.dump(charmap, fp, indent = 4 , sort_keys = True )
206229
207230```
@@ -211,6 +234,8 @@ with open('remixicon-charmap.json', 'w') as fp:
211234To update _ Codicons_ icons, one must:
212235
213236- check what is the latest released version here: https://github.com/microsoft/vscode-codicons/releases
237+ - update font version in \_\_ init__ .py
238+ - remove outdated files in the fonts dir
214239- run: ` python setup.py update_msc `
215240- update Codicons version number, icon counts and URLs inside:
216241 - README.md
0 commit comments