File tree Expand file tree Collapse file tree 2 files changed +542
-525
lines changed Expand file tree Collapse file tree 2 files changed +542
-525
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ def main():
1515
1616 data = get_build_data ()
1717
18+ rename_svg_glyph_names (data )
1819 generate_scss (data )
1920 generate_cheatsheet (data )
2021 generate_component_json (data )
@@ -28,6 +29,22 @@ def generate_font_files():
2829 call (cmd , shell = True )
2930
3031
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+
3148def generate_scss (data ):
3249 print "Generate SCSS"
3350 font_name = data ['name' ]
You can’t perform that action at this time.
0 commit comments