/* Adding icons: Download http://fortawesome.github.io/Font-Awesome/assets/font-awesome-4.3.0.zip Unzip to 'c:/dev/temp/Font-Awesome' Go to http://fortawesome.github.io/Font-Awesome/icons/ Find the icon you want From the root github folder run: node tools/addicon.js iconname Use "svg:fa-iconanme,black" in the code. */ var fs = require('fs') var faPath = 'c:/dev/temp/Font-Awesome' var svgTs = 'rt/svg.ts' var icons = {} var currIcon = "" var ic = process.argv[2] if (!ic) { console.log("usage: node addicon.js iconname") process.exit(1) } fs.readFileSync(faPath + "/css/font-awesome.css", "utf8").split(/\n/).forEach(function (line) { var m = /^\.fa-(\S+):before/.exec(line) if (m) currIcon = m[1] m = /content: "\\(....)"/.exec(line) if (currIcon && m) { icons[currIcon] = m[1] currIcon = "" } }) if (!icons.hasOwnProperty(ic)) { var r = new RegExp(ic) console.log("No such icon: " + ic + ", similar icons:") console.log(Object.keys(icons).filter(function(k) { return r.test(k) }).join(", ")) process.exit(1) } var svg = {} fs.readFileSync(faPath + "/fonts/fontawesome-webfont.svg", "utf8").split(/\n/).forEach(function (line) { var m = /^