From c672cc56e5a31cc5e55f4b5f798a091e2ff96b8d Mon Sep 17 00:00:00 2001 From: Glen de Vries Date: Fri, 5 Aug 2016 17:32:22 +0000 Subject: [PATCH] Updated to work with latest IcoMoon SVG files --- generateHeader.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/generateHeader.py b/generateHeader.py index d60530c..b64a624 100755 --- a/generateHeader.py +++ b/generateHeader.py @@ -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') ] @@ -46,4 +46,4 @@ doc.unlink() icoMoonFile.write("\n\n#endif"); -icoMoonFile.close(); \ No newline at end of file +icoMoonFile.close();