diff --git a/.gitignore b/.gitignore index ad258963..c23882f0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ npm-debug.log # Built assets created at npm install/prepublish time # See https://docs.npmjs.com/misc/scripts +client/fonts/ client/js/libs.min.js.map client/js/libs.min.js client/js/lounge.templates.js diff --git a/client/css/fonts/fontawesome.svg b/client/css/fonts/fontawesome.svg deleted file mode 100644 index 8b66187f..00000000 --- a/client/css/fonts/fontawesome.svg +++ /dev/null @@ -1,685 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/client/css/fonts/fontawesome.woff b/client/css/fonts/fontawesome.woff deleted file mode 100644 index 6e7483cf..00000000 Binary files a/client/css/fonts/fontawesome.woff and /dev/null differ diff --git a/client/css/style.css b/client/css/style.css index 3c28f627..24b79e97 100644 --- a/client/css/style.css +++ b/client/css/style.css @@ -74,8 +74,11 @@ } @font-face { - font-family: FontAwesome; - src: url("fonts/fontawesome.svg") format("svg"), url("fonts/fontawesome.woff") format("woff"); + font-family: "FontAwesome"; + src: url("../fonts/fontawesome-webfont.eot?v=4.6.3"); + src: url("../fonts/fontawesome-webfont.eot?#iefix&v=4.6.3") format("embedded-opentype"), url("../fonts/fontawesome-webfont.woff2?v=4.6.3") format("woff2"), url("../fonts/fontawesome-webfont.woff?v=4.6.3") format("woff"), url("../fonts/fontawesome-webfont.ttf?v=4.6.3") format("truetype"), url("../fonts/fontawesome-webfont.svg?v=4.6.3#fontawesomeregular") format("svg"); + font-weight: normal; + font-style: normal; } html, diff --git a/package.json b/package.json index b680ff41..7b254d8a 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "homepage": "https://thelounge.github.io/", "scripts": { "start": "node index", - "build": "npm run build:grunt && npm run build:handlebars", + "build": "npm run build:font-awesome && npm run build:grunt && npm run build:handlebars", + "build:font-awesome": "node scripts/build-fontawesome.js", "build:grunt": "grunt", "build:handlebars": "handlebars client/views/ -e tpl -f client/js/lounge.templates.js", "test": "(npm run test:mocha || true) && npm run lint", @@ -42,6 +43,7 @@ "commander": "2.9.0", "event-stream": "3.3.2", "express": "4.13.4", + "fs-extra": "0.30.0", "irc-framework": "2.0.0", "lodash": "4.11.2", "mkdirp": "0.5.1", @@ -55,6 +57,7 @@ "devDependencies": { "chai": "3.5.0", "eslint": "2.8.0", + "font-awesome": "4.6.3", "grunt": "1.0.1", "grunt-contrib-uglify": "1.0.1", "grunt-contrib-watch": "1.0.0", diff --git a/scripts/build-fontawesome.js b/scripts/build-fontawesome.js new file mode 100644 index 00000000..a38a26db --- /dev/null +++ b/scripts/build-fontawesome.js @@ -0,0 +1,29 @@ +"use strict"; + +var fs = require("fs-extra"); + +var srcDir = "./node_modules/font-awesome/fonts/"; +var destDir = "./client/fonts/"; +var fonts = [ + "fontawesome-webfont.eot", + "fontawesome-webfont.svg", + "fontawesome-webfont.ttf", + "fontawesome-webfont.woff", + "fontawesome-webfont.woff2" +]; + +fs.ensureDir(destDir, function (err) { + if (err) { + console.error(err); + } + + fonts.forEach(function (font) { + fs.copy(srcDir + font, destDir + font, function (err) { + if (err) { + console.error(err); + } else { + console.log(font + " successfully installed."); + } + }); + }); +});