File tree 2 files changed +542
-525
lines changed
2 files changed +542
-525
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ def main():
15
15
16
16
data = get_build_data ()
17
17
18
+ rename_svg_glyph_names (data )
18
19
generate_scss (data )
19
20
generate_cheatsheet (data )
20
21
generate_component_json (data )
@@ -28,6 +29,22 @@ def generate_font_files():
28
29
call (cmd , shell = True )
29
30
30
31
32
+ def rename_svg_glyph_names (data ):
33
+ # hacky and slow (but safe) way to rename glyph-name attributes
34
+ svg_path = os .path .join (FONTS_FOLDER_PATH , 'ionicons.svg' )
35
+ svg_file = open (svg_path , 'r+' )
36
+ svg_text = svg_file .read ()
37
+ svg_file .seek (0 )
38
+
39
+ for ionicon in data ['icons' ]:
40
+ # uniF2CA
41
+ org_name = 'uni%s' % (ionicon ['code' ].replace ('0x' , '' ).upper ())
42
+ svg_text = svg_text .replace (org_name , ionicon ['name' ])
43
+
44
+ svg_file .write (svg_text )
45
+ svg_file .close ()
46
+
47
+
31
48
def generate_scss (data ):
32
49
print "Generate SCSS"
33
50
font_name = data ['name' ]
You can’t perform that action at this time.
0 commit comments