Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions generateHeader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@

icoMoonFile = open("IcomoonIcons.h", "w")

icoMoonFile.write( "//\n" +
"// IcomoonIcons.h\n" +
icoMoonFile.write( "//\n" +
"// IcomoonIcons.h\n" +
"//\n" +
"// Generated from icomoon.dev.svg.\n" +
"//\n\n\n" +
"#ifndef Icomoon_Icons_h\n" +
"#define Icomoon_Icons_h\n\n\n")

doc = minidom.parse('icomoon.dev.svg') # parseString also exists
doc = minidom.parse('icomoon.svg') # parseString also exists

# name each unicode character using its first tag...
path_strings = [
[
path.getAttribute('unicode'),
path.getAttribute('data-tags')
path_strings = [
[
path.getAttribute('unicode'),
path.getAttribute('glyph-name')
.split(", ")[0]
.encode('ascii', 'ignore')
.upper()
.replace("-", "_")
]
]
for path in doc.getElementsByTagName('glyph')
]

Expand All @@ -46,4 +46,4 @@
doc.unlink()

icoMoonFile.write("\n\n#endif");
icoMoonFile.close();
icoMoonFile.close();